File: rules

package info (click to toggle)
ipsvd 1.0.0-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,484 kB
  • sloc: ansic: 5,788; makefile: 502; sh: 329
file content (72 lines) | stat: -rwxr-xr-x 2,049 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
#!/usr/bin/make -f

include /usr/share/dpkg/buildflags.mk

STRIP =strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP =: nostrip
endif

CFLAGS +=-Wall
LDFLAGS +=
CC =gcc
ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
  CC =diet -v -Os gcc -nostdinc
endif

DIR =$(shell pwd)/debian/ipsvd

build: deb-checkdir build-stamp
build-stamp:
	-gcc -v
	test -e ipsvd || ln -s ipsvd-1.0.0 ipsvd
	test -r conf-cc'{orig}' || cp -f ipsvd/src/conf-cc conf-cc'{orig}'
	echo '$(CC) $(CPPFLAGS) $(CFLAGS)' >ipsvd/src/conf-cc
	test -r conf-ld'{orig}' || cp -f ipsvd/src/conf-ld conf-ld'{orig}'
	echo '$(CC) $(LDFLAGS)' >ipsvd/src/conf-ld
	(cd ipsvd/ && package/compile && package/check)
	touch build-stamp

build-arch build-indep: build

clean: deb-checkdir
	rm -rf ipsvd/compile ipsvd/command
	rm -f build-stamp
	rm -rf '$(DIR)'
	rm -f debian/files debian/substvars changelog
	test ! -r conf-cc'{orig}' || mv -f conf-cc'{orig}' ipsvd/src/conf-cc
	test ! -r conf-ld'{orig}' || mv -f conf-ld'{orig}' ipsvd/src/conf-ld
	rm -f ipsvd
	find . \( -name '*~' -o -name '*.orig' -o -name '*.rej' \) -delete

install: deb-checkdir build-stamp
	rm -rf '$(DIR)'
	# programs
	install -d -m0755 '$(DIR)'/usr/bin
	for i in tcpsvd udpsvd ipsvd-cdb; do \
	  install -m0755 ipsvd/command/$$i '$(DIR)'/usr/bin/ || exit 1; \
	done
	$(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
	# man pages
	for i in 5 7 8; do \
	  install -d -m0755 '$(DIR)'/usr/share/man/man$$i && \
	  for j in ipsvd/man/*.$$i; do \
	    install -m0644 $$j '$(DIR)'/usr/share/man/man$$i/ || exit 1; \
	  done || exit 1; \
	done
	rm -f '$(DIR)'/usr/share/man/man8/ssl*.8
	gzip -9n '$(DIR)'/usr/share/man/man?/*.?
	# changelog
	rm -f changelog && ln -s ipsvd/package/CHANGES changelog

binary-indep:

binary-arch: install ipsvd.deb
	test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/*
	dpkg-gencontrol -isp -pipsvd -P'$(DIR)'
	dpkg-deb --root-owner-group --build '$(DIR)' ..

binary: binary-indep binary-arch
.PHONY: build clean install binary-indep binary-arch binary

include debian/implicit