5 if [ -n "$EX4DEBUG" ]; then
6 echo "now debugging $0 $@"
11 if [ -z "$(which grep-dctrl)" ] ||
! [ -x "$(which grep-dctrl)" ]; then
12 echo >&2 "ERR: no grep-dctrl binary"
16 fakeroot debian
/rules clean
29 sed -e "s/exim4-daemon-custom/exim4-daemon-$PACKAGESUFFIX/g;\
30 s/exim4-custom/exim4-$PACKAGESUFFIX/g"
36 if [ -z "$DSTFILE" ]; then
37 echo >&2 "no destination file given to copytextreplace $FILE"
40 [ $DEBUG ] && echo >&2 "DBG: source $FILE"
41 [ $DEBUG ] && echo >&2 "DBG: dst $DSTFILE"
42 if ! [ -e "$DSTFILE" ]; then
43 < $FILE replacepkgname
> $DSTFILE
44 chmod --reference=$FILE $DSTFILE
46 echo >&2 "ERR: can't write to $DSTFILE, file exists"
51 NEEDEDFILES
="exim4-daemon-custom.* rules control"
52 for file in $NEEDEDFILES; do
53 if ! [ -e $file ]; then
54 echo >&2 "ERR: $file does not exist, not starting"
59 # the grep-dctrl|grep construct is necessary on woody,
60 # since woody grep-dctrl does not give sensible return values.
61 if grep-dctrl
--field=Package exim4-daemon-
$PACKAGESUFFIX control | \
62 grep -q '^Package:'; then
63 echo >&2 "ERR: there is already a debian/control entry for exim4-daemon-$PACKAGESUFFIX, not starting"
67 if grep -q exim4-daemon-
$PACKAGESUFFIX rules
; then
68 echo >&2 "ERR: exim4-daemon-$PACKAGESUFFIX already mentioned in debian/rules, not starting"
72 for file in exim4-daemon-custom.
* ; do
73 copytextreplace
$file ${file/exim4-daemon-custom/exim4-daemon-$PACKAGESUFFIX}
77 grep-dctrl
--field=Package exim4-daemon-custom control | \
78 replacepkgname
>> control
80 < rules
sed "/^builddaemonpackages/ \
81 {s/^builddaemonpackages=/builddaemonpackages=exim4-daemon-$PACKAGESUFFIX /; \
85 /^build-exim4-daemon-custom/,/^[^[:space:]]/ \
87 s/exim4-daemon-custom/exim4-daemon-$PACKAGESUFFIX/; \
88 s/exim4-custom/exim4-$PACKAGESUFFIX/; \
89 /^build-exim4-daemon-$PACKAGESUFFIX/p;
94 chmod --reference=rules rules.new