r1933: *** empty log message ***
[uffi.git] / make-dist.sh
index e1f548dbd82e05c98c3a8d330ec8f1ff87f7702b..3bbd21325d26a39c895c6dc06a8336fc80d33470 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash 
+#
 # Creates debian and upstream packages
 # Programmer: Kevin Rosenberg
 
@@ -10,9 +11,9 @@ usage () {
   cat >&2 <<EOF
 Usage: $progname [options]
 Options:
-  -t   Tag CVS tree with versions
-  -c   Use cvs-buildpackage
-  -l   Run lintian on package
+  -t   Tag CVS tree with current version numbers
+  -d   Use dpkg-buildpackage rather than default cvs-buildpackage
+  -l   Run lintian after building
   -h   Print this brief help
 EOF
 }
@@ -23,17 +24,16 @@ while [ $# != 0 ]; do
     case "$1" in
         -h)  usage; exit 0           ;;
         -t)  opt_tag=1               ;;
-        -c)  opt_cvs_buildpackage=1  ;;
+        -d)  opt_dpkg_buildpackage=1 ;;
         -l)  opt_lintian=1           ;;
          *)  usage; exit 0           ;;
     esac
     shift
 done
 
-
 DEBPKG=cl-uffi
 PKG=uffi
-TOPDIR=`basename $PWD`
+TOPDIR=`pwd`
 
 VERSION=`cat VERSION`
 DEBVERSION=`sed -n -e "s/${DEBPKG} (\(.*\)).*/\1/p" < debian/changelog  |head -1`
@@ -41,6 +41,10 @@ PACKAGE_DIR=/usr/local/src/Packages/${DEBPKG}
 DISTDIR=${PKG}-${VERSION}
 DEBDIR=${DEBPKG}-${VERSION}
 
+if [ -z ${opt_dpkg_buildpackage} ]; then
+  export CVSROOT=`cat CVS/Root`
+fi
+
 if [ ! -z ${opt_tag} ]; then
   DEB_TAG=debian_version_`echo ${DEBVERSION} | tr . _`
   UPSTREAM_TAG=upstream_version_`echo ${VERSION} | tr . _`
@@ -88,15 +92,17 @@ rm -rf ${DEBDIR}/debian/CVS
 
 rm -rf ${DISTDIR}
 
-if [ -z ${opt_cvs_buildpackage} ]; then
+if [ -z ${opt_dpkg_buildpackage} ]; then
+  cd ${TOPDIR}
+  cvs-buildpackage -rfakeroot -kkevin@rosenberg.net -H${TOPDIR}/cvsbp-prepare -tC -i.pdf ${DEBPKG}
+  cd ..
+else
   cd ${DEBDIR}
   echo "Building Debian files"
   dpkg-buildpackage -rfakeroot -kkevin@rosenberg.net -a
-else
-  cvsbp
+  cd ..
 fi
 
-cd ..
 rm -rf ${DEBDIR}
 
 echo "Moving Upstream and Debian Files to ${PACKAGE_DIR}"