Debianization for 1.01-2
[qmail] / debian / build-qmail
CommitLineData
9312c29d
MW
1#!/bin/sh -e
2
3NEWDIR=./qmail
4
5cat <<-'!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
15echo -n "Where would you like to do this [$NEWDIR] "
16read line
17
18NEWDIR="${line:-$NEWDIR}"
19
20if test -d $NEWDIR
21then
22 echo -n "'$NEWDIR' already exists, should I use it anyway ? [yN] "
23 read yn
24 test "$yn" = y -o "$yn" = Y || exit 1
25else
26 mkdir $NEWDIR
27fi
28
29cd $NEWDIR
30dpkg-source -x /usr/src/qmail-src/qmail_*.dsc
31cd qmail-*
32
33BECOMEROOT=fakeroot
34cat <<-'!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!
41echo -n "Should I use sudo or fakeroot to build the package ? [sF] "
42read yn
43test "$yn" = s -o "$yn" = S && BECOMEROOT=sudo
44
45dpkg-buildpackage -us -uc -r$BECOMEROOT