1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
#
# This file is also based upon prior sendmail makefiles
#
# Richard Nelson <cowboy@debian.org>
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
package=sendmail
version=$(shell expr `pwd` : '.*-\([0-9.].*\)')
version_main=$(shell expr `pwd` : '.*-\([0-9]*.[0-9.]*\)')
#-------------
build: build-stamp
build-stamp:
dh_testdir
# Add here commands to compile the package.
#$(MAKE)
cp -f debian/site.config.m4 BuildTools/Site/site.config.m4
$(MAKE)
# Debian stuff
cd debian && gcc -O2 -o sensible-mda sensible-mda.c
touch build-stamp
#-------------
clean:
dh_testdir
dh_testroot
rm -f build-stamp install-stamp
# Add here commands to clean up after the build process.
#-$(MAKE) clean
#-$(MAKE) distclean
cp -f debian/site.config.m4 BuildTools/Site/site.config.m4
-$(MAKE) clean
# Local approximation of distclean
for file in \
src mail.local mailstats makemap praliases rmail smrsh; do \
rm -rf $$(find . -name "obj*" -type d); \
done;
rm -f BuildTools/Site/site.config.m4
rm -f debian/{check.tar,sensible-mda}
find .. -name $(package)*.asc -size 0 -maxdepth 1 -exec rm {} ";"
chmod +x debian/{runq,sendmailconfig}
dh_clean
#-------------
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
#dh_clean -k
dh_clean
dh_installdirs
# Add here commands to install the package into debian/tmp.
#-$(MAKE) prefix=`pwd`/debian/tmp/usr install
chmod 700 debian/tmp/var/state/sendmail
# sendmail install proper... with a little help ;-}
cp -f debian/site.config.m4 BuildTools/Site/site.config.m4
$(MAKE) install \
DESTDIR="$$(pwd)/debian/tmp"
cd rmail/obj* && $(MAKE) force-install \
DESTDIR="../../debian/tmp"
# correct what the m4 build process did...
mv debian/tmp/usr/bin/rmail debian/tmp/usr/sbin/rmail
ln -sf ../sbin/rmail debian/tmp/usr/bin/rmail
#mv debian/tmp/usr/sbin/sendmail debian/tmp/usr/sbin/sendmail.real
#chmod 4755 debian/tmp/usr/sbin/sendmail.real
for file in \
debian/tmp/usr/bin/{hoststat,mailq,newaliases,purgestat} \
debian/tmp/usr/lib/sendmail; do \
ln -sf ../sbin/sendmail $$file; \
done;
# contributed stuff - scripts
sed "s?/usr/local/bin/perl?/usr/bin/perl?g" contrib/etrn.pl \
| sed "s?/etc/sendmail.cf?/etc/mail/sendmail.cf?g" \
> debian/tmp/usr/sbin/etrn
chmod a+x debian/tmp/usr/sbin/etrn
sed "s?/usr/local/bin/perl?/usr/bin/perl?g" contrib/expn.pl \
> debian/tmp/usr/bin/expn
chmod a+x debian/tmp/usr/bin/expn
sed "s?/etc/sendmail.cf?/etc/mail/sendmail.cf?g" \
debian/checksendmail/checksendmail.perl \
> debian/tmp/usr/sbin/checksendmail
chmod a+x debian/tmp/usr/sbin/checksendmail
# man
sed "s?/usr/local/bin/perl?/usr/bin/perl?g" contrib/etrn.pl \
> debian/tmp/usr/man/man8/etrn.8
sed "s?/usr/local/bin/perl?/usr/bin/perl?g" contrib/expn.pl \
> debian/tmp/usr/man/man8/expn.8
cp -p debian/checksendmail/checksendmail.8 debian/tmp/usr/man/man8/
# examples
sed "s?/bin/perl?/usr/bin/perl?g" contrib/passwd-to-alias.pl \
> debian/tmp/usr/doc/$(package)/examples/passwd-to-alias
# Debian stuff
install debian/sendmailconfig debian/sensible-mda \
debian/tmp/usr/sbin
install debian/runq debian/tmp/usr/bin
#install -m 755 debian/socks_wrapper debian/tmp/usr/sbin/sendmail
# sendmail documentation
cp -p doc/*/*.ps debian/tmp/usr/doc/$(package)
cd doc && { \
for doc in \
changes/changes intro/intro op/op usenix/usenix; do\
base=$$(basename $$doc.txt); \
test -f $$doc.txt || \
nroff -me $$doc.me | \
cat -s > ../debian/tmp/usr/doc/sendmail/$$base; \
done; \
}
# m4 configuration directories
cp -p cf/README debian/tmp/usr/doc/$(package)/cf.README
cp -a cf/{feature,m4,mailer,sh,domain,ostype} \
debian/tmp/usr/share/sendmail.cf
chmod a+x debian/tmp/usr/share/sendmail.cf/sh/*
cp debian/debproto.mc debian/tmp/usr/share/sendmail.cf/cf/
cp debian/debian.m4 debian/tmp/usr/share/sendmail.cf/ostype/
cp debian/orbs.m4 debian/tmp/usr/share/sendmail.cf/feature/
cp debian/orca.m4 debian/tmp/usr/share/sendmail.cf/feature/
cp -p debian/{aliases,nssnodns.conf} debian/tmp/etc
#$(MAKE) -f debian/rules hacks
dh_movefiles
touch install-stamp
#-------------
binary-indep: build install
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
#-------------
binary-arch: build install
# dh_testversion
dh_testdir
dh_testroot
dh_installchangelogs RELEASE_NOTES
dh_installcron
dh_installdocs
# dh_installemacsen
dh_installexamples
dh_installinit
dh_installmanpages mail.local/*
cd debian/tmp/usr/man/man8 && \
ln -sf sendmail.8.gz ./purgestat.8.gz && \
ln -sf sendmail.8.gz ./hoststat.8.gz
# ln -sf sendmail.8.gz ./sendmail.real.8.gz
# dh_undocumented
dh_installmenu
#
$(MAKE) -s -f debian/rules buildinfo
#
dh_strip
dh_compress
dh_fixperms
#dh_link
dh_suidregister
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_makeshlibs
dh_md5sums
dh_builddeb
#-------------
l33ch:
dh_testdir
cd debian && \
wget --passive-ftp --timestamping \
ftp://rtfm.mit.edu/pub/usenet/comp.mail.sendmail/sendmail_FAQ
#-------------
hacks:
cd debian && uudecode check.tar.uue
cd debian/tmp/usr/doc/$(package) && tar -xf ../../../../check.tar
cd debian/tmp/usr/doc/$(package)/hack; \
for file in *; do \
sed "s/dbm /hash /g" < $$file \
> ../../../share/sendmail.cf/hack/$$file; \
done
sed "s/dbm /hash /g" debian/tmp/usr/doc/$(package)/README.check \
> debian/tmp/usr/doc/$(package)/README.Spam
rm debian/tmp/usr/doc/$(package)/README.check
rm -r debian/tmp/usr/doc/$(package)/hack/
cp -p debian/{rbl*,nodns}.m4 debian/tmp/usr/share/sendmail.cf/hack
#-------------
buildinfo:
@echo; dpkg -l gcc "libc6*" binutils ldso make dpkg-dev $(BUILDINFO) \
| awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' \
| tee debian/tmp/usr/doc/$(package)/buildinfo.Debian; echo
chmod 644 debian/tmp/usr/doc/$(package)/buildinfo.Debian
#-------------
# Below here is fairly generic really
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
|