3 # HELM project convenience script
5 # call this as "debian/debianize.helm" to convert a checked out CVS
6 # module to a debianize source tree ready to be called against debuild
9 # Stefano "Zack" Zacchiroli <zack@cs.unibo.it>
10 # Sun Nov 25 16:50:10 CET 2001
12 NAME="MINIDOM" # package name in configure.in's opinion
13 CONFIGURE_IN="configure.in" # configure.in
16 # TARFLAGS="-cz" # tar flags used when creating source package
19 echo "Please edit me and configure the 'NAME' parameter."
23 # parse version number from configure.in
24 echo "Retrieving version number from $CONFIGURE_IN ..."
26 for v in MAJOR MINOR MICRO; do
27 T=`grep "$NAME\_$v\_VERSION\=" $CONFIGURE_IN`
28 T=`echo $T | sed -e 's/.*=//'`
29 if [ -z $VERSION ]; then
35 echo "Version number is: $VERSION"
37 # create a new working dir named with the "name-version" schema
38 echo "Creating debianized source tree ..."
39 OLDDIR=`basename \`pwd\``
40 NEWDIR="$OLDDIR-$VERSION"
42 if [ -d $NEWDIR ]; then
43 echo "'../$NEWDIR' already exists, please remove it before continue"
48 echo "Debianized source tree starts at `pwd`"
50 # autopippe: autoconf, automake, aclocal, ...
51 echo "Executing auto-* tools ..."
52 source debian/autopippe.helm
53 echo "auto-* executed!"
55 # remove CVS related files, and other garbage
56 echo "Removing garbage files ..."
57 find . -regex '.*\.cvsignore' -exec rm -f {} \;
58 find . -regex '.*CVS.*' -and -type d -exec rm -rf {} \;
59 GARBAGES=`egrep -v '^#' debian/garbage.helm`
60 for p in $GARBAGES; do
61 find . -name $p -exec rm -f {} \;
63 echo "Garbage removed!"
66 echo "Dereferencing absolute symlinks ..."
68 for l in `find . -type l -maxdepth 1`; do # loop on symlink in this dir
71 if `echo $TARGET | egrep "^/" > /dev/null`; then
72 echo "$SOURCE -> $TARGET"
75 fi # if symlink does not begin with "/" then it is relative
77 echo "Dereferencing done!"
79 # upgrade debian changelog
80 echo "Upgrading debian changelog version to $VERSION ..."
81 dch --newversion $VERSION
82 echo "Debian changelog upgraded!"
84 # # build debian native source package
85 # echo -n "Building debian (native) source package: "
86 # DEBVERSION=`dpkg-parsechangelog -ldebian/changelog | egrep '^Version: ' | sed -e 's/Version: //'`
87 # DEBNAME=`dpkg-parsechangelog -ldebian/changelog | egrep '^Source: ' | sed -e 's/Source: //'`
88 # SOURCEPKGFILE="$DEBNAME""_""$DEBVERSION.tar.gz"
89 # echo "../$SOURCEPKGFILE"
91 # $TAR $TARFLAGS -f $SOURCEPKGFILE $NEWDIR
94 echo "Debianization is over."
95 echo "Please change to ../$NEWDIR in order to build the debian package."