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
|
#!/usr/bin/make -f
CC =gcc
CFLAGS =-W -Wall -Wshadow -O2 -g
STRIP =strip
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
CC =diet -v -Os gcc
CFLAGS =-nostdinc -W -Wall -Wshadow
endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
STRIP =: nostrip
endif
DIR =$(shell pwd)/debian/mailfront
patch: deb-checkdir patch-stamp
patch-stamp:
for i in `ls -1 debian/diff/*.diff || :`; do \
patch -p0 <$$i || exit 1; \
done
touch patch-stamp
configure: deb-checkdir configure-stamp
configure-stamp: patch-stamp
for i in conf-*; do \
test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \
done
echo '/usr/sbin' >conf-bin
echo '/usr/lib/bglibs/include' >conf-bgincs
test '$(CC)' = 'gcc' || echo '/usr/lib/diet/bglibs/include' >conf-bgincs
echo '/usr/lib/bglibs/lib' >conf-bglibs
test '$(CC)' = 'gcc' || echo '/usr/lib/diet/bglibs/lib' >conf-bglibs
echo '$(CC) $(CFLAGS)' >conf-cc
echo '$(CC)' >conf-ld
touch configure-stamp
build: deb-checkdir build-stamp
build-stamp: configure-stamp
$(MAKE)
sh tests.sh
touch build-stamp
clean: deb-checkdir deb-checkuid
-$(MAKE) clean
for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done
! test -e patch-stamp || \
for i in `ls -1r debian/diff/*.diff || :`; do patch -p0 -R <$$i; done
rm -f patch-stamp configure-stamp build-stamp install-stamp
rm -rf '$(DIR)'
rm -f debian/files debian/substvars changelog
install: deb-checkdir deb-checkuid install-stamp
install-stamp: build-stamp
rm -rf '$(DIR)'
PATH="/usr/lib/bglibs/bin:$$PATH" make install install_prefix='$(DIR)'
$(STRIP) -R .comment -R .note '$(DIR)'/usr/sbin/*
# man pages
install -d -m0755 '$(DIR)'/usr/share/man/man8
for i in debian/man/*.8; do \
install -m0644 $$i '$(DIR)'/usr/share/man/man8/ || exit 1; \
done
for i in '$(DIR)'/usr/share/man/man8/*.8; do \
test "`head -c4 $$i`" != '.so ' || \
(ln -s "`head -n1 $$i |cut -c10-`".gz $$i.gz && rm -f $$i) \
|| exit 1; \
done
gzip -9 '$(DIR)'/usr/share/man/man8/*.8
# service directories
install -d -m0755 \
'$(DIR)'/usr/share/doc/mailfront/etc/smtpfront-qmail/log
install -m0644 debian/etc/smtpfront-qmail/run \
'$(DIR)'/usr/share/doc/mailfront/etc/smtpfront-qmail/run
install -m0644 debian/etc/smtpfront-qmail/log/run \
'$(DIR)'/usr/share/doc/mailfront/etc/smtpfront-qmail/log/run
install -d -m0755 \
'$(DIR)'/usr/share/doc/mailfront/etc/smtpfront-qmail/peers
install -m0644 debian/etc/smtpfront-qmail/peers/127 \
'$(DIR)'/usr/share/doc/mailfront/etc/smtpfront-qmail/peers/127
# changelog
test -r changelog || ln -s ChangeLog changelog
touch install-stamp
binary-indep:
binary-arch: deb-checkdir deb-checkuid install-stamp mailfront.deb
test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/sbin/*
dpkg-gencontrol -isp -pmailfront -P'$(DIR)'
dpkg -b '$(DIR)' ..
binary: binary-indep binary-arch
.PHONY: patch configure build clean install binary-indep binary-arch binary
include debian/implicit
|