summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 41ef77cd9149a54daf1d0fc0933928cbf9203f25 (plain)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/default.mk
export CFLAGS  += $(shell getconf LFS_CFLAGS)
export LDFLAGS += $(shell getconf LFS_LDFLAGS)

PREFIX_IPV4 = $(CURDIR)/debian/ucspi-tcp/usr
PREFIX_IPV6 = $(CURDIR)/debian/ucspi-tcp-ipv6/usr

%:
	dh $@

override_dh_auto_configure:
	echo $(PREFIX_IPV4) > conf-home
	mkdir ipv6
	xargs install -t ipv6 < FILES
	cd ipv6 && patch -p1 < ../debian/ipv6-support.patch
	echo $(PREFIX_IPV6) > ipv6/conf-home
	echo '$(CC) $(CFLAGS) $(CPPFLAGS)' | tee ipv6/conf-cc conf-cc
	echo '$(CC) $(LDFLAGS)' | tee ipv6/conf-ld conf-ld

override_dh_auto_build:
	$(MAKE)
	$(MAKE) -C ipv6

override_dh_auto_install:
	mkdir -p $(PREFIX_IPV4) $(PREFIX_IPV6)
	./install
	./instcheck
	cd ipv6 && ./install && ./instcheck
	# ./install incorrectly install manpages under /usr/man, not
	# /usr/share/man.
	rm -r $(PREFIX_IPV6)/man

# Upstream does strange thing -- its test suite assumes that programs
# are already installed. Normally, checks are performed between `build'
# and `install'.
#
# So automatic invocation of tests is inhibited, and they are invoked
# manuall at `install' stage.
override_dh_auto_test: