2 # Makes Debian source for package in deb-src
3 # The current directory should hold a .tar.gz (dist) for the package
4 # And the current directory should hold a debian and a corresponding changelog
5 DEBCHANGELOG=debian/changelog
6 if test ! -f $DEBCHANGELOG; then
7 echo "$DEBCHANGELOG missing"
8 echo "The current directory should be base source of package"
11 if test -f debian/.gitignore; then
12 cd debian; for i in `cat .gitignore`; do rm -fr $i; done; cd ..
14 if test -d deb-src; then
15 echo "deb-src exist. You might remove it"
18 l=`head -1 $DEBCHANGELOG`
19 PROD=`echo $l|sed 's/ .*//g'`
20 VERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'`
21 echo "VERSION=$VERSION"
22 MAJOR=`echo $VERSION|sed 's/-.*//g'`
24 MINOR=`echo $VERSION|sed 's/.*-//g'`
26 TAR=${PROD}-${MAJOR}.tar.gz
27 if test ! -f ${TAR}; then
28 echo "$0: ${TAR} missing"
33 ORIG=${PROD}_${MAJOR}.orig.tar.gz
36 cp ${TAR} deb-src/${ORIG}
39 cp -r ../debian ${PROD}-${MAJOR}
40 dpkg-source -b ${PROD}-${MAJOR}