File: rules

package info (click to toggle)
net-snmp 5.2.3-7etch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 24,452 kB
  • ctags: 16,045
  • sloc: ansic: 175,930; perl: 11,814; sh: 11,230; makefile: 5,375; pascal: 62
file content (226 lines) | stat: -rwxr-xr-x 6,832 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
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=4

include debian/cbs-patches.Makefile

v = 9
vv = 5.2.3

tmp=$(shell pwd)/debian/tmp

ifndef PERL
PERL=/usr/bin/perl
endif

DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

CFLAGS = -O2 -D_REENTRANT -DNETSNMP_USE_INLINE -Wall
ifneq "$(findstring debug,$(DEB_BUILD_OPTIONS))" ""
CFLAGS += -g
endif

BACKUP = aclocal.m4 config.guess config.sub configure ltmain.sh stamp-h \
         stamp-h.in include/net-snmp/net-snmp-config.h.in

MIB_MODULES = host smux ucd-snmp/dlmod disman/event-mib

ifeq (linux,$(DEB_HOST_ARCH_OS))
MIB_MODULES += ucd-snmp/diskio ucd-snmp/lmSensors
IPV6 = --enable-ipv6
LIBSENSORS = -lsensors
GENCONTROL_ARGS=-- -Vos-specific-dev="libsensors-dev (>= 2.8.5)"
else
ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
IPV6 = --disable-ipv6
GENCONTROL_ARGS=-- -Vos-specific-dev="libkvm-dev"
endif
endif

build:  build-stamp
build-stamp: debian/stamp-patched
	dh_testdir

	# Backup files expected to be modified.
	for i in $(BACKUP); do \
		if [ ! -f $$i.backup ]; then cp $$i $$i.backup; fi ; \
	done
	# Add here commands to compile the package.
	libtoolize --force --copy
	aclocal -I m4
	autoconf
	LC_COLLATE=C autoheader
	echo timestamp >stamp-h.in
	./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
	  --with-persistent-directory=/var/lib/snmp \
	  --enable-ucd-snmp-compatibility \
	  --enable-shared --with-cflags="$(CFLAGS)" \
	  --with-perl-modules="INSTALLDIRS=vendor" \
	  $(IPV6) --with-logfile=none \
	  --without-rpm --with-libwrap --with-openssl \
	  --without-dmalloc --without-efence --without-rsaref \
	  --with-sys-contact="root" --with-sys-location="Unknown" \
	  --with-mib-modules="$(MIB_MODULES)" \
	  --enable-mfd-rewrites \
	  --with-mnttab=/etc/mtab \
	  --with-defaults
	$(MAKE) LIBSENSORS=$(LIBSENSORS) LD_RUN_PATH=
	touch build-stamp

