| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
DEBUG = |
| 4 |
INSTALL_PROGRAM = install |
| 5 |
|
| 6 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 7 |
DEBUG = -DDEBUG -g |
| 8 |
endif |
| 9 |
|
| 10 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 11 |
INSTALL_PROGRAM += -s |
| 12 |
endif |
| 13 |
|
| 14 |
build: build-all |
| 15 |
|
| 16 |
build-all: |
| 17 |
$(checkdir) |
| 18 |
touch imap/ip6 |
| 19 |
./configure |
| 20 |
make |
| 21 |
touch build-all |
| 22 |
|
| 23 |
clean: checkroot |
| 24 |
$(checkdir) |
| 25 |
-rm -f build-all |
| 26 |
-rm -rf debian/tmp debian/files* core debian/substvars |
| 27 |
|
| 28 |
binary-indep: checkroot build-all |
| 29 |
|
| 30 |
binary-arch: checkroot build-all |
| 31 |
$(checkdir) |
| 32 |
-rm -rf debian/tmp |
| 33 |
install -D -m755 debian/preinst debian/tmp/DEBIAN/preinst |
| 34 |
install -D -m755 debian/postinst debian/tmp/DEBIAN/postinst |
| 35 |
install -D -m755 debian/postrm debian/tmp/DEBIAN/postrm |
| 36 |
install -D -m644 debian/menu debian/tmp/usr/lib/menu/alpine |
| 37 |
|
| 38 |
$(INSTALL_PROGRAM) -D -m755 alpine/alpine debian/tmp/usr/bin/alpine |
| 39 |
$(INSTALL_PROGRAM) -D -m755 imap/mlock/mlock debian/tmp/usr/sbin/mlock |
| 40 |
$(INSTALL_PROGRAM) -D -m755 alpine/rpload debian/tmp/usr/bin/rpload |
| 41 |
$(INSTALL_PROGRAM) -D -m755 alpine/rpdump debian/tmp/usr/bin/rpdump |
| 42 |
$(INSTALL_PROGRAM) -D -m755 pico/pico debian/tmp/usr/bin/pico |
| 43 |
$(INSTALL_PROGRAM) -D -m755 pico/pilot debian/tmp/usr/bin/pilot |
| 44 |
$(INSTALL_PROGRAM) -D -m755 imap/mailutil/mailutil debian/tmp/usr/bin/mailutil |
| 45 |
|
| 46 |
install -D -m644 doc/alpine.1 debian/tmp/usr/share/man/man1/alpine.1 |
| 47 |
install -D -m644 doc/rpload.1 debian/tmp/usr/share/man/man1/rpload.1 |
| 48 |
install -D -m644 doc/rpdump.1 debian/tmp/usr/share/man/man1/rpdump.1 |
| 49 |
install -D -m644 doc/pico.1 debian/tmp/usr/share/man/man1/pico.1 |
| 50 |
install -D -m644 doc/pilot.1 debian/tmp/usr/share/man/man1/pilot.1 |
| 51 |
install -D -m644 imap/src/mailutil/mailutil.1 debian/tmp/usr/share/man/man1/mailutil.1 |
| 52 |
install -D -m644 doc/tech-notes.txt debian/tmp/usr/share/doc/alpine/tech-notes.txt |
| 53 |
install -D -m644 LICENSE debian/tmp/usr/share/doc/alpine/license |
| 54 |
install -D -m644 README debian/tmp/usr/share/doc/alpine/README |
| 55 |
install -D -m644 debian/changelog debian/tmp/usr/share/doc/alpine/changelog |
| 56 |
|
| 57 |
gzip -r9 debian/tmp/usr/share/man |
| 58 |
gzip -9 debian/tmp/usr/share/doc/alpine/changelog |
| 59 |
dpkg-shlibdeps alpine/alpine pico/pico pico/pilot imap/mlock/mlock alpine/rpload alpine/rpdump |
| 60 |
cd debian/tmp && md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums |
| 61 |
dpkg-gencontrol -isp -palpine |
| 62 |
chown -R root.root debian/tmp |
| 63 |
chmod -R go=rX debian/tmp |
| 64 |
chown root.mail debian/tmp/usr/sbin/mlock |
| 65 |
chmod 2755 debian/tmp/usr/sbin/mlock |
| 66 |
dpkg --build debian/tmp .. |
| 67 |
|
| 68 |
define checkdir |
| 69 |
test -f alpine/alpine.c -a -f debian/rules |
| 70 |
endef |
| 71 |
|
| 72 |
binary: binary-indep binary-arch |
| 73 |
|
| 74 |
checkroot: |
| 75 |
$(checkdir) |
| 76 |
test root = "`whoami`" |
| 77 |
|
| 78 |
.PHONY: binary binary-arch binary-indep clean checkroot |
| 79 |
|