File: rules

package info (click to toggle)
ipsvd 1.0.0-3.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,236 kB
  • ctags: 874
  • sloc: ansic: 5,776; makefile: 507; sh: 326
file content (76 lines) | stat: -rwxr-xr-x 2,186 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
#!/usr/bin/make -f

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

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

DIR =$(shell pwd)/debian/ipsvd

patch: deb-checkdir patch-stamp
patch-stamp:
	for i in `ls -1 debian/diff/*.diff || :`; do \
	  patch -p1 <$$i || exit 1; \
	done
	touch patch-stamp

build: deb-checkdir build-stamp
build-stamp: patch-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) $(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

clean: deb-checkdir deb-checkuid
	rm -rf ipsvd/compile ipsvd/command
	test ! -e patch-stamp || \
	  for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
	rm -f patch-stamp 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

install: deb-checkdir deb-checkuid 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 -b '$(DIR)' ..

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

include debian/implicit