clean: real-clean patch-clean
real-clean:
	dh_testdir
	dh_testroot

	# Add here commands to clean up after the build process.
	-$(MAKE) perlrealclean distclean

	dh_clean EXAMPLE.conf net-snmp-config sedscript \
	  include/net-snmp/library/snmpv3-security-includes.h \
	  include/net-snmp/agent/mib_module_config.h \
	  include/net-snmp/agent/agent_module_config.h \
	  build-stamp install-stamp debian/patches/*.log \
	  acinclude.m4 agent/mibgroup/mib_module_includes.h \
	  agent/mibgroup/agent_module_includes.h \
	  agent/mibgroup/mib_module_inits.h \
	  agent/mibgroup/agent_module_inits.h \
	  agent/mibgroup/mib_module_shutdown.h \
	  agent/mibgroup/agent_module_shutdown.h \
	  agent/mibgroup/mib_module_dot_conf.h \
	  agent/mibgroup/agent_module_dot_conf.h libtool \
	  snmplib/snmpsm_init.h config.log configure-summary \
	  perl/SNMP/t/snmptest.cmd perl/blib/lib/.exists \
	  perl/blib/lib/NetSNMP/.exists perl/blib/lib/NetSNMP/agent/.exists \
	  perl/SNMP/SNMP.pod $(shell find -type f -name '*.o')
	rm -rf `find . -name .libs`
	rm -rf `find . -name .svn`

	for i in $(BACKUP); do \
		if [ -f $$i.backup ]; then mv -f $$i.backup $$i; fi ; \
	done

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp.
	$(MAKE) prefix=`pwd`/debian/tmp/usr exec_prefix=`pwd`/debian/tmp/usr \
	  mandir=`pwd`/debian/tmp/usr/share/man \
	  persistentdir=`pwd`/debian/tmp/var/lib/snmp \
	  PREFIX=`pwd`/debian/tmp/usr install
	# Install the "broke" headers
	cp agent/mibgroup/struct.h debian/tmp/usr/include/net-snmp/agent
	cp agent/mibgroup/util_funcs.h debian/tmp/usr/include/net-snmp
	cp agent/mibgroup/mibincl.h debian/tmp/usr/include/net-snmp/library
	cp agent/mibgroup/header_complex.h debian/tmp/usr/include/net-snmp/agent
	# Remove the snmpcheck program since we don't support it (yet).
	rm debian/tmp/usr/bin/snmpcheck
	# Copy the .conf files.
	mkdir -p debian/tmp/etc/snmp
	cp EXAMPLE.conf debian/tmp/etc/snmp/snmpd.conf
	cp EXAMPLE-trap.conf debian/tmp/etc/snmp/snmptrapd.conf
	mv debian/tmp/usr/share/snmp/mib2c*.conf debian/tmp/etc/snmp
	mkdir -p debian/tmp/etc/default
	cp debian/snmpd.default debian/tmp/etc/default/snmpd
	# Perform other man pages fixups.
	bash ./debian/fixman
	## Copy the autoconf files.
	#mkdir -p debian/tmp/usr/share/aclocal
	#cp net-snmp.m4 debian/tmp/usr/share/aclocal

	# Fix all .la files
	(cd $(CURDIR)/debian/tmp/usr/lib; \
	for i in *.la ; do \
		sed -e "s#libdir=.*#libdir='/usr/lib'#" < $$i >$$i.new && \
			mv $$i.new $$i ; \
	done )

	# make lintian happy
	mkdir -p debian/tmp/usr/share/lintian/overrides
	cp debian/snmpd.lintian-overrides debian/tmp/usr/share/lintian/overrides/snmpd
	dh_movefiles

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	#dh_installmenu -i
	#dh_installemacsen -i
	#dh_installpam -i
	#dh_installinit -i
	#dh_installcron -i
	dh_installman -i
	#dh_installinfo -i
	dh_installchangelogs -i -k ChangeLog
	#dh_link -i
	dh_compress -i
	dh_fixperms -i
	# You may want to make some executables suid here.
	#dh_suidregister -i
	dh_installdeb -i
	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdebconf -a
	dh_installdocs -a
	for f in libsnmp$(v)-dev ; do \
	  rm -rf debian/$$f/usr/share/doc/$$f ; \
	  ln -sf libsnmp$(v) debian/$$f/usr/share/doc/$$f ; \
	done
	#dh_installexamples -a
	dh_installexamples -plibsnmp-perl $(shell ls -d perl/SNMP/examples/* | grep -v SCCS)
	#dh_installmenu -a
	#dh_installemacsen -a
	#dh_installpam -a
	dh_installinit -a
	#dh_installcron -a
	dh_installman -a
	#dh_installinfo -a
	#dh_installchangelogs -a
	dh_installchangelogs -plibsnmp$(v) -k ChangeLog
	dh_installchangelogs -plibsnmp-perl -k ChangeLog
	dh_installchangelogs -psnmp -k ChangeLog
	dh_installchangelogs -psnmpd -k ChangeLog
	dh_fixperms -a
	dh_strip -a
	#dh_link -a
	dh_compress -a
	chmod 600 debian/snmpd/etc/snmp/snmp*d.conf
	# You may want to make some executables suid here.
	#dh_suidregister -a
	dh_installdeb -a
	#dh_makeshlibs -a
	dh_makeshlibs -plibsnmp$(v) -V "libsnmp$(v) (>= $(vv))"
	dh_makeshlibs -plibsnmp-perl
	dh_perl -a
	dh_shlibdeps -a -ldebian/libsnmp$(v)/usr/lib -Llibsnmp$(v)
	dh_gencontrol -a $(GENCONTROL_ARGS)
	dh_md5sums -a
	dh_builddeb -a

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install