| #!/usr/bin/make -f |
| # Sample debian.rules file - for GNU Hello (1.3). |
| # Copyright 1994,1995 by Ian Jackson. |
| |
| # Modified to be rules for rbootd by Alan Bain 1998 |
| |
| # I hereby give you perpetual unlimited permission to copy, |
| # modify and relicense this file, provided that you do not remove |
| # my name from the file itself. (I assert my moral right of |
| # paternity under the Copyright, Designs and Patents Act 1988.) |
| # This file may have to be extensively modified |
| |
| package=rbootd |
| |
| ARCH := $(shell dpkg --print-architecture) |
| |
| ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| CFLAGS = -g -O2 -Wall $(shell getconf LFS_CFLAGS) |
| else |
| CFLAGS = -O2 -Wall $(shell getconf LFS_CFLAGS) |
| endif |
| ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| STRIP = -s |
| endif |
| |
| export BASEDIR=$(shell pwd)/debian/tmp |
| |
| ## Note must use the special makefile to avoid needing BSD make |
| |
| build-arch: build |
| build-indep: build |
| |
| build: |
| $(checkdir) |
| $(MAKE) CFLAGS="$(CFLAGS)" rbootd |
| touch build |
| |
| clean: |
| $(checkdir) |
| $(MAKE) clean |
| -rm -f build |
| -rm -rf debian/tmp debian/files* core debian/substvars |
| |
| binary-indep: checkroot build |
| $(checkdir) |
| # There are no architecture-independent files to be uploaded |
| # generated by this package. If there were any they would be |
| # made here. |
| |
| # Install and strip rather than strip binary left here |
| |
| binary-arch: checkroot build |
| $(checkdir) |
| rm -rf debian/tmp |
| install -d debian/tmp |
| cd debian/tmp;install -d `cat ../dirs` |
| install -d ${BASEDIR}/DEBIAN |
| install -o root -g root -m 0755 $(STRIP) rbootd ${BASEDIR}/usr/sbin |
| install -o root -g root -m 0644 debian/default ${BASEDIR}/etc/default/rbootd |
| install -o root -g root -m 0755 debian/rbootd.init.d ${BASEDIR}/etc/init.d/rbootd |
| install -o root -g root -m 0644 etc-rbootd/rbootd.conf ${BASEDIR}/etc |
| install -o root -g root -m 0644 rbootd.service ${BASEDIR}/lib/systemd/system |
| install -o root -g root -m 0644 rbootd.8 ${BASEDIR}/usr/share/man/man8 |
| @if [ -f ${BASEDIR}/usr/share/man/man8/rbootd.8 ]; then \ |
| gzip -9vn ${BASEDIR}/usr/share/man/man8/rbootd.8 ; \ |
| fi |
| |
| install -o root -g root -m 0644 README \ |
| ${BASEDIR}/usr/share/doc/rbootd/README |
| @if [ -f ${BASEDIR}/usr/share/doc/rbootd/README ]; then \ |
| gzip -9vn ${BASEDIR}/usr/share/doc/rbootd/README ;\ |
| fi |
| install -o root -g root -m 0644 debian/copyright \ |
| ${BASEDIR}/usr/share/doc/rbootd/copyright |
| install -o root -g root -m 0644 debian/changelog \ |
| ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian |
| |
| @if [ -f ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian ]; then \ |
| gzip -9vn ${BASEDIR}/usr/share/doc/rbootd/changelog.Debian ; \ |
| fi |
| install -o root -g root -m 0644 debian/conffiles \ |
| ${BASEDIR}/DEBIAN |
| install -o root -g root -m 0755 debian/postinst debian/prerm debian/postrm \ |
| ${BASEDIR}/DEBIAN |
| install -d ${BASEDIR}/var/lib/rbootd |
| dpkg-shlibdeps ${BASEDIR}/usr/sbin/rbootd |
| dpkg-gencontrol |
| chown -R root.root debian/tmp |
| chmod -R go-ws debian/tmp |
| dpkg --build debian/tmp .. |
| |
| define checkdir |
| test -f debian/rules |
| endef |
| |
| # Below here is fairly generic really |
| |
| binary: binary-indep binary-arch |
| |
| source diff: |
| @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false |
| |
| checkroot: |
| $(checkdir) |
| test root = "`whoami`" |
| |
| .PHONY: binary binary-arch binary-indep clean checkroot |