3 # debian/rules file for sysvinit
6 # Uncomment this to turn on verbose mode.
9 # This has to be exported to make some magic below work.
14 tmp = $(shell pwd)/debian/tmp
15 sysvtmp = $(shell pwd)/debian/sysvinit
16 utiltmp = $(shell pwd)/debian/sysvinit-utils
17 rctmp = $(shell pwd)/debian/sysv-rc
18 inittmp = $(shell pwd)/debian/initscripts
23 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
24 DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
25 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
26 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
28 INSTALL_DATA = install -o root -g root -m 644
29 INSTALL = install -o root -g root -m 755
32 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
33 CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
34 # CROSS is passed to make, CC is called directly.
35 CC=$(DEB_HOST_GNU_TYPE)-gcc
39 # Set arch specific build flags
40 ifeq ($(DEB_HOST_ARCH_OS),linux)
41 CONFFLAGS = WITH_SELINUX="yes"
45 PATCH_STAMP=debian/stamp-patched
48 dh_testdir debian/patches/series \
49 debian/startpar/patches/series
50 QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
51 cd debian/startpar && \
52 QUILT_PATCHES=patches quilt --quiltrc /dev/null push -a || test $$? = 2
56 QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null pop -a -R || test $$? = 2
57 cd debian/startpar && \
58 QUILT_PATCHES=patches quilt --quiltrc /dev/null pop -a -R || test $$? = 2
59 rm -rf .pc debian/startpar/.pc $(PATCH_STAMP)
63 # Builds the binary package.
65 $(MAKE) $(CROSS) $(CONFFLAGS) -C src DISTRO=Debian
66 $(MAKE) $(CROSS) -C debian/startpar
69 # Make a binary package (.deb file)
70 binary-arch: DH_OPTIONS=-a
75 $(MAKE) -C src $(CROSS) ROOT=$(tmp) DISTRO=Debian install
78 # Used by sysvinit and sysvinit-utils
79 cat debian/copyright.in COPYRIGHT > debian/copyright
83 if test -e debian/share/inittab.$(DEB_HOST_GNU_TYPE) ; \
86 debian/share/inittab.$(DEB_HOST_GNU_TYPE) \
87 $(sysvtmp)/usr/share/sysvinit/inittab ; \
88 elif test -e debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) ; \
91 debian/share/inittab.$(DEB_HOST_GNU_SYSTEM) \
92 $(sysvtmp)/usr/share/sysvinit/inittab ; \
94 $(INSTALL_DATA) debian/share/inittab \
95 $(sysvtmp)/usr/share/sysvinit/inittab ; \
97 $(INSTALL) debian/share/update-rc.d $(sysvtmp)/usr/share/sysvinit/
98 ifeq ($(DEB_HOST_ARCH), hurd-i386)
99 # The Hurd has its own halt and reboot commands.
100 rm -f $(sysvtmp)/usr/share/man/man8/halt.8
101 rm -f $(sysvtmp)/usr/share/man/man8/reboot.8
102 rm -f $(sysvtmp)/sbin/halt
103 rm -f $(sysvtmp)/sbin/reboot
105 dh_installchangelogs -psysvinit doc/Changelog
106 dh_installdeb -psysvinit
108 # sysvinit-utils package
110 $(MAKE) $(CROSS) -C debian/startpar DESTDIR=$(utiltmp) install
111 dh_installchangelogs -psysvinit-utils doc/Changelog
112 sed -i -ne '/sysvinit (2.86.ds1-47)/q' -e p \
113 $(inittmp)$(doc)/initscripts/changelog.Debian
115 # initscripts package
117 $(MAKE) -C debian/src/initscripts install DESTDIR=$(inittmp)
118 ifneq (,$(findstring $(DEB_HOST_ARCH_OS),linux kfreebsd))
119 $(INSTALL) -d $(inittmp)/sys
121 dh_installchangelogs -pinitscripts
122 sed -i -ne '/sysvinit (2.86.ds1-47)/q' -e p \
123 $(inittmp)$(doc)/initscripts/changelog.Debian
124 dh_installdeb -pinitscripts
125 # Override autogenerated conffiles
126 $(INSTALL_DATA) debian/initscripts.conffiles \
127 $(inittmp)/DEBIAN/conffiles
128 sh debian/deps-mount >> debian/initscripts.substvars
131 dh_fixperms -X/etc/init.d/skeleton
142 # Architecture independant files.
143 binary-indep: DH_OPTIONS=-i
150 $(MAKE) -C debian/src/sysv-rc install DESTDIR=$(rctmp)
152 sed -i -ne '/sysvinit (2.86.ds1-47)/q' -e p \
153 $(rctmp)$(doc)/sysv-rc/changelog.Debian
155 # Neither rc, rcS nor README are conffiles
156 $(RM) $(rctmp)/DEBIAN/conffiles
159 dh_fixperms -X/etc/init.d/README
171 $(MAKE) -C src clobber
172 $(MAKE) -C debian/startpar clean
173 $(MAKE) -f debian/rules unpatch
174 dh_clean build-stamp debian/copyright
176 binary: binary-arch binary-indep
178 .PHONY: binary binary-arch binary-indep clean