File: rules

package info (click to toggle)
daemontools 1%3A0.76-6.1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 984 kB
  • sloc: ansic: 3,750; makefile: 463; sh: 415
file content (115 lines) | stat: -rwxr-xr-x 3,933 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

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

DIR =$(shell pwd)/debian/daemontools

BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)

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-arch: build
build-indep: build
build: deb-checkdir build-stamp
build-stamp: patch-stamp
	cd daemontools-0.76 && package/compile
	touch build-stamp

clean: deb-checkdir deb-checkuid
	rm -rf daemontools-0.76/compile daemontools-0.76/command
	test ! -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
	rm -f patch-stamp build-stamp
	rm -rf '$(DIR)' '$(DIR)'-run
	rm -f debian/files debian/substvars changelog

install: install-arch install-indep
install-arch: deb-checkdir deb-checkuid build-stamp
	# daemontools
	rm -rf '$(DIR)'
	#  programs
	install -d -m0755 '$(DIR)'/usr/bin
	install -m0755 daemontools-0.76/command/* '$(DIR)'/usr/bin/
	for i in envdir envuidgid fghack multilog pgrphack readproctitle \
	 setlock setuidgid softlimit supervise svc svok svscan svstat tai64n \
	 tai64nlocal; do \
	  $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/$$i || exit 1; \
	done
	sed -e 's}/command/svc}svc};s}/service}/etc/service}g' \
	  <'$(DIR)'/usr/bin/svscanboot >'$(DIR)'/usr/bin/svscanboot'{new}'
	cat '$(DIR)'/usr/bin/svscanboot'{new}' >'$(DIR)'/usr/bin/svscanboot
	rm -f '$(DIR)'/usr/bin/svscanboot'{new}'
	#  manpages
	install -d -m0755 '$(DIR)'/usr/share/man/man8
	for i in debian/daemontools-man/*.8; do \
	  install -m0644 $$i '$(DIR)'/usr/share/man/man8/ && \
	  gzip -9n '$(DIR)'/usr/share/man/man8/$${i##*/} || exit 1; \
	done
	#  changelog
	test -r changelog || ln -s daemontools-0.76/src/CHANGES changelog
install-indep: deb-checkdir deb-checkuid
	# daemontools-run
	rm -rf '$(DIR)'-run
	install -d -m0755 '$(DIR)'-run/etc/service
	install -d -m0755 '$(DIR)'-run/var/lib/supervise
	#  update-service
	install -d -m0755 '$(DIR)'-run/usr/sbin
	install -m0755 debian/update-service \
	  '$(DIR)'-run/usr/sbin/update-service
	install -d -m0755 '$(DIR)'-run/usr/share/man/man8
	install -m0644 debian/update-service.8 '$(DIR)'-run/usr/share/man/man8/
	gzip -9n '$(DIR)'-run/usr/share/man/man8/update-service.8
	#  systemd service
	install -d -m0755 '$(DIR)'-run/lib/systemd/system
	install -m0644 debian/systemd/daemontools.service \
	  '$(DIR)'-run/lib/systemd/system/

	#  workaround #767933
	install -d -m0755 '$(DIR)'-run/usr/share/daemontools-run
	#  copy from sysvinit-2.88dsf/debian/rules and adjust
	if test -e debian/share/inittab.$(DEB_HOST_GNU_TYPE) ; \
	then \
		install -m0644 \
			debian/share/inittab.$(DEB_HOST_GNU_TYPE) \
			'$(DIR)'-run/usr/share/daemontools-run/inittab ; \
	elif test -e debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) ; \
	then \
		install -m0644 \
			debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) \
			'$(DIR)'-run/usr/share/daemontools-run/inittab ; \
	else \
		install -m0644 debian/share/inittab \
			'$(DIR)'-run/usr/share/daemontools-run/inittab ; \
	fi
	#  end copy from sysvinit-2.88dsf

	#  changelog
	test -r changelog || ln -s daemontools-0.76/src/CHANGES changelog

binary: binary-arch binary-indep
binary-arch: install-arch daemontools.deb
	dpkg-shlibdeps '$(DIR)'/usr/bin/*
	dpkg-gencontrol -isp -pdaemontools -P'$(DIR)'
	find '$(DIR)' -newermt '$(BUILD_DATE)' -print0 | \
		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	dpkg -b '$(DIR)' ..
binary-indep: install-indep daemontools-run.deb
	dpkg-gencontrol -isp -pdaemontools-run -P'$(DIR)'-run
	find '$(DIR)'-run -newermt '$(BUILD_DATE)' -print0 | \
		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	dpkg -b '$(DIR)'-run ..

binary: binary-indep binary-arch

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

include debian/implicit