summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 032a03a015f9a540cec1c9a7bebee44d567b4693 (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
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

SHELL := sh -e

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_build:
	dh_auto_build -- CROSS=$(DEB_HOST_GNU_TYPE)-

override_dh_auto_install:
	install -D -m 0755 traceroute/traceroute debian/traceroute/usr/bin/traceroute.db
	install -D -m 0644 traceroute/traceroute.8 debian/traceroute/usr/share/man/man1/traceroute.db.1

	install -D -m 0755 wrappers/traceroute-nanog debian/traceroute/usr/bin/traceroute-nanog
	ln -s traceroute.db.1.gz debian/traceroute/usr/share/man/man1/traceroute-nanog.1.gz

	install -D -m 0644 libsupp/libsupp.a debian/traceroute/usr/lib/libsupp.a
	install -D -m 0644 libsupp/clif.h debian/traceroute/usr/include/clif.h

	# Installing symlinks
	mkdir -p debian/traceroute/usr/share/man/man1

	for _ALTERNATIVE in traceroute6; \
	do \
		ln -s traceroute.db debian/traceroute/usr/bin/$${_ALTERNATIVE}.db; \
		ln -s traceroute.db.1.gz debian/traceroute/usr/share/man/man1/$${_ALTERNATIVE}.db.1.gz; \
	done

	# Installing wrappers
	for _WRAPPER in lft traceproto; \
	do \
		install -D -m 0755 wrappers/$${_WRAPPER} debian/traceroute/usr/bin/$${_WRAPPER}.db; \
		ln -s traceroute.db.1.gz debian/traceroute/usr/share/man/man1/$${_WRAPPER}.db.1.gz; \
	done

	mkdir -p debian/traceroute/usr/share/man/man8

	for _WRAPPER in tcptraceroute; \
	do \
		install -D -m 0755 wrappers/$${_WRAPPER} debian/traceroute/usr/sbin/$${_WRAPPER}.db; \
		ln -s ../man1/traceroute.db.1.gz debian/traceroute/usr/share/man/man8/$${_WRAPPER}.db.8.gz; \
	done

%:
	dh ${@}

.PHONY: override_dh_auto_build override_dh_auto_install