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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#!/bin/sh
#
# This program is a part of debnest.
#
# $Id: dsc2debian,v 1.15 2004/10/05 10:33:01 taru Exp $
if test "x$2" = "x"; then
echo "Usage: $0 <.dsc> <destination> [<suffix>]"
exit 1
fi
if test -f "/usr/share/debnest/modules"; then
. /usr/share/debnest/modules
fi
if test "x$3" != "x"; then
suffix=$3
fi
dir=`dir $1`
dsc=$dir/`basename $1`
dest=$2
src=`src $dsc`
ver=`version $dsc`-1
upv=`upstream_version $dsc`
tmpdir=/tmp/dsc2debian.$$
/bin/mkdir $tmpdir
trap "/bin/rm -rf $tmpdir" 0
install -d $dest/debian
(cd $tmpdir; dpkg-source -x $dsc; cd $src-$upv; dch -p -v $ver "New upstream release based on debian '$src (`version $dsc`)' source package created by debnest_make.") > /dev/null
if test "x$DEBNEST_RULES" != "x"; then
if test -f "$DEBNEST_RULES"; then
:
elif test -f "/usr/share/debnest/$DEBNEST_RULES"; then
DEBNEST_RULES=/usr/share/debnest/$DEBNEST_RULES
else
echo "W: No such rules found: $DEBNEST_RULES" 1>&2
echo "W: Using default rules" 1>&2
DEBNEST_RULES=""
fi
fi
if test "x$DEBNEST_RULES" = "x"; then
if test -f "rules"; then
DEBNEST_RULES="rules"
elif test -f "/usr/share/debnest/rules"; then
DEBNEST_RULES="/usr/share/debnest/rules"
fi
fi
install -m 755 $DEBNEST_RULES $dest/debian/rules
if ! test -f $dest/debian/changelog; then
sed "s/$src ($ver)\(.*\)/$src$suffix ($ver)\1/" $tmpdir/$src-$upv/debian/changelog > $dest/debian/changelog
fi
if ! grep Build-Depends $tmpdir/$src-$upv/debian/control | cut -d' ' -f2- | sed -e 's/,/\n/g' -e 's/(.*)//' | while read e; do echo $e; done | egrep "^debnest$" > /dev/null; then
if grep Build-Depends $tmpdir/$src-$upv/debian/control > /dev/null; then
extra_builddep="$EXTRA_BUILDDEP"
fi
fi
if ! grep Build-Depends-Indep $tmpdir/$src-$upv/debian/control | cut -d' ' -f2- | sed -e 's/,/\n/g' -e 's/(.*)//' | while read e; do echo $e; done | egrep "^debnest$" > /dev/null; then
if grep Build-Depends-Indep $tmpdir/$src-$upv/debian/control > /dev/null; then
extra_buildindep="$EXTRA_BUILDDEP"
fi
fi
maint=`cd $dest > /dev/null; dpkg-parsechangelog | egrep "^Maintainer: " | cut -d' ' -f2-`
sed -e "s/^Source: .*/Source: $src$suffix/" -e "s/^Maintainer: .*/Maintainer: $maint/" -e "s/^Build-Depends: \(.*\)/Build-Depends: \1$extra_builddep/" -e "s/Build-Depends-Indep: \(.*\)/Build-Depends-Indep: \1$extra_buildindep/" $tmpdir/$src-$upv/debian/control > $dest/debian/control
|