File: rules

package info (click to toggle)
icinga 1.14.2+ds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 49,264 kB
  • sloc: ansic: 108,564; sql: 9,656; sh: 4,945; perl: 3,439; makefile: 1,213; php: 581; xml: 104
file content (234 lines) | stat: -rwxr-xr-x 11,784 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
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
227
228
229
230
231
232
233
234
#!/usr/bin/make -f
# debian/rules makefile for icinga

# export DH_VERBOSE=1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export AUTOHEADER=true

b := $(shell pwd)/debian

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS += $(CPPFLAGS)

SHELL		= /bin/sh -e
CONFIGURE_OPTS	= --prefix=/usr \
				--mandir=/usr/share/man \
				--bindir=/usr/sbin \
				--sbindir=/usr/lib/cgi-bin/icinga \
				--datarootdir=/usr/share/icinga/htdocs \
				--sysconfdir=/etc/icinga \
				--infodir=/usr/share/info \
				--libexecdir=/usr/lib/nagios/plugins \
				--localstatedir=/var/lib/icinga \
				--with-state-dir=/var/cache/icinga \
				--enable-event-broker \
				--with-ido-sockfile=/var/lib/icinga/ido.sock \
				--enable-embedded-perl \
				--with-icinga-user=nagios \
				--with-icinga-group=nagios \
				--with-command-user=nagios \
				--with-command-group=nagios \
				--with-init-dir=/etc/init.d \
				--with-lockfile=/var/run/icinga/icinga.pid \
				--with-mail=/usr/bin/mail \
				--with-perlcache \
				--build=$(DEB_BUILD_GNU_TYPE) \
				--host=$(DEB_HOST_GNU_TYPE) \
				--with-htmurl=/icinga \
				--with-cgiurl=/cgi-bin/icinga \
				--with-p1-file-dir=/usr/lib/icinga \
				--enable-idoutils \
				--with-ido2db-lockfile=/var/run/icinga/ido2db.pid \
				--with-log-dir=/var/log/icinga \
				--libdir=/usr/lib/icinga \
				--with-temp-file=/var/cache/icinga/icinga.tmp \
				--with-mainurl=/cgi-bin/icinga/tac.cgi

%:
	dh $@ --with autoreconf

fix-configs: fix-configs-stamp
fix-configs-stamp:
	mkdir -p debian-configs
	sed -e '/Sample CGI/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
	    -e '/Last Modified/,+1 d' \
	    sample-config/cgi.cfg > debian-configs/cgi.cfg
	sed -i -e 's/local-service/generic-service/' \
		module/idoutils/config/ido2db_check_proc.cfg
	sed -i -e 's#/usr/sbin/#/usr/lib/icinga/#' \
		module/idoutils/config/idoutils.cfg-sample
	sed -e '/Sample Main Config/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
	    -e '/Last Modified/ d' \
	    sample-config/icinga.cfg > debian-configs/icinga.cfg
	sed -e '/SAMPLE COMMAND DEFINITIONS/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
	   -e '/Last Modified/,+1 d' \
	   -e '/^#$$/ d' sample-config/template-object/commands.cfg > debian-configs/commands.cfg
	sed -i  \
		-e "s/^\(db_host=\).*/\1_DBC_DBSERVER_/" \
		-e "s/^\(db_servertype=\).*/\1_DBC_DBTYPE_/"  \
		-e "s/^\(db_port=\).*/\1_DBC_DBPORT_/" \
		-e "s/^\(db_name=\).*/\1_DBC_DBNAME_/" \
		-e "s/^\(db_user=\).*/\1_DBC_DBUSER_/" \
		-e "s/^\(db_pass=\).*/\1_DBC_DBPASS_/" module/idoutils/config/ido2db.cfg-sample

override_dh_auto_clean:
	dh_testdir
	dh_testroot
	if test -f Makefile; then make distclean; fi
	rm -f install-stamp configure-stamp build-stamp fix-configs-stamp
	rm -rf debian-configs
	-rm -f contrib/perlxsi.c
	find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \;
	-rm -f platform.h auto-include.h
	-rm -f solaris/pkginfo
	-rm -f contrib/eventhandlers/submit_check_result contrib/eventhandlers/disable_active_service_checks
	-rm -f contrib/eventhandlers/disable_notifications contrib/eventhandlers/enable_active_service_checks
	-rm -f contrib/eventhandlers/enable_notifications
	-rm -f config.log
	find -type d -name build -print0 | xargs -0 -r rm -rf \;
	find \( -name config.sub -o -name config.guess \) -print0 | xargs -0 -r rm -f \;

override_dh_auto_configure:
	dh_testdir
	@echo "Doing $@"
	if test -f Makefile; then make clean; fi
	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	rm -f config.cache

	dh_auto_configure -- $(CONFIGURE_OPTS)

override_dh_auto_build:
	dh_testdir
	@echo "Doing $@"
	dh_auto_build -- all
	dh_auto_build --sourcedirectory=contrib

override_dh_auto_test:
	mkdir -p t/var/spool/checkresults

	dh_auto_test

	rm -rf t/var/spool

