File: rules

package info (click to toggle)
phpwiki 1.3.12p3-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,956 kB
  • ctags: 21,608
  • sloc: php: 82,335; xml: 3,840; sh: 1,522; sql: 1,198; perl: 625; makefile: 562; awk: 28
file content (117 lines) | stat: -rwxr-xr-x 4,143 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

# Using dpatch
include /usr/share/dpatch/dpatch.make

DESTDIR=$(CURDIR)/debian/phpwiki
USDIR=$(CURDIR)/debian/upgrade-schemas
DBCDIR=$(DESTDIR)/usr/share/dbconfig-common/data/phpwiki

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

build: patch

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot
	debconf-updatepo

	# Sigh, yet again there are unwanted files in the upstream package
	dh_clean -X TAGS

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/phpwiki.
	chmod 2775 $(DESTDIR)/var/lib/phpwiki
	chgrp www-data $(DESTDIR)/var/lib/phpwiki

	cp -a config lib locale pgsrc themes $(DESTDIR)/usr/share/phpwiki

	# Removed to fix #316714 (XMLRPC vulnerability)
	rm -f $(DESTDIR)/usr/share/phpwiki/lib/XMLRPC/xmlrpc.inc

	# Move schemas to their home as required by dbconfig-common
	cp -a schemas $(DESTDIR)/usr/share/doc/phpwiki
	mkdir -p $(DBCDIR)/install
	mv $(DESTDIR)/usr/share/doc/phpwiki/schemas/mysql-initialize.sql \
		$(DBCDIR)/install/mysql
	mv $(DESTDIR)/usr/share/doc/phpwiki/schemas/psql-initialize.sql \
		$(DBCDIR)/install/pgsql
	mv $(DESTDIR)/usr/share/doc/phpwiki/schemas/sqlite-initialize.sql \
		$(DBCDIR)/install/sqlite
	mkdir -p $(DBCDIR)/upgrade/sqlite $(DBCDIR)/upgrade/mysql \
		$(DBCDIR)/upgrade/pgsql
	cp $(USDIR)/sqlite-upgrade-1.3.10.sql $(DBCDIR)/upgrade/sqlite/1.3.10
	cp $(USDIR)/sqlite-upgrade-1.3.11.sql $(DBCDIR)/upgrade/sqlite/1.3.11
	cp $(USDIR)/sqlite-upgrade-1.3.12.sql $(DBCDIR)/upgrade/sqlite/1.3.12
	cp $(USDIR)/upgrade-1.3.10.sql $(DBCDIR)/upgrade/mysql/1.3.10
	cp $(USDIR)/upgrade-1.3.11.sql $(DBCDIR)/upgrade/mysql/1.3.11
	cp $(USDIR)/upgrade-1.3.12.sql $(DBCDIR)/upgrade/mysql/1.3.12
	cp $(USDIR)/upgrade-1.3.10.sql $(DBCDIR)/upgrade/pgsql/1.3.10
	cp $(USDIR)/upgrade-1.3.11.sql $(DBCDIR)/upgrade/pgsql/1.3.11
	cp $(USDIR)/upgrade-1.3.12.sql $(DBCDIR)/upgrade/pgsql/1.3.12
	
	chmod a-x $(DESTDIR)/usr/share/phpwiki/lib/WikiGroup.php \
		  $(DESTDIR)/usr/share/phpwiki/locale/README.de.txt
	cp debian/overrides $(DESTDIR)/usr/share/lintian/overrides/phpwiki
	cp debian/overrides.linda $(DESTDIR)/usr/share/linda/overrides/phpwiki
	rm -rf $(DESTDIR)/usr/share/phpwiki/lib/pear/[DLP]*
	rm -f $(DESTDIR)/usr/share/phpwiki/lib/WikiDB/adodb/license.txt
	rm -f $(DESTDIR)/usr/share/phpwiki/locale/Makefile		\
	      $(DESTDIR)/usr/share/phpwiki/locale/README		\
	      $(DESTDIR)/usr/share/phpwiki/locale/make-php-trans.awk	\
	      $(DESTDIR)/usr/share/phpwiki/locale/update-makefile.sh
	# Remove extra licensing info, which is copied into debian/copyright
	rm -f $(DESTDIR)/usr/share/phpwiki/themes/default/moacdropdown/license.txt

	# Remove other cruft that should not be in the final package
	rm -f $(DESTDIR)/usr/share/phpwiki/config/phpwiki.spec
	rm -f $(DESTDIR)/usr/share/doc/phpwiki/schemas/.htaccess
	rm -f $(DESTDIR)/usr/share/phpwiki/config/make-dbhelper.pl

	cp index.php $(DESTDIR)/usr/share/phpwiki/index.php
	cp passencrypt.php $(DESTDIR)/usr/share/phpwiki
	cp debian/migrate-phpwiki-config $(DESTDIR)/usr/share/phpwiki
	# Remove all execute perms in /usr/share/phpwiki
	find $(DESTDIR)/usr/share/phpwiki -type f -exec chmod -x {} \;
	# Add them back for scripts
	chmod +x $(DESTDIR)/usr/share/phpwiki/migrate-phpwiki-config
	chmod +x $(DESTDIR)/usr/share/phpwiki/lib/updateinterwikimap
	chmod +x $(DESTDIR)/usr/share/phpwiki/locale/cvt-utf8.sh

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdebconf	
	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_compress
	dh_fixperms -X/var/lib/phpwiki
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
	# Nothing to do here, move along

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