File: rules

package info (click to toggle)
netcat-openbsd 1.217-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,336 kB
  • sloc: ansic: 29,578; sh: 431; makefile: 71
file content (28 lines) | stat: -rwxr-xr-x 802 bytes parent folder | download | duplicates (2)
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
-include /usr/share/dpkg/pkg-info.mk

DEB_CFLAGS = $(CPPFLAGS) $(CFLAGS)
DEB_LDFLAGS = $(LDFLAGS) -Wl,--no-add-needed,--as-needed

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_VERSION)\"' LDFLAGS="$(DEB_LDFLAGS)" $(CROSS)
override_dh_auto_install:
	mv nc nc.openbsd
	mv nc.1 nc_openbsd.1
	dh_auto_install