override_dh_auto_install: fix-configs-stamp
	@echo "Doing $@"
	dh_testdir
	dh_testroot
	dh_installdirs -a -i
	$(MAKE) install DESTDIR=$b/tmp INSTALL_OPTS="" COMMAND_OPTS=""
	$(MAKE) install-idoutils DESTDIR=$b/icinga-idoutils INSTALL_OPTS="" COMMAND_OPTS=""
	rm -f $b/icinga-idoutils/etc/icinga/ido2db.cfg-sample
	#We have to rename the sample files
	#mv $b/icinga-idoutils/etc/icinga/ido2db.cfg-sample $b/icinga-idoutils/etc/icinga/ido2db.cfg
	mv $b/icinga-idoutils/etc/icinga/idomod.cfg-sample $b/icinga-idoutils/etc/icinga/idomod.cfg
	mkdir -p $b/icinga-idoutils/usr/share/doc/icinga-idoutils/examples
	mv $b/icinga-idoutils/etc/icinga/modules/idoutils.cfg-sample $b/icinga-idoutils/usr/share/doc/icinga-idoutils/examples
	mkdir -p $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/install \
	         $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/install
	cp module/idoutils/db/mysql/mysql.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/install/mysql
	cp module/idoutils/db/pgsql/pgsql.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/install/pgsql
	mkdir -p $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/
	mkdir -p $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.0.2-fix-object-relations.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.0.2-2
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.0.2.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.0.2-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.0.2-fix-object-relations.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.0.2-2
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.0.3.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.0.3-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.3.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.2.99-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.4.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.4.0
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.5.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.5.0-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.6.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.6.0-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.7.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.7.0-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.8.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.8.0-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.9.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.9.0-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.10.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.10.1-1
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.11.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.11.0
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.11.3.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.11.3-2
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.11.6.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.11.6
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.12.0
	cp module/idoutils/db/mysql/upgrade/mysql-upgrade-1.13.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/mysql/1.13.0
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.0.1.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.0.1-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.0.3.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.0.3-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.3.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.2.99-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.4.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.5.0-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.6.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.6.0-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.7.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.7.0-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.8.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.8.0-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.9.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.9.0-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.10.1-1
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.11.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.11.0
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.11.3.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.11.3-2
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.11.6.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.11.6
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.12.0
	cp module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.13.0.sql $b/icinga-idoutils/usr/share/dbconfig-common/data/icinga-idoutils/upgrade/pgsql/1.13.0

	# remove jquery from package
	rm -rf ${b}/tmp/usr/share/icinga/htdocs/js/jquery-*
	rm -rf ${b}/tmp/usr/share/icinga/htdocs/docs/js/jquery-*

override_dh_install-arch:
	dh_install -a

	# fix permissions
	chmod 644 ${b}/icinga-core/usr/lib/icinga/p1.pl

override_dh_install-indep:
	dh_install -i

	# set up /var/cache/icinga for access by www-data
	chgrp www-data ${b}/icinga-common/var/cache/icinga
	chmod g+s ${b}/icinga-common/var/cache/icinga
	chown root:www-data ${b}/icinga-common/var/lib/icinga/rw
	chmod 700 ${b}/icinga-common/var/lib/icinga/rw

	rm -f ${b}/icinga-common/usr/share/icinga/plugins/eventhandlers/*.in
	chmod +x ${b}/icinga-common/usr/share/icinga/plugins/eventhandlers/* \
	         ${b}/icinga-common/usr/share/icinga/plugins/eventhandlers/distributed-monitoring/* \
	         ${b}/icinga-common/usr/share/icinga/plugins/eventhandlers/redundancy-scenario1/*

	chmod 755 ${b}/icinga-common/var/lib/icinga
	# the real version is in -cgi
	rm -f ${b}/icinga-common/etc/icinga/cgi.cfg

	chmod 600 ${b}/icinga-common/etc/icinga/resource.cfg
	chmod +x ${b}/icinga-common/usr/share/icinga/plugins/eventhandlers/submit_check_result

override_dh_installexamples-arch:
	dh_installexamples -a

	chmod -x ${b}/icinga-idoutils/usr/share/doc/icinga-idoutils/examples/README
	rm -f ${b}/icinga-idoutils/usr/share/doc/icinga-idoutils/examples/scripts/*.in

override_dh_installexamples-indep:
	dh_installexamples -i

override_dh_installinit:
	dh_installinit --name icinga --error-handler=init_failed
	dh_installinit --name ido2db -n -picinga-idoutils

override_dh_link:
	rm -rf ${b}/icinga/usr/share/doc/
	rm -rf ${b}/icinga-core/usr/share/doc/

	dh_link

override_dh_strip:
	dh_strip --dbgsym-migration='icinga-dbg (<< 1.14.2)'

override_dh_compress:
	dh_compress -X.sql

overide_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_fixperms-arch:
	dh_fixperms -a -X/var/cache/icinga

override_dh_fixperms-indep:
	dh_fixperms -i -Xicinga/resource.cfg