summaryrefslogtreecommitdiff
path: root/packages/debian/rules
blob: d539e4b8f3165603b1f685f0333db035d4944b7e (plain)
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
#!/usr/bin/make -f

DEBUG =
INSTALL_PROGRAM = install

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  DEBUG = -DDEBUG -g
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  INSTALL_PROGRAM += -s
endif

build: build-all

build-all:
	$(checkdir)
	touch imap/ip6
	./configure
	make
	touch build-all

clean: checkroot
	$(checkdir)
	-rm -f build-all
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: checkroot build-all

binary-arch: checkroot build-all
	$(checkdir)
	-rm -rf debian/tmp
	install -D -m755 debian/preinst debian/tmp/DEBIAN/preinst
	install -D -m755 debian/postinst debian/tmp/DEBIAN/postinst
	install -D -m755 debian/postrm debian/tmp/DEBIAN/postrm
	install -D -m644 debian/menu debian/tmp/usr/lib/menu/alpine

	$(INSTALL_PROGRAM) -D -m755 alpine/alpine debian/tmp/usr/bin/alpine
	$(INSTALL_PROGRAM) -D -m755 imap/mlock/mlock debian/tmp/usr/sbin/mlock
	$(INSTALL_PROGRAM) -D -m755 alpine/rpload debian/tmp/usr/bin/rpload
	$(INSTALL_PROGRAM) -D -m755 alpine/rpdump debian/tmp/usr/bin/rpdump
	$(INSTALL_PROGRAM) -D -m755 pico/pico debian/tmp/usr/bin/pico
	$(INSTALL_PROGRAM) -D -m755 pico/pilot debian/tmp/usr/bin/pilot
	$(INSTALL_PROGRAM) -D -m755 imap/mailutil/mailutil debian/tmp/usr/bin/mailutil

	install -D -m644 doc/alpine.1 debian/tmp/usr/share/man/man1/alpine.1
	install -D -m644 doc/rpload.1 debian/tmp/usr/share/man/man1/rpload.1
	install -D -m644 doc/rpdump.1 debian/tmp/usr/share/man/man1/rpdump.1
	install -D -m644 doc/pico.1 debian/tmp/usr/share/man/man1/pico.1
	install -D -m644 doc/pilot.1 debian/tmp/usr/share/man/man1/pilot.1
	install -D -m644 imap/src/mailutil/mailutil.1 debian/tmp/usr/share/man/man1/mailutil.1
	install -D -m644 doc/tech-notes.txt debian/tmp/usr/share/doc/alpine/tech-notes.txt
	install -D -m644 LICENSE debian/tmp/usr/share/doc/alpine/license
	install -D -m644 README debian/tmp/usr/share/doc/alpine/README
	install -D -m644 debian/changelog debian/tmp/usr/share/doc/alpine/changelog

	gzip -r9 debian/tmp/usr/share/man
	gzip -9 debian/tmp/usr/share/doc/alpine/changelog
	dpkg-shlibdeps alpine/alpine pico/pico pico/pilot imap/mlock/mlock alpine/rpload alpine/rpdump
	cd debian/tmp && md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
	dpkg-gencontrol -isp -palpine
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	chown root.mail debian/tmp/usr/sbin/mlock
	chmod 2755 debian/tmp/usr/sbin/mlock
	dpkg --build debian/tmp ..

define checkdir
	test -f alpine/alpine.c -a -f debian/rules
endef

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot