1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- #
- # Create debian files from *.in files
- #
- # $1 = path to debian files
- # $2 = fpc target (i386-linux)
- # $3 = ppcXXX binary name (ppc386)
- #
- if [ $# != 3 ]; then
- echo 'Usage : fixdeb path fpctarget ppcbin'
- exit 1
- fi
- PACKAGEVERSION=`head -n 1 $1/changelog | awk '{ print $2 }' | tr -d '[()]'`
- FPCVERSION=`echo $PACKAGEVERSION | awk -F '-' '{ print $1 }'`
- DEBVERSION=`echo $PACKAGEVERSION | awk -F '-' '{ print $2 }'`
- FPCCVSTAG=`echo $FPCVERSION | awk -F '.' '{ print "RELEASE_"$1"_"$2"_"$3 }'`
- FPCTARGET="$2"
- PPCBIN="$3"
- # Snapshot ?
- if [ "$DEBVERSION" == "0" ]; then
- OLDPACKAGEVERSION=$PACKAGEVERSION
- DEBVERSION=`/bin/date --utc +%Y%m%d`
- PACKAGEVERSION=$FPCVERSION-$DEBVERSION
- sed s+$OLDPACKAGEVERSION+$PACKAGEVERSION+ $1/changelog > $1/changelog.tmp
- mv $1/changelog.tmp $1/changelog
- fi
- echo 'PackageVersion: ' $PACKAGEVERSION
- echo 'FPCVersion : ' $FPCVERSION
- echo 'FPCTarget : ' $FPCTARGET
- echo 'DebVersion : ' $DEBVERSION
- echo 'PPCBin : ' $PPCBIN
- echo 'CVSTag : ' $FPCCVSTAG
- for i in $1/*.in
- do
- j=${i/%.in/}
- sed -e 's/%{fpcversion}/'$FPCVERSION'/g;s/%{packageversion}/'$PACKAGEVERSION'/g;s/%{ppcbin}/'$PPCBIN'/g;s/%{fpctarget}/'$FPCTARGET'/g;s/%{fpccvstag}/'$FPCCVSTAG'/g' $i > $j
- done
|