File: rules

package info (click to toggle)
rbootd 3.0
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 216 kB
  • sloc: ansic: 1,654; sh: 119; makefile: 105
file content (107 lines) | stat: -rwxr-xr-x 3,242 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
#!/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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

package=rbootd

ARCH  := $(shell dpkg --print-architecture)

CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS += $(shell getconf LFS_CFLAGS)

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
	@if [ -f ${BASEDIR}/usr/share/doc/rbootd/changelog ]; then \
	  gzip -9vn ${BASEDIR}/usr/share/doc/rbootd/changelog ; \
	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