From 699d3111400262ff708da385439f69516b384227 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sun, 25 Nov 2001 15:56:09 +0000 Subject: [PATCH] Debianize.helm stuff. Now you can check out a cvs revision and obtain a *clean* debianized source tree executing "debian/debianize.helm". Moreover the generated debian packages are native debian packages. --- helm/minidom/debian/autopippe.helm | 5 ++ helm/minidom/debian/debianize.helm | 97 ++++++++++++++++++++++++++++++ helm/minidom/debian/garbage.helm | 2 + 3 files changed, 104 insertions(+) create mode 100644 helm/minidom/debian/autopippe.helm create mode 100755 helm/minidom/debian/debianize.helm create mode 100644 helm/minidom/debian/garbage.helm diff --git a/helm/minidom/debian/autopippe.helm b/helm/minidom/debian/autopippe.helm new file mode 100644 index 000000000..9c5e5e706 --- /dev/null +++ b/helm/minidom/debian/autopippe.helm @@ -0,0 +1,5 @@ +aclocal +autoheader +automake -a +automake -a +autoconf diff --git a/helm/minidom/debian/debianize.helm b/helm/minidom/debian/debianize.helm new file mode 100755 index 000000000..5bdbe1789 --- /dev/null +++ b/helm/minidom/debian/debianize.helm @@ -0,0 +1,97 @@ +#!/bin/sh + +# HELM project convenience script +# +# call this as "debian/debianize.helm" to convert a checked out CVS +# module to a debianize source tree ready to be called against debuild +# or dpkg-buildpackage +# +# Stefano "Zack" Zacchiroli +# Sun Nov 25 16:50:10 CET 2001 + +NAME="MINIDOM" # package name in configure.in's opinion +CONFIGURE_IN="configure.in" # configure.in + +# TAR="tar" +# TARFLAGS="-cz" # tar flags used when creating source package + +if [ -z $NAME ]; then + echo "Please edit me and configure the 'NAME' parameter." + exit 1 +fi + + # parse version number from configure.in +echo "Retrieving version number from $CONFIGURE_IN ..." +VERSION="" +for v in MAJOR MINOR MICRO; do + T=`grep "$NAME\_$v\_VERSION\=" $CONFIGURE_IN` + T=`echo $T | sed -e 's/.*=//'` + if [ -z $VERSION ]; then + VERSION=$T + else + VERSION="$VERSION.$T" + fi +done +echo "Version number is: $VERSION" + + # create a new working dir named with the "name-version" schema +echo "Creating debianized source tree ..." +OLDDIR=`basename \`pwd\`` +NEWDIR="$OLDDIR-$VERSION" +cd .. +if [ -d $NEWDIR ]; then + echo "'../$NEWDIR' already exists, please remove it before continue" + exit 1 +fi +cp -r $OLDDIR $NEWDIR +cd $NEWDIR +echo "Debianized source tree starts at `pwd`" + + # autopippe: autoconf, automake, aclocal, ... +echo "Executing auto-* tools ..." +source debian/autopippe.helm +echo "auto-* executed!" + + # remove CVS related files, and other garbage +echo "Removing garbage files ..." +find . -regex '.*\.cvsignore' -exec rm -f {} \; +find . -regex '.*CVS.*' -and -type d -exec rm -rf {} \; +GARBAGES=`egrep -v '^#' debian/garbage.helm` +for p in $GARBAGES; do + find . -name $p -exec rm -f {} \; +done +echo "Garbage removed!" + + # fix remote symlinks +echo "Dereferencing absolute symlinks ..." +PWD=`pwd` +for l in `find . -type l -maxdepth 1`; do # loop on symlink in this dir + SOURCE=$l + TARGET=`readlink $l` + if `echo $TARGET | egrep "^/" > /dev/null`; then + echo "$SOURCE -> $TARGET" + rm -f $SOURCE + cp $TARGET $SOURCE + fi # if symlink does not begin with "/" then it is relative +done +echo "Dereferencing done!" + + # upgrade debian changelog +echo "Upgrading debian changelog version to $VERSION ..." +dch --newversion $VERSION +echo "Debian changelog upgraded!" + +# # build debian native source package +# echo -n "Building debian (native) source package: " +# DEBVERSION=`dpkg-parsechangelog -ldebian/changelog | egrep '^Version: ' | sed -e 's/Version: //'` +# DEBNAME=`dpkg-parsechangelog -ldebian/changelog | egrep '^Source: ' | sed -e 's/Source: //'` +# SOURCEPKGFILE="$DEBNAME""_""$DEBVERSION.tar.gz" +# echo "../$SOURCEPKGFILE" +# cd .. +# $TAR $TARFLAGS -f $SOURCEPKGFILE $NEWDIR + +echo +echo "Debianization is over." +echo "Please change to ../$NEWDIR in order to build the debian package." + + diff --git a/helm/minidom/debian/garbage.helm b/helm/minidom/debian/garbage.helm new file mode 100644 index 000000000..3542a1b97 --- /dev/null +++ b/helm/minidom/debian/garbage.helm @@ -0,0 +1,2 @@ +# find patterns; files that match will be removed from debian package. +*.helm -- 2.39.2