#!/bin/sh

# Drop the build path from the filename mentioned in GFORTRAN mod files
# Alastair McKinstry , <mckinstry@debian.org>, 2018-02-01

tf1=`tempfile`
tf2=`tempfile`
zcat $1 > $tf1
fname=`grep 'created from' $tf1 | awk '{print $7}'`
v=`basename $fname`
echo "GFORTRAN module version '14' created from $v" > $tf2
cat $tf1 |  sed -n '2,$p' >> $tf2
gzip < $tf2 > $1
