File: rules

package info (click to toggle)
nagios4 4.4.6-4.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,336 kB
  • sloc: ansic: 97,631; sh: 12,619; javascript: 5,483; perl: 2,624; makefile: 1,265; php: 381; ruby: 95
file content (132 lines) | stat: -rwxr-xr-x 4,410 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
#!/usr/bin/make -f

b := $(shell pwd)/debian

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DPKG_BUILD_CFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get CFLAGS)
DPKG_BUILD_CPPFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get CPPFLAGS)
DPKG_BUILD_LDFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get LDFLAGS)

DOC_PACKAGE	= nagios4-cgi

SHELL = /bin/sh -e


get-orig-source:
	uscan --force-download

clean:
	dh_testdir -a
	if test -f Makefile; then make distclean; fi
	find sources.orig -type f | while read f; do rm "$${f#sources.orig/}" && mv "$${f}" "$${f##sources.orig/}"; done
	rm -rf sources.orig
	rm -f keep install-stamp configure-stamp build-stamp
	rm -f html/js/histogram.js html/js/map.js html/js/trends.js
	rm -f startup/default-init startup/default-service startup/openrc-init startup/upstart-init
	find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \;
	find -type d -name build -print0 | xargs -0 -r rm -rf \;
	rm -f html/index.php lib/snprintf.h t/Makefile
	dh_clean

configure: configure-stamp
configure-stamp:
	dh_testdir -a
	if test -f Makefile; then make clean; fi
	for f in ./config.sub ./config.guess; do [ -f "sources.orig/$${f}" ] || { mkdir -p "sources.orig/$${f%/*}" && mv "$${f}" "sources.orig/$${f}"; }; done
	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	rm -f config.cache
	CFLAGS='$(DPKG_BUILD_CFLAGS) $(DPKG_BUILD_CPPFLAGS)' LDFLAGS='$(DPKG_BUILD_LDFLAGS)' \
		./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--bindir=/usr/sbin \
		--datadir=/usr/share/nagios4/htdocs \
		--sysconfdir=/etc/nagios4 \
		--infodir=/usr/share/info \
		--libexecdir=/usr/lib/nagios/plugins \
		--localstatedir=/var/lib/nagios4 \
		--enable-event-broker \
		--with-cgibindir=/usr/lib/cgi-bin/nagios4 \
		--with-nagios-user=nagios \
		--with-nagios-group=nagios \
		--with-command-user=nagios \
		--with-command-group=nagios \
		--with-init-dir=/etc/init.d \
		--with-lockfile=/var/run/nagios4/nagios4.pid \
		--with-mail=/usr/bin/mail \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) \
		--with-htmurl=/nagios4 \
		--with-cgiurl=/cgi-bin/nagios4
	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir -a
	$(MAKE) all
	make -C contrib
	touch build-arch-stamp

install: install-stamp
install-stamp: build-stamp
	dh_testdir -a
	dh_testroot -a
	dh_installdirs -a -i
	# zero out INSTALL_OPTS to prevent chowning at build-time
	make "DESTDIR=$(b)/tmp" COMMAND_OPTS= INSTALL_OPTS= install-unstripped
	# move some arch-indep stuff to the other packages
	mv debian/tmp/usr/sbin/nagios "$(b)/nagios4-core/usr/sbin/nagios4"
	mv debian/tmp/usr/sbin/nagiostats "$(b)/nagios4-core/usr/sbin/nagios4stats"
	dh_link		     -i
	dh_lintian
	dh_installdocs       -i
	dh_installman        -a -pnagios4
	dh_installlogrotate
	dh_installchangelogs -i
	dh_install           -i
	dh_installinit 	     --name nagios4 -- defaults 30 18
	dh_installexamples
	install -D debian/nagios4-cgi.conf -m 0644 debian/nagios4-cgi/usr/share/nagios4/apache2.conf
	dh_apache2
	touch install-stamp

binary: binary-arch binary-indep
binary-arch: install-stamp
	dh_testdir           -a
	dh_testroot          -a
	dh_link		     -a
	dh_installchangelogs -a
	dh_installdocs       -a
	dh_installdebconf    -a 
	dh_install           -a
	chmod 600 ${b}/nagios4-common/etc/nagios4/resource.cfg
	x=$$(cd debian/$(DOC_PACKAGE) && find . -name 'jquery-*.min.js') && \
	    rm debian/$(DOC_PACKAGE)/$$x && \
	    dh_link -p$(DOC_PACKAGE) /usr/share/javascript/jquery/jquery.min.js $$x
	dh_strip             -a
	dh_compress          -a -X.php
	dh_fixperms          -a
	dh_makeshlibs        -a -V
	dh_installdeb        -a
	dh_perl		     -a
	dh_shlibdeps         -a
	dh_gencontrol        -a
	dh_md5sums           -a
	dh_builddeb          -a

binary-indep: install-stamp
	dh_link		     -i
	dh_compress          -i
	dh_fixperms          -i -Xnagios4/resource.cfg
	dh_installdebconf    -i
	dh_perl		     -i
	dh_installdeb        -i
	dh_gencontrol        -i
	dh_md5sums           -i
	dh_builddeb          -i

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