File: rules

package info (click to toggle)
tcp-wrappers 7.6.q-28
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,760 kB
  • sloc: ansic: 17,677; makefile: 1,868; sh: 53
file content (79 lines) | stat: -rwxr-xr-x 1,888 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
#!/usr/bin/make -f
SHELL+= -e

D := $(CURDIR)/debian/tcpd
W := $(CURDIR)/debian/libwrap0
WD := $(CURDIR)/debian/libwrap0-dev

DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow

CFLAGS=-g -O2
-include /usr/share/dpkg/buildflags.mk

# for dpkg-cross
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  CROSS := CC=$(DEB_HOST_GNU_TYPE)-gcc
endif

DEB_BUILD_ARCH ?= $(shell dpkg --print-architecture)
ifeq ($(filter-out hurd-%,$(DEB_BUILD_ARCH)),)
  build_target := gnu
else
  build_target := linux
endif


clean:
	dh_testdir
	rm -rf debian/.stamp-* shared/
	$(MAKE) clean
	dh_clean

build: build-arch build-indep
build-arch: debian/.stamp-build
build-indep: debian/.stamp-build
debian/.stamp-build:
	dh_testdir
	$(MAKE) $(CROSS) COPTS="$(CFLAGS) $(CPPFLAGS)" LDOPTS="$(LDFLAGS)" $(build_target)
	touch $@

binary-arch: debian/.stamp-build
	dh_testdir
	dh_prep

	dh_installdirs
	dh_install

	dh_installdocs --link-doc=libwrap0
	dh_installdocs -p libwrap0 README
	dh_installchangelogs CHANGES
	dh_installman -p tcpd *.8
	dh_installman -p libwrap0 *.5
	dh_installman -p libwrap0-dev *.3
	dh_link

	mkdir -p $W/lib/$(DEB_HOST_MULTIARCH)/ $(WD)/usr/lib/$(DEB_HOST_MULTIARCH)/
	cp shared/libwrap.so.0.7.6 $W/lib/$(DEB_HOST_MULTIARCH)/
	ln -s libwrap.so.0.7.6 $W/lib/$(DEB_HOST_MULTIARCH)/libwrap.so.0
	ln -s /lib/$(DEB_HOST_MULTIARCH)/libwrap.so.0 \
		$(WD)/usr/lib/$(DEB_HOST_MULTIARCH)/libwrap.so
	mv $(WD)/usr/lib/libwrap.a $(WD)/usr/lib/$(DEB_HOST_MULTIARCH)/

	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdebconf
	dh_makeshlibs -- -c4
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch

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