File: rules

package info (click to toggle)
dot-forward 1%3A0.71-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 484 kB
  • ctags: 344
  • sloc: ansic: 2,840; makefile: 367; sh: 131
file content (72 lines) | stat: -rwxr-xr-x 2,193 bytes parent folder | download
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
#!/usr/bin/make -f

STRIP =strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

DIR=$(shell pwd)/debian/dot-forward

patch: deb-checkdir patch-stamp
patch-stamp:
	for i in `ls -1 debian/diff/*.diff || :`; do \
	  patch -p1 <$$i || exit 1; \
	done
	touch patch-stamp

build: deb-checkdir build-stamp
build-stamp: patch-stamp
	test -r conf-qmail'{orig}' || cp conf-qmail conf-qmail'{orig}'
	echo /var/lib/qmail >conf-qmail
	$(MAKE)
	touch build-stamp

clean: deb-checkdir deb-checkuid
	rm -f `cat TARGETS`
	test ! -r conf-qmail'{orig}' || mv -f conf-qmail'{orig}' conf-qmail
	test ! -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
	rm -f build-stamp patch-stamp
	rm -rf '$(DIR)'
	rm -f debian/files debian/substvars changelog

install: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	install -d -m0755 '$(DIR)'/var/lib/qmail/bin
	chown 0:64010 '$(DIR)'/var/lib/qmail '$(DIR)'/var/lib/qmail/bin
	test -r conf-qmail'{orig}' || cp conf-qmail conf-qmail'{orig}'
	echo '$(DIR)'/var/lib/qmail >conf-qmail
	rm -f auto_qmail.[co] install.o instcheck.o
	$(MAKE) install instcheck
	./install
	./instcheck
	$(STRIP) -R .comment -R .note '$(DIR)'/var/lib/qmail/bin/*
	install -d -m0755 '$(DIR)'/usr/bin
	# move and link binaries
	for i in bin sbin; do \
	  for j in `cat debian/$$i`; do \
	    mv -f '$(DIR)'/var/lib/qmail/bin/$$j '$(DIR)'/usr/$$i/$$j && \
	    ln -s /usr/$$i/$$j '$(DIR)'/var/lib/qmail/bin/$$j || exit 1; \
	  done; \
	done;
	# docs are in /usr/share/doc/dot-forward (implicit)
	rm -rf '$(DIR)'/var/lib/qmail/doc
	# man pages system-wide
	rm -rf '$(DIR)'/var/lib/qmail/man
	install -d -m0755 '$(DIR)'/usr/share/man/man1
	install -m0644 dot-forward.1 \
	  '$(DIR)'/usr/share/man/man1/dot-forward.1qmail
	gzip -9 '$(DIR)'/usr/share/man/man1/*.1qmail
	# changelog
	rm -f changelog && ln -s CHANGES changelog

binary: binary-indep binary-arch
binary-arch: install dot-forward.deb
	dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
	dpkg-gencontrol -isp -pdot-forward -P'$(DIR)'
	dpkg -b '$(DIR)' ..
binary-indep:

.PHONY: patch build clean install binary-indep binary-arch binary

include debian/implicit