]> arthur.barton.de Git - netatalk.git/blob - distrib/debian/cvs2deb.sh
Cleanups.
[netatalk.git] / distrib / debian / cvs2deb.sh
1 #!/bin/sh
2
3 # Execute this script from the main netatalk source directory.
4
5 set -e
6
7 debiandir=distrib/debian
8
9 if test ! -d libatalk; then
10   echo "Not in netatalk directory"
11   exit 1
12 fi
13
14 VERSION=`cat VERSION`
15 if test -e "$debiandir/VERSION"; then
16   DEBVERSION=`cat "$debiandir/VERSION"`
17 else
18   DEBVERSION="$VERSION"
19 fi
20 DISTDIR="netatalk-$VERSION"
21 DISTTGZ="netatalk_$DEBVERSION.orig.tar.gz"
22
23 if test ! -f INSTALL; then
24   if test -e INSTALL; then
25     echo "INSTALL is in the way, please move it away"
26     exit 1
27   fi
28   touch INSTALL
29 fi
30
31 if test ! -x configure; then
32   ./autogen.sh
33 fi
34
35 if test ! -e Makefile; then
36   if test -x config.status; then
37     ./config.status
38   else
39     ./configure
40   fi
41 fi
42
43 make dist
44
45 mv "netatalk-$VERSION.tar.gz" "$DISTTGZ"
46 rm -rf "$DISTDIR" || true
47 tar xzf "$DISTTGZ"
48
49 for FILE in `find $debiandir/patches/*.patch`; do
50   patch --dir="$DISTDIR" --strip=1 <$FILE
51 done
52
53 cp -a "$debiandir" "$DISTDIR"
54 rm -r "$DISTDIR/debian/CVS"
55 rm -r "$DISTDIR/debian/patches"
56 rm -r "$DISTDIR/debian/split-init"
57 rm    "$DISTDIR/debian/cvs2deb.sh"
58 rm    "$DISTDIR/debian/TODO"
59 rm    "$DISTDIR/debian/VERSION"
60
61 cd $DISTDIR
62
63 touch INSTALL
64
65 automake
66
67 dpkg-buildpackage -rfakeroot
68
69 cd ..
70 rm -r "$DISTDIR"
71 rm INSTALL