File: rules

package info (click to toggle)
z-push 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,936 kB
  • sloc: php: 48,446; sh: 156; python: 63; makefile: 43; xml: 18; sql: 12
file content (64 lines) | stat: -rwxr-xr-x 2,060 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
#!/usr/bin/make -f
# -*- makefile -*-

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

# getting DEB_VERSION from helper without manually parsing the changelog file
include /usr/share/dpkg/pkg-info.mk

PHP_FILES := $(shell find src tools -type f -name "*.php")

%:
	dh  $@

check_php_files:
	#########################################
	# Perfoming syntax check for PHP files. #
	#########################################
	@ERROR=0 ;\
	for file in $(PHP_FILES); do \
		if ! /usr/bin/php -l $${file} 1>/dev/null ; then \
			echo "syntax check for $${file} failed!" ;\
			ERROR=1 ;\
		fi \
	done ;\
	if [ "$${ERROR}" -eq "1" ]; then \
		echo "Error(s) found while syntax check! Exciting!" ;\
		exit 99 ;\
	else \
		echo "No syntax error(s) found." ;\
	fi

override_dh_install: check_php_files
	find src -type f \( -name "*.php" \) -exec chmod 644 {} \;
	sed -e "s/DEB_VERSION/${DEB_VERSION}/" debian/version.php.in > src/version.php
	dh_install -X LICENSE
	# Rename so we can have dh_installdocs install this with a proper name.
	cp -a src/autodiscover/INSTALL src/autodiscover/README.autodiscover

override_dh_installdocs:
	dh_installdocs
	# Move some README files to appropriate folder.
	mv debian/z-push-backend-carddav/usr/share/z-push/backend/carddav/README \
		debian/z-push-backend-carddav/usr/share/doc/z-push-backend-carddav/z-push-backend-carddav.README
	mv debian/z-push-backend-imap/usr/share/z-push/backend/imap/README \
		debian/z-push-backend-imap/usr/share/doc/z-push-backend-imap/z-push-backend-imap.README


override_dh_fixperms-indep:
	dh_fixperms
	chmod 755 debian/z-push-backend-kopano/usr/share/z-push/backend/kopano/checkshares.php
	chmod 755 debian/z-push-backend-kopano/usr/share/z-push/backend/kopano/listfolders.php
	chmod 755 debian/z-push-common/usr/share/z-push/z-push-admin.php
	chmod 755 debian/z-push-common/usr/share/z-push/z-push-top.php
	chmod 755 debian/z-push-state-sql/usr/share/z-push/tools/migrate-filestates-to-db.php

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean
	debconf-updatepo

build: