File: rules

package info (click to toggle)
userv 1.2.0
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 700 kB
  • ctags: 1,013
  • sloc: ansic: 4,220; lex: 287; sh: 207; makefile: 206
file content (84 lines) | stat: -rwxr-xr-x 2,318 bytes parent folder | download
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
#!/usr/bin/make -f

SHELL=/bin/bash
package=userv

t=debian/tmp

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTOPTS= LDFLAGS=-s INSTALL_PROGRAM='install -c -s'
else
	INSTOPTS= INSTALL_PROGRAM='install -c'
endif

makebuildargs := OPTIMISE= \
 XCFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
 XCPPFLAGS="$(shell dpkg-buildflags --get CPPFLAGS)" \
 XLDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"

build: build-arch build-indep

build-arch:
	$(checkdir)
	./configure --prefix=/usr
	$(MAKE) $(makebuildargs) all docs
	touch build-arch

clean:
	$(checkdir)
	rm -f build build-arch
	$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
	rm -rf *~ $t
	rm -rf spec.html spec.ps debian/substvars*
	dh_clean

build-indep:
binary-indep:

binary-arch:	checkroot build
	$(checkdir)
	-rm -rf $t
	install -d $t/{DEBIAN,etc/init.d} $t/usr/{sbin,bin}
	install -d $t/etc/userv/{override,default}.d
	install -d $t/usr/share/doc/$(package)/examples/
	install -d $t/usr/share/lintian/overrides/
	install -m 755 debian/{postinst,prerm,postrm} $t/DEBIAN/.
	install -m 644 debian/conffiles $t/DEBIAN/.
	install -m 755 debian/initd $t/etc/init.d/userv
	$(MAKE) $(INSTOPTS) $(makebuildargs) \
		prefix=$t/usr etcdir=$t/etc \
		docdir=$t/usr/share/doc/userv \
		mandir=$t/usr/share/man \
		install install-doc
	cp debian/copyright $t/usr/share/doc/$(package)/.
	cp debian/changelog $t/usr/share/doc/$(package)/changelog
	cp README $t/usr/share/doc/$(package)/README.upstream
	cp system.default system.override $t/usr/share/doc/$(package)/examples
	ln -s changelog.gz $t/usr/share/doc/$(package)/changelog.Debian.gz
	gzip -9v $t/usr/share/doc/$(package)/changelog \
		$t/usr/share/man/man1/*.1 $t/usr/share/man/man8/*.8 \
		$t/usr/share/doc/userv/*.ps
	cp debian/lintian $t/usr/share/lintian/overrides/userv
	dpkg-shlibdeps daemon client
	dpkg-gencontrol -isp
	dh_fixperms -Pdebian/tmp
	chown root.root debian/tmp/usr/bin/userv
	chmod 4755 debian/tmp/usr/bin/userv
	dpkg --build $t ..

define checkdir
	test -f overlord.c -a -f lexer.l.m4 -a -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