chiark / gitweb /
Debianization for 1.01-2
[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" $f.$$ >$f && \
20     rm $f.$$
21 done
22
23 if ls *.$$ >/dev/null 2>&1; then
24     echo Error during debianization! Some temporary files remain.
25     exit 1
26 fi
27
28 if fgrep QMAIL/bin *.sh; then
29     echo Error during debianization! Some .sh files still have relative paths.
30     exit 2
31 fi
32
33
34 if fgrep -q nofiles conf-groups; then
35     if sed <conf-groups >conf-groups.$$ -e '2s/nofiles/nogroup/' && \
36       mv -f conf-groups.$$ conf-groups; then
37         echo The file conf-groups was auto-edited. 
38         echo Please eyeball it to see if the editing was done correctly.
39         echo --- begin conf-groups ----
40         cat conf-groups
41         echo ---  end conf-groups  ----
42         echo
43     else
44         echo Error during auto-editing of conf-groups!
45         exit 3
46     fi
47 fi
48
49 if grep '\"bin/' *.c | grep -v 'qmail-\(check\|setup\)' >/dev/null; then
50     echo Remember to replace the relative paths by full paths in the following files:
51     grep '\"bin/' *.c | grep -v 'qmail-\(check\|setup\)'
52 fi