File: rules

package info (click to toggle)
homer-api 5.0.6%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,604 kB
  • ctags: 2,439
  • sloc: php: 8,259; sql: 1,212; perl: 984; sh: 318; makefile: 69
file content (61 lines) | stat: -rwxr-xr-x 3,097 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- makefile -*-

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

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# we don't really need to run upstream configure and make
override_dh_auto_configure:
	true
override_dh_auto_build:
	true

%:
	dh $@ --with apache2

# the sed command below to insert mpath is a workaround for
# Debian bug #837754
# when the bug is closed, the workaround can be removed and this package
# can be changed from arch: any to arch: all

override_dh_auto_install:
	dh_install \
		-X.htaccess \
		-Xmysql.php -Xpgsql.php \
                -XCOPYING -XLICENSE \
                -Xjquery.min.js \
		api usr/share/homer/web
	# must not try to start Kamailio until user manually configures the DB
	dh_installinit --name kamailio-homer --no-start
	install -D -T -m 0640 examples/sipcapture/sipcapture.kamailio $(CURDIR)/debian/homer-api-mysql/etc/homer/kamailio-homer.cfg
	install -D -T -m 0640 examples/pgsql/kamailio.cfg $(CURDIR)/debian/homer-api-postgresql/etc/homer/kamailio-homer.cfg
	for cfg in $(CURDIR)/debian/homer-api-mysql/etc/homer/kamailio-homer.cfg $(CURDIR)/debian/homer-api-postgresql/etc/homer/kamailio-homer.cfg ; \
	do \
		grep -q ^mpath $$cfg || sed -i "0,/^loadmodule.*/s!^loadmodule.*!mpath=\"/usr/lib/$(DEB_HOST_MULTIARCH)/kamailio/modules/\"\n&!" $$cfg ; \
	done
	install -D -T -m 0644 scripts/sipcapture.crontab $(CURDIR)/debian/homer-api/etc/cron.d/homer
	sed -i \
		-e 's/ root / homer /g' \
		-e 's!/usr/bin/homer_!/usr/lib/homer/libexec/homer_!g' \
		$(CURDIR)/debian/homer-api/etc/cron.d/homer
	install -D -T -m 0644 examples/sipcapture/sipcapture.rsyslogd $(CURDIR)/debian/homer-api/etc/rsyslog.d/homer.conf
	sed -i -e 's/homer$$/homer.log/g' $(CURDIR)/debian/homer-api/etc/rsyslog.d/homer.conf
	install -D -T -m 0640 -g www-data api/configuration_example.php $(CURDIR)/debian/homer-api/etc/homer/configuration.php
	install -D -T -m 0640 -g www-data api/preferences_example.php $(CURDIR)/debian/homer-api/etc/homer/preferences.php
	sed -i -e "s!^define('PROFILE_PARAM.*\$$!define('PROFILE_PARAM', '/var/lib/homer/store/profile');!g" \
		-e "s!^define('DASHBOARD_PARAM.*\$$!define('DASHBOARD_PARAM', '/var/lib/homer/store/dashboard');!g" \
		$(CURDIR)/debian/homer-api/etc/homer/preferences.php
	install -d $(CURDIR)/debian/homer-api/usr/lib/homer/libexec
	install -m 0755 scripts/homer_partremove $(CURDIR)/debian/homer-api/usr/lib/homer/libexec
	install -D -T -m 0640 scripts/rotation.ini $(CURDIR)/debian/homer-api-mysql/etc/homer/rotation.ini
	install -D -T -m 0640 scripts/pgsql/rotation.ini $(CURDIR)/debian/homer-api-postgresql/etc/homer/rotation.ini

override_dh_fixperms:
	dh_fixperms
	chmod a+x $(CURDIR)/debian/homer-api/usr/share/homer/examples/sipcapture/el6/sipcapture.init
	chmod a-x $(CURDIR)/debian/homer-api/usr/share/homer/web/apidoc/html/utils/send_sample_request.js
	install -o www-data -g www-data -m 0750 -d $(CURDIR)/debian/homer-api/var/lib/homer/store/profile
	install -o www-data -g www-data -m 0750 -d $(CURDIR)/debian/homer-api/var/lib/homer/store/dashboard