]> arthur.barton.de Git - netatalk.git/blob - distrib/debian/cvs2deb.sh
Debian packaging files from Sebastian Rittau (srittau@jroger.in-berlin.de)
[netatalk.git] / distrib / debian / cvs2deb.sh
1 #!/bin/sh
2
3 # Execute this script from the main 
4
5 set -e
6
7 debiandir=distrib/debian
8
9 if test ! -e README.ASUN; then
10   echo "Not in netatalk directory"
11   exit 1
12 fi
13
14 VERSION=`cat VERSION`
15 DEBVERSION=`cat "$debiandir/VERSION"`
16 DISTDIR="netatalk-$VERSION"
17 DISTTGZ="netatalk_$DEBVERSION.orig.tar.gz"
18
19 if test ! -x configure; then
20   ./autogen.sh
21 fi
22
23 if test ! -e Makefile; then
24   if test -x config.status; then
25     ./config.status
26   else
27     ./configure
28   fi
29 fi
30
31 make dist
32
33 mv "netatalk-$VERSION.tar.gz" "$DISTTGZ"
34 rm -rf "netatalk-$VERSION" || true
35 tar xzf "$DISTTGZ"
36
37 for FILE in `find $debiandir/patches/*.patch`; do
38   patch --dir="$DISTDIR" --strip=1 <$FILE
39 done
40
41 cp -a "$debiandir" "$DISTDIR"
42 rm -r "$DISTDIR/debian/CVS"
43 rm -r "$DISTDIR/debian/patches"
44 rm    "$DISTDIR/debian/cvs2deb.sh"
45 rm    "$DISTDIR/debian/VERSION"
46
47 cd "$DISTDIR" && dpkg-buildpackage -rfakeroot
48
49 cd .. && rm -r "$DISTDIR"