Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 #export DH_VERBOSE=1
3
4 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
5 include /usr/share/dpkg/architecture.mk
6 include /usr/share/dpkg/buildtools.mk
7
8 LIB_VERSION = 45
9
10 MIB_MODULES = smux ucd-snmp/dlmod mibII/mta_sendmail disman/event-mib
11 EXCL_MIB_MODULES =
12
13 MIBS_DIR="/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf"
14
15 ifeq (linux,$(DEB_HOST_ARCH_OS))
16 MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmsensorsMib etherlike-mib/dot3StatsTable
17 DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors4-dev"
18 else
19 ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
20 DEB_DH_GENCONTROL_ARGS=-- -Vos-specific-dev="libkvm-dev"
21 CFLAGS += $(shell $(PKG_CONFIG) --cflags libbsd-overlay)
22 LDFLAGS += $(shell $(PKG_CONFIG) --libs libbsd-overlay)
23 endif
24 endif
25 ifeq (hurd,$(DEB_HOST_ARCH_OS))
26 EXCL_MIB_MODULES += mibII
27 else
28 MIB_MODULES += host
29 endif
30
31 ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
32 export PERL5LIB=/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(shell perl -MConfig -e 'print $$Config{version}')
33 endif
34
35 %:
36 dh $@
37
38 # The net-snmp Makefiles cannot handle parallel builds
39 override_dh_auto_build:
40 dh_auto_build --no-parallel
41
42 override_dh_auto_configure:
43 dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
44 --with-persistent-directory=/var/lib/snmp \
45 --enable-ucd-snmp-compatibility \
46 --with-cflags="$(CFLAGS) -DNETSNMP_USE_INLINE" \
47 --with-ldflags="$(LDFLAGS)" \
48 --with-perl-modules="INSTALLDIRS=vendor" --enable-as-needed \
49 --with-logfile=none \
50 --without-rpm --with-libwrap --with-openssl \
51 --without-dmalloc --without-efence --without-rsaref \
52 --with-sys-contact="root" --with-sys-location="Unknown" \
53 --with-mib-modules="$(MIB_MODULES)" \
54 --with-out-mib-modules="$(EXCL_MIB_MODULES)" \
55 --with-transports="TLSTCP DTLSUDP" \
56 --with-security-modules="tsm" \
57 --enable-mfd-rewrites \
58 --with-mnttab=/etc/mtab \
59 --with-mibdirs="\$$HOME/.snmp/mibs:$(MIBS_DIR)" \
60 --with-mysql \
61 --with-systemd \
62 --enable-blumenthal-aes \
63 UNAMEPROG=/bin/uname \
64 PSPROG=/bin/ps \
65 --with-defaults
66 # --with-dnssec-local-validation # not enabled since libval doesn't exist in Debian yet
67
68 override_dh_clean:
69 dh_clean
70 rm -rf `find . -name .libs` \
71 dist/generation-scripts/gen-variables \
72 perl/SNMP/t/snmptest.cmd \
73 perl/TrapReceiver/const-c.inc \
74 perl/TrapReceiver/const-xs.inc
75
76 override_dh_makeshlibs:
77 dh_makeshlibs -plibsnmp$(LIB_VERSION) -VUpstream-Version
78 dh_makeshlibs -plibnetsnmptrapd$(LIB_VERSION) -VUpstream-Version
79
80 override_dh_install-arch:
81 dh_install
82
83 override_dh_installdocs:
84 dh_installdocs -plibsnmp-perl -ptkmib -plibsnmp-base -plibsnmp$(LIB_VERSION)
85 dh_installdocs --link-doc=libsnmp$(LIB_VERSION) \
86 -plibsnmp-dev \
87 -plibnetsnmptrapd$(LIB_VERSION) \
88 -psnmpd \
89 -psnmptrapd \
90 -psnmp
91
92 override_dh_fixperms-arch:
93 dh_fixperms
94 chmod -x debian/libsnmp-dev/etc/snmp/*.conf
95 chmod 640 debian/snmpd/etc/snmp/snmp*d.conf
96
97 override_dh_auto_test:
98 # prevent test since it fails with network configuration under pbuilder/etc.
99 true
100
101 override_dh_installinit:
102 dh_installinit -psnmptrapd --no-enable --no-start
103 dh_installinit -Nsnmptrapd