debian/rules: Use `git' potty wrapper.
[qmail] / debian / debianize-source-tree
1 #!/bin/bash
2
3 set -e
4
5 if [ ! -f qmail-start.c ]; then
6 echo "This program must be run from the qmail source directory!"
7 exit 1
8 fi
9
10 #if [ ! -f qmail-send.8 ]; then
11 # make man
12 #fi
13
14 for f in `fgrep -l QMAIL/bin *.sh`; do
15 mv $f $f.$$ && sed -e "s,QMAIL/bin/predate,/usr/sbin/predate,g" \
16 -e "s,QMAIL/bin/sendmail,/usr/sbin/sendmail,g" \
17 -e "s,QMAIL/bin/maildir2mbox,/usr/bin/maildir2mbox,g" \
18 -e "s,QMAIL/bin/qmail-inject,/usr/sbin/qmail-inject,g" \
19 -e "s,QMAIL/bin/qlist,/usr/bin/qlist,g" \
20 -e "s,QMAIL/bin:,/usr/bin:/usr/sbin,g" $f.$$ >$f && \
21 rm $f.$$
22 done
23
24 if ls *.$$ >/dev/null 2>&1; then
25 echo Error during debianization! Some temporary files remain.
26 exit 1
27 fi
28
29 if fgrep QMAIL/bin *.sh; then
30 echo Error during debianization! Some .sh files still have relative paths.
31 exit 2
32 fi
33
34
35 if fgrep -q nofiles conf-groups; then
36 if sed <conf-groups >conf-groups.$$ -e '2s/nofiles/nogroup/' && \
37 mv -f conf-groups.$$ conf-groups; then
38 echo The file conf-groups was auto-edited.
39 echo Please eyeball it to see if the editing was done correctly.
40 echo --- begin conf-groups ----
41 cat conf-groups
42 echo --- end conf-groups ----
43 echo
44 else
45 echo Error during auto-editing of conf-groups!
46 exit 3
47 fi
48 fi
49
50 if grep '\"bin/' *.c | grep -v 'qmail-\(check\|setup\)' >/dev/null; then
51 echo Remember to replace the relative paths by full paths in the following files:
52 grep '\"bin/' *.c | grep -v 'qmail-\(check\|setup\)'
53 fi