1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh
# (c) 2003 Piotr Roszatycki <dexter@debian.org>, GPL
# This utility converts original tgz archive into Debian source package
# into *.orig.tar.gz
set -e
if [ -f ../debian/changelog ]; then
cd ..
elif [ ! -f debian/changelog ]; then
echo "can't find changelog file"
exit 1
fi
srcname=`head -n 1 debian/changelog | sed 's/ .*//'`
srcversion=`head -n 1 debian/changelog | sed -e 's/.*(//' -e 's/-[^-]*).*//'`
srcdir=${srcname}-`echo $srcversion | sed -e 's/.*://'`
srcorig=${srcname}_`echo $srcversion | sed -e 's/.*://'`.orig.tar.gz
upsrcversion=`echo $srcversion | sed 's/-.*//'`
upsrcdir=apache2-$upsrcversion
tmpdir=debsource-$srcname
pkgdir=$(pwd)
cd ..
mkdir $tmpdir
cd $tmpdir
echo "N: Unpacking upstream..."
dpkg-source -x ../apache2_$srcversion.dsc
( cd $upsrcdir/upstream/tarballs; tar zxf httpd-*.tar.gz )
mkdir $srcdir
cp -a \
$upsrcdir/upstream/tarballs/httpd-*/modules/aaa/mod_auth.c \
$srcdir/mod_auth_plain.c
( cd $srcdir; patch mod_auth_plain.c $pkgdir/patches/mod_auth.c.patch
find -name '*.orig' | xargs rm -f )
echo "N: Copying new files to package directory..."
cp -a $srcdir/mod_auth_plain.c $pkgdir
cd ..
rm -rf $tmpdir
echo "N: Done."
|