File: rules

package info (click to toggle)
kopano-webapp 3.5.14+dfsg1.orig-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 45,160 kB
  • sloc: php: 35,994; xml: 2,116; sh: 436; makefile: 370; java: 300; python: 152; ruby: 14
file content (51 lines) | stat: -rwxr-xr-x 1,894 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk
RELEASE := $(DEB_DISTRIBUTION)
PHP_VERSION = $(shell basename $$(readlink -f /usr/bin/php-config) | sed 's/php-config//g')

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

%:
	dh $@ 

check_php_version:
	@if [ "x$(PHP_VERSION)" = "x" ]; then \
		echo "Variable \$$(PHP_VERSION) is empty! Giving up!" ;\
		exit 99 ;\
	else \
		echo "##########################" ;\
		echo "# Using PHP_VERSION: '$(PHP_VERSION)'" ;\
		echo "##########################" ;\
	fi

override_dh_auto_clean:

override_dh_auto_build: check_php_version
	# now let's build the stuff
	make -j$(NUMJOBS)
	mkdir $(CURDIR)/debian/tmp
	cp -a $(CURDIR)/deploy $(CURDIR)/debian/tmp/
	sed -e "s/@version@/$(PHP_VERSION)/g" debian/kopano-webapp-apache2.postinst.in > debian/kopano-webapp-apache2.postinst
	sed -e "s/@version@/$(PHP_VERSION)/g" debian/kopano-webapp-lighttpd.postinst.in > debian/kopano-webapp-lighttpd.postinst
	sed -e "s/@version@/$(PHP_VERSION)/g" debian/kopano-webapp-nginx.postinst.in > debian/kopano-webapp-nginx.postinst

override_dh_install:
	dh_install -X.js.map -X*debug.js -X.md
	# figure out package version
	echo $(DEB_VERSION) > \
		$(CURDIR)/debian/kopano-webapp-common/usr/share/kopano-webapp/version
	# remove additional license files
	rm $(CURDIR)/debian/kopano-webapp-common/usr/share/kopano-webapp/client/tinymce-plugins/powerpaste/License.txt
	sed -i "s/@version@/$(PHP_VERSION)/g" debian/kopano-webapp-nginx/etc/nginx/sites-available/kopano-webapp.conf

override_dh_fixperms:
	dh_fixperms -Xvar/lib/kopano-webapp/tmp
	chown www-data:www-data $(CURDIR)/debian/kopano-webapp-common/var/lib/kopano-webapp/tmp
	find $(CURDIR)/debian/kopano-webapp-common/usr/share/kopano-webapp -type f -exec chmod -x {} \;

override_dh_auto_test: