summary refs log tree commit diff
path: root/debian/rules
blob: e0c68d22d605b8fd8d983aea9466b8b25d8ec95c (plain) (blame)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

export DH_COMPAT=3

configure: configure-stamp
configure-stamp:
	dh_testdir

	touch configure-stamp

build-arch: configure-stamp  build-arch-stamp
build-arch-stamp:
	dh_testdir

	tar xfzvp runit-0.9.1.tar.gz
	( \
	set -e; \
	cd admin/runit-0.9.1/src; \
	ln -s runit-0.9.1 runit; mv runit ../..; \
	echo 'diet -v -Os gcc -O2 -Wall' >conf-cc; \
	echo 'diet -v -Os gcc -s -Os -pipe' >conf-ld; \
	$(MAKE); \
	$(MAKE) runsvstat runsvctrl; \
	)

	touch build-arch-stamp

build-indep:  configure-stamp build-indep-stamp
build-indep-stamp:
	dh_testdir

	touch build-indep-stamp

build: build-arch build-indep

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp configure-stamp

	rm -rf admin
	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# runit
	install -m0500 admin/runit-0.9.1/src/runit \
	  $(CURDIR)/debian/runit/sbin/runit
	install -m0500 admin/runit-0.9.1/src/runit-init \
	  $(CURDIR)/debian/runit/sbin/runit-init
	install -m0755 admin/runit-0.9.1/src/runsvdir \
	  $(CURDIR)/debian/runit/usr/bin/runsvdir
	install -m0755 admin/runit-0.9.1/src/runsv \
	  $(CURDIR)/debian/runit/usr/bin/runsv
	install -m0755 admin/runit-0.9.1/src/runsvchdir \
	  $(CURDIR)/debian/runit/usr/sbin/runsvchdir
	install -m0755 admin/runit-0.9.1/src/svlogd \
	  $(CURDIR)/debian/runit/usr/bin/svlogd
	install -m0755 admin/runit-0.9.1/src/svwaitdown \
	  $(CURDIR)/debian/runit/usr/bin/svwaitdown
	install -m0755 admin/runit-0.9.1/src/svwaitup \
	  $(CURDIR)/debian/runit/usr/bin/svwaitup
	install -m0755 admin/runit-0.9.1/src/utmpset \
	  $(CURDIR)/debian/runit/usr/sbin/utmpset

	install -m0755 admin/runit-0.9.1/src/runsvstat \
	  $(CURDIR)/debian/runit/usr/bin/runsvstat
	install -m0755 admin/runit-0.9.1/src/runsvctrl \
	  $(CURDIR)/debian/runit/usr/bin/runsvctrl

	install -m0755 debian/getty-tty5.run \
	  $(CURDIR)/debian/runit/etc/runit/getty-5/run
	install -m0755 debian/getty-tty5.finish \
	  $(CURDIR)/debian/runit/etc/runit/getty-5/finish

	# lintian overrides
	install -m0755 -d $(CURDIR)/debian/runit/usr/share/lintian/overrides
	install -m0644 debian/runit.lintian \
	  $(CURDIR)/debian/runit/usr/share/lintian/overrides/runit

	# docs
	install -m0755 -d $(CURDIR)/debian/runit/usr/share/doc/runit
	for i in README THANKS; do \
	  install -m0644 admin/runit/package/$$i \
	    $(CURDIR)/debian/runit/usr/share/doc/runit/; \
	done
	for i in README.Debian copyright; do \
	  install -m0644 debian/$$i \
	    $(CURDIR)/debian/runit/usr/share/doc/runit/; \
	done
	install -m0755 -d $(CURDIR)/debian/runit/usr/share/doc/runit/doc
	for i in admin/runit/doc/*.html; do \
	  install -m0644 $$i $(CURDIR)/debian/runit/usr/share/doc/runit/doc/; \
	done
	install -m0755 -d $(CURDIR)/debian/runit/usr/share/doc/runit/doc/debian
	for i in 1 2 3 ctrlaltdel; do \
	  install -m0644 admin/runit/etc/debian/$$i \
	    $(CURDIR)/debian/runit/usr/share/doc/runit/doc/debian/; \
	done

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
#	dh_installdebconf -a
#	dh_installdocs -an
#	dh_installexamples -a
	dh_installman -a admin/runit/man/*.8
	dh_installchangelogs -a admin/runit-0.9.1/package/CHANGES
	dh_strip -a
#	dh_link -a
	dh_compress -a
	dh_fixperms -a -X/sbin
#	dh_makeshlibs -a
	dh_installdeb -a
#	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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