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
|
#! /usr/bin/make -f
#
# debian/rules file for sysvinit
#
# Name.
package = sysvinit
tmp = $(shell pwd)/debian/tmp
doc = /usr/share/doc/$(package)
SHELL = /bin/bash
LC_ALL = POSIX
define checkdir
test -f src/init.c
endef
build:
# Builds the binary package.
$(checkdir)
(cd src; make DEBIAN=cool)
touch build
# Architecture independant files.
binary-indep: build
$(checkdir)
# Make a binary package (.deb file)
binary-arch: build checkroot
-rm -rf $(tmp)
install -d -g root -m 755 -o root $(tmp)
install -d -g root -m 755 -o root $(tmp)/{DEBIAN,etc,usr}
install -d -g root -m 755 -o root $(tmp)/usr/share
install -d -g root -m 755 -o root $(tmp)/usr/include
install -d -g root -m 755 -o root $(tmp)$(doc)
install -g root -m 644 doc/Changelog $(tmp)$(doc)/changelog
install -g root -m 644 debian/changelog $(tmp)$(doc)/changelog.Debian
install -g root -m 644 debian/README.runlevels $(tmp)$(doc)
gzip -9f $(tmp)$(doc)/{changelog,changelog.Debian,README.runlevels}
install -d -g root -m 755 -o root $(tmp)$(doc)/examples
cp -af debian/examples/* $(tmp)$(doc)/examples
cp -af debian/etc/* $(tmp)/etc
chmod 755 $(tmp)/etc/init.d/[a-z]*
mv $(tmp)/etc/inittab* $(tmp)$(doc)/examples
chmod -R g-w $(tmp)
chown -R root.root $(tmp)
install -d -g root -m 755 -o root $(tmp)/etc/rc{S,0,1,2,3,4,5,6}.d
install -d -g root -m 755 -o root $(tmp)/etc/rc.boot
install -d -g root -m 755 -o root $(tmp)/etc/default
install -d -g root -m 755 -o root $(tmp)/bin
install -d -g root -m 755 -o root $(tmp)/sbin
install -d -g root -m 755 -o root $(tmp)/usr/bin
install -d -g root -m 755 -o root $(tmp)/usr/sbin
install -d -g root -m 755 -o root $(tmp)/usr/share/man
install -d -g root -m 755 -o root $(tmp)/usr/share/man/man{1,5,8}
install -d -g root -m 755 -o root $(tmp)/usr/share/man/ja/man8
install -d -g root -m 755 -o root $(tmp)/usr/share/man/fr/man8
install -d -g root -m 755 -o root $(tmp)/var/lib/urandom
install -g root -m 755 debian/fsck.nfs $(tmp)/sbin/fsck.nfs
(cd src; make ROOT=$(tmp) DEBIAN=cool install )
install -g root -m 644 debian/rc.boot.5 $(tmp)/usr/share/man/man5
install -g root -m 644 debian/rcS.5 $(tmp)/usr/share/man/man5
install -g root -m 644 debian/extra/*.8 \
$(tmp)/usr/share/man/man8
install -g root -m 644 debian/extra/ja/*.8 \
$(tmp)/usr/share/man/ja/man8
install -g root -m 644 debian/extra/fr/*.8 \
$(tmp)/usr/share/man/fr/man8
install -g root -m 755 debian/extra/invoke-rc.d $(tmp)/usr/sbin
install -g root -m 755 debian/extra/update-rc.d $(tmp)/usr/sbin
gzip -9f $(tmp)/usr/share/man/man*/*.[0-9] \
$(tmp)/usr/share/man/??/man*/*.[0-9]
install -g root -m 644 -o root debian/README \
$(tmp)$(doc)/copyright
cat COPYRIGHT >> $(tmp)$(doc)/copyright
install -g root -m 755 debian/preinst $(tmp)/DEBIAN/preinst
install -g root -m 755 debian/prerm $(tmp)/DEBIAN/prerm
install -g root -m 755 debian/postinst $(tmp)/DEBIAN/postinst
install -g root -m 644 -o root debian/conffiles \
$(tmp)/DEBIAN/conffiles
dpkg-shlibdeps src/init
dpkg-gencontrol
dpkg --build $(tmp) ..
rm -rf $(tmp)
clean: checkroot
(cd src; make clobber )
rm -f build debian/files debian/substvars
rm -rf $(tmp)
find . -name '*.bak' -o -name '*~' | xargs -r rm -f --
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|