]> arthur.barton.de Git - netatalk.git/blobdiff - distrib/debian/cvs2deb.sh
Fix ressource leak in moveandrename
[netatalk.git] / distrib / debian / cvs2deb.sh
index eeaadbf7639892d3695d402839e73455ef897399..699131f86b0405b998a16db94c06d0a3e37b8629 100755 (executable)
@@ -1,21 +1,29 @@
 #!/bin/sh
 
-# Execute this script from the main 
+# Execute this script from the main netatalk source directory.
 
 set -e
 
 debiandir=distrib/debian
 
-if test ! -e README.ASUN; then
+if test ! -d libatalk; then
   echo "Not in netatalk directory"
   exit 1
 fi
 
 VERSION=`cat VERSION`
-DEBVERSION=`cat "$debiandir/VERSION"`
+DEBVERSION="${VERSION}cvs"
 DISTDIR="netatalk-$VERSION"
 DISTTGZ="netatalk_$DEBVERSION.orig.tar.gz"
 
+if test ! -f INSTALL; then
+  if test -e INSTALL; then
+    echo "INSTALL is in the way, please move it away"
+    exit 1
+  fi
+  touch INSTALL
+fi
+
 if test ! -x configure; then
   ./autogen.sh
 fi
@@ -31,7 +39,7 @@ fi
 make dist
 
 mv "netatalk-$VERSION.tar.gz" "$DISTTGZ"
-rm -rf "netatalk-$VERSION" || true
+rm -rf "$DISTDIR" || true
 tar xzf "$DISTTGZ"
 
 for FILE in `find $debiandir/patches/*.patch`; do
@@ -41,9 +49,17 @@ done
 cp -a "$debiandir" "$DISTDIR"
 rm -r "$DISTDIR/debian/CVS"
 rm -r "$DISTDIR/debian/patches"
+rm -r "$DISTDIR/debian/split-init"
 rm    "$DISTDIR/debian/cvs2deb.sh"
-rm    "$DISTDIR/debian/VERSION"
 
-cd "$DISTDIR" && dpkg-buildpackage -rfakeroot
+cd $DISTDIR
+
+touch INSTALL
+
+automake
+
+dpkg-buildpackage -rfakeroot
 
-cd .. && rm -r "$DISTDIR"
+cd ..
+rm -r "$DISTDIR"
+rm INSTALL