File: rules

package info (click to toggle)
phpbb2 2.0.13%2B1-6sarge4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,272 kB
  • ctags: 12
  • sloc: sh: 446; makefile: 108; perl: 29; php: 21
file content (152 lines) | stat: -rwxr-xr-x 5,141 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
#!/usr/bin/make -f
#  $Id: rules 191 2005-03-29 21:11:48Z kink $
#
#  debian/rules file for phpbb2 Debian package
#
#  Written from scratch, with inspiration from apache's debian/rules, and the
#  examples from dh_make
#
#  Copyright 2002, 2004 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
#  Distributed under the GNU General Public License version 2
#

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

# Bash is easier
export SHELL = /bin/bash

SRCVERSION := $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//')
VERSION    := $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//;s/+[0-9]\+//')
UPSTREAM   := $(shell head -1 debian/changelog | sed 's/.*(//;s/-.*).*//')
MAINTAINER := $(shell grep ^Maintainer: debian/control | sed 's/^Maintainer: //')

get-orig-source:
	debian/get-orig-source $(UPSTREAM)
	mv phpbb2_$(UPSTREAM).orig.tar.gz ..

# Extract sources from the tarball and apply all upstream patches (aka mods)
source: source-upstream-stamp source-patch-stamp

source-upstream-stamp:
	dh_testdir

	@echo Extracting upstream tarball to debian/build/phpBB2...
	mkdir -p debian/build
	tar xjvCf debian/build phpBB-*.tar.bz2 > $@.log
	mkdir -p debian/build/l10n/language
	set -e ; for lang in lang/*.tar.gz; do \
		tar xzvCf debian/build/l10n/language $$lang; \
	done >> $@.log
	mkdir -p debian/build/l10n/templates
	set -e ; for lang in subSilver/*.tar.gz; do \
		tar xzvCf debian/build/l10n/templates $$lang; \
	done >> $@.log
	@# Esperanto has a botched tarball...
	mv debian/build/l10n/templates/images/* \
		debian/build/l10n/templates/subSilver/images
	rmdir debian/build/l10n/templates/images
	@# A lot of needlessly executable stuff in upstream...
	find debian/build/phpBB2 -type f -print0 | xargs -0r chmod a-x
	@# And a lot of windows-newlines too...
	find debian/build \( -name '*.htm' -o -name '*.tpl' -o -name '*.php' \) \
		-print0 | xargs -0r grep -Zl $$'\015$$' | xargs -0r sed -i $$'s/\015$$//'
	@# Remove unneccessary cruft (like an empty index.htm)
	rm debian/build/phpBB2/install/schemas/index.htm
	@touch $@

source-patch-stamp:
	set -e; for patch in debian/patches/*.diff; do \
		echo "Processing $${patch}..." ; \
		patch -f -d debian/build -p0 < $$patch ; \
	done
	sed -i "s/@VERSION@/$(VERSION) (Debian)/" debian/build/phpBB2/common.php
	cd debian && uudecode big_swirl_trans_60.gif.uue
	cd debian && uudecode small_swirl_trans_60.gif.uue
	mv debian/big_swirl_trans_60.gif \
		debian/build/phpBB2/templates/subSilver/images/logo_phpBB.gif
	mv debian/small_swirl_trans_60.gif \
		debian/build/phpBB2/templates/subSilver/images/logo_phpBB_med.gif
	touch $@

build: source

clean:
	@# No need to unpatch, as patched dir is cleaned anyway
	dh_testdir

	sed -i "s/Project-Id-Version: [^\\\\]*/Project-Id-Version: phpbb2 $(VERSION)/" debian/po/templates.pot
	sed -i "s/Report-Msgid-Bugs-To: [^\\\\]*/Report-Msgid-Bugs-To: $(MAINTAINER)/" debian/po/templates.pot
	debconf-updatepo

	rm -f *-stamp *-stamp.log
	rm -rf debian/build

	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs
	dh_installchangelogs debian/build/phpBB2/docs/CHANGELOG.html
	dh_installdocs
	html2text < debian/phpbb2/usr/share/doc/phpbb2/README.html \
		> debian/phpbb2/usr/share/doc/phpbb2/README
	html2text < debian/phpbb2/usr/share/doc/phpbb2/FAQ.html \
		> debian/phpbb2/usr/share/doc/phpbb2/FAQ
	gzip -9 debian/phpbb2/usr/share/doc/phpbb2/FAQ \
		debian/phpbb2/usr/share/doc/phpbb2/FAQ.html
	dh_installexamples
	dh_install
	mkdir -p debian/phpbb2/var/lib/phpbb2
	mv debian/phpbb2/usr/share/phpbb2/site/images/avatars debian/phpbb2/var/lib/phpbb2/avatars
	ln -s /var/lib/phpbb2/avatars debian/phpbb2/usr/share/phpbb2/site/images/avatars
	ln -s /etc/phpbb2/templates debian/phpbb2/usr/share/phpbb2/site/templates
	mkdir debian/phpbb2/etc/phpbb2/templates
	ln -s /usr/share/phpbb2/templates/subSilver debian/phpbb2/etc/phpbb2/templates
	ln -s /usr/share/doc/phpbb2/README.templates \
		debian/phpbb2/usr/share/phpbb2/templates/README
	chgrp www-data debian/phpbb2/var/lib/phpbb2/avatars
	chmod g=wx,o=  debian/phpbb2/var/lib/phpbb2/avatars
	chgrp www-data debian/phpbb2/var/lib/phpbb2/avatars/gallery
	chmod g=wx,o=  debian/phpbb2/var/lib/phpbb2/avatars/gallery

	mkdir -p debian/phpbb2/usr/share/lintian/overrides
	cp -a debian/phpbb2.lintian debian/phpbb2/usr/share/lintian/overrides/phpbb2
	mkdir -p debian/phpbb2-conf-mysql/usr/share/lintian/overrides
	cp -a debian/phpbb2-conf-mysql.lintian \
		debian/phpbb2-conf-mysql/usr/share/lintian/overrides/phpbb2-conf-mysql
#	dh_installmenu
	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms -Xvar/lib/phpbb2/avatars
#	dh_perl
#	dh_python
#	dh_makeshlibs
	find debian/phpbb2* -type d -name .svn | xargs -r rm -r

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -- -v$(VERSION)
	dh_md5sums
	dh_builddeb

binary-arch:
binary: binary-indep binary-arch

.PHONY: source build clean makedeb binary-indep binary-arch binary install \
	get-orig-source