File: rules

package info (click to toggle)
netcat-openbsd 1.130-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 760 kB
  • ctags: 989
  • sloc: ansic: 13,362; sh: 429; makefile: 54
file content (28 lines) | stat: -rwxr-xr-x 827 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
#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk

DEB_CFLAGS = $(CPPFLAGS) $(CFLAGS)
DEB_LDFLAGS = $(LDFLAGS) -Wl,--no-add-needed,--as-needed
DEB_VER = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')

DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	CROSS :=
else
	CROSS := \
		CC=$(DEB_HOST_GNU_TYPE)-gcc \
		PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
endif

%:
	dh $@
override_dh_auto_build:
	$(MAKE) CFLAGS='$(DEB_CFLAGS) -DDEBIAN_VERSION=\"$(DEB_VER)\"' LDFLAGS="$(DEB_LDFLAGS)" $(CROSS)
override_dh_auto_install:
	mv nc nc.openbsd
	mv nc.1 nc_openbsd.1
	dh_auto_install