debian/rules: Use `git' potty wrapper.
[qmail] / debian / build-qmail
1 #!/bin/sh -e
2
3 NEWDIR=./qmail
4
5 cat <<-'!END!'
6
7 This script unpacks the qmail source in /usr/src/qmail-src
8 into a directory, and compiles it to produce a binary qmail*.deb file
9 The directory where this is done will end up containing the
10 source and package files for the qmail binary package, along
11 with a directory containing the unpacked source.
12
13 !END!
14
15 echo -n "Where would you like to do this [$NEWDIR] "
16 read line
17
18 NEWDIR="${line:-$NEWDIR}"
19
20 if test -d $NEWDIR
21 then
22 echo -n "'$NEWDIR' already exists, should I use it anyway ? [yN] "
23 read yn
24 test "$yn" = y -o "$yn" = Y || exit 1
25 else
26 mkdir $NEWDIR
27 fi
28
29 cd $NEWDIR
30 dpkg-source -x /usr/src/qmail-src/qmail_*.dsc
31 cd qmail-*
32
33 BECOMEROOT=fakeroot
34 cat <<-'!END!'
35
36 For some reason fakeroot causes install to hang on my system, so I'm
37 giving you the option of running sudo or fakeroot. Give fakeroot a try
38 but if it does not work use sudo instead.
39
40 !END!
41 echo -n "Should I use sudo or fakeroot to build the package ? [sF] "
42 read yn
43 test "$yn" = s -o "$yn" = S && BECOMEROOT=sudo
44
45 dpkg-buildpackage -us -uc -r$BECOMEROOT