File: rules

package info (click to toggle)
php3 3%3A3.0.18-0potato1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,736 kB
  • ctags: 11,198
  • sloc: ansic: 108,120; sh: 2,512; php: 2,024; yacc: 1,887; makefile: 1,038; perl: 537; pascal: 238; awk: 90; cpp: 28; sql: 11
file content (187 lines) | stat: -rwxr-xr-x 8,366 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.

# modified by Gergely Madarasz <gorgo@caesar.elte.hu>
# for use with the php3 packages.

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

apachever=$(shell dpkg -s apache-dev | grep "^Version" | cut '-d ' -f2 | cut -d- -f1)
php3ver=$(shell head -1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')

modules=pgsql mysql imap gd xml ldap snmp magick mhash

build: build-stamp

apache-stamp:
	dh_testdir
	# Add here commands to compile the package.
	-mkdir apache 
	-ln -s ../mod_php3.c apache
	-ln -s ../mod_php3.h apache
	-ln -s ../php_version.h apache
	cd apache && ../configure --with-apxs=/usr/bin/apxs --disable-debug \
		--with-filepro --with-config-file-path=/etc/php3/apache \
		--with-zlib --without-gd --enable-sysvsem --enable-sysvshm \
		--with-yp --with-gettext --with-ftp
	cd apache && make
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/include/postgresql -o pgsql.so ../functions/pgsql.c -lpq -lc 
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/include/mysql -o mysql.so ../functions/mysql.c -lmysqlclient -lc 
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/include/freetype -o gd.so ../functions/gd.c ../functions/gdcache.c ../functions/gdttf.c -lgd -lttf -lt1 -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/include/c-client -o imap.so ../functions/imap.c -lc-client -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -o xml.so ../functions/xml.c -lxmlparse -lxmltok -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -o ldap.so ../functions/ldap.c -lldap -llber -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/include/ucd-snmp -o snmp.so ../functions/snmp.c -lsnmp -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -I/usr/X11R6/include -o magick.so ../functions/magick.c -L/usr/X11R6/lib -lMagick -lbz2 -lc
	cd apache && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/apache-1.3 -o mhash.so ../functions/mhash.c -lmhash -lc
	cd dl && (./setup ; make clean; make CFLAGS="-I/usr/include/apache-1.3 -I ../apache" calendar.so crypt.so)
	mv dl/calendar.so dl/crypt.so apache
	touch apache-stamp

cgi-stamp:
	dh_testdir
	# Add here commands to compile the package.
	-mkdir cgi
	cd cgi && ../configure --enable-force-cgi-redirect --disable-debug \
		--with-filepro --with-config-file-path=/etc/php3/cgi \
		--with-system-regex --with-zlib --without-gd \
		--enable-sysvsem --enable-sysvshm --with-yp \
		--with-gettext --with-ftp
	cd cgi && make LDFLAGS="-rdynamic"
	# build the binary for /usr/bin too
	cd cgi && rm main.o request_info.o fopen-wrappers.o && \
	    mv php php-ok && mv config.h config.h.old && \
	    sed -e 's/FORCE_CGI_REDIRECT 1/FORCE_CGI_REDIRECT 0/' \
	      -e 's/DISCARD_PATH 0/DISCARD_PATH 1/' <config.h.old >config.h && \
	    touch -r config.h.old config.h
	cd cgi && make LDFLAGS="-rdynamic"
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/postgresql -o pgsql.so ../functions/pgsql.c -lpq -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/mysql -o mysql.so ../functions/mysql.c -lmysqlclient -lc 
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/freetype -o gd.so ../functions/gd.c ../functions/gdcache.c ../functions/gdttf.c -lgd -lttf -lt1 -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/c-client -o imap.so ../functions/imap.c -lc-client -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -o xml.so ../functions/xml.c -lxmlparse -lxmltok -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -o ldap.so ../functions/ldap.c -lldap -llber -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/include/ucd-snmp -o snmp.so ../functions/snmp.c -lsnmp -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -I/usr/X11R6/include -o magick.so ../functions/magick.c -L/usr/X11R6/lib -lMagick -lbz2 -lc
	cd cgi && $(CC) -shared -fPIC -DCOMPILE_DL=1 -I.. -I. -o mhash.so ../functions/mhash.c -lmhash -lc
	cd dl && (./setup; make clean; make CFLAGS="-I../cgi" calendar.so crypt.so)
	mv dl/calendar.so dl/crypt.so cgi
	touch cgi-stamp

build-stamp: build-arch-stamp
	touch build-stamp

build-arch: build-arch-stamp

build-arch-stamp: apache-stamp cgi-stamp
	dh_testdir
	cd convertor && make
	touch build-arch-stamp

build-indep: build-indep-stamp

build-indep-stamp:
	dh_testdir
	# the docs are included in html form, no more need to build them
	#-mkdir docs
	#cd docs && ../configure
	#cp docs/doc/version.ent doc
	#cd docs/doc && make html
	touch build-indep-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp
	# Add here commands to clean up after the build process.
	-$(MAKE) -C convertor clean
	-$(MAKE) -C dl clean
	-$(MAKE) distclean
	rm -rf apache cgi
	dh_clean

# Build architecture-independent files here.
binary-indep: build-indep
	dh_testdir -i
	dh_testroot  -i
	dh_testversion 2.0.40
	dh_clean -k -i
	dh_installdirs -i
	cp doc/*.html debian/php3-doc/usr/share/doc/php3-doc/html
	ln -s manual.html debian/php3-doc/usr/share/doc/php3-doc/html/index.html
	dh_installdocs -i
	dh_installchangelogs -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture-dependent files here.
binary-arch: build-arch
	dh_testdir -a
	dh_testroot  -a
	dh_testversion 2.0.40
	dh_clean -k -a
	dh_installdirs -a
	cp convertor/convertor debian/tmp/usr/bin/php3-convertor
	cp convertor/README debian/tmp/usr/share/doc/php3/README.convertor
	cp -a examples extra debian/tmp/usr/share/doc/php3
	sed -e "s/_php3_type_/apache/" <php3.ini-dist | tr "\t" " " > debian/tmp/etc/php3/apache/php3.ini
	sed -e "s/_php3_type_/cgi/" <php3.ini-dist | tr "\t" " " > debian/php3-cgi/etc/php3/cgi/php3.ini
	cp debian/500mod_php3.info debian/tmp/usr/lib/apache/1.3
	cp apache/libphp3.so debian/tmp/usr/lib/apache/1.3
	cp cgi/php-ok debian/php3-cgi/usr/lib/cgi-bin/php3
	cp cgi/php debian/php3-cgi/usr/bin/php3
	cp apache/calendar.so apache/crypt.so debian/tmp/usr/lib/php3/apache
	cp cgi/calendar.so cgi/crypt.so debian/php3-cgi/usr/lib/php3/cgi
	for i in $(modules); do \
		cp apache/$$i.so debian/php3-$$i/usr/lib/php3/apache; \
		cp cgi/$$i.so debian/php3-cgi-$$i/usr/lib/php3/cgi; \
	done
	cp *.h debian/php3-dev/usr/include/php3
	cp dl/*.h debian/php3-dev/usr/include/php3/dl
	cp functions/head.h functions/number.h functions/dl.h debian/php3-dev/usr/include/php3/functions
	cp apache/*.h debian/php3-dev/usr/include/php3/apache
	cp cgi/*.h debian/php3-dev/usr/include/php3/cgi
	cp regex/regex.h debian/php3-dev/usr/include/php3/regex
	dh_installdocs -pphp3 CHANGES BUGS CREDITS press-release-3.0.txt
	dh_installdocs -pphp3-cgi CHANGES BUGS CREDITS press-release-3.0.txt 
	dh_installdocs 
	for i in $(modules); do \
		rm -rf debian/php3-$$i/usr/share/doc/php3-$$i; \
		rm -rf debian/php3-cgi-$$i/usr/share/doc/php3-cgi-$$i; \
		ln -s php3 debian/php3-$$i/usr/share/doc/php3-$$i; \
		ln -s php3-cgi debian/php3-cgi-$$i/usr/share/doc/php3-cgi-$$i; \
	done
	ln -s ../php3-doc/html debian/tmp/usr/share/doc/php3
	ln -s ../php3-doc/html debian/php3-cgi/usr/share/doc/php3-cgi
	dh_installchangelogs -pphp3 ChangeLog
	dh_installchangelogs -pphp3-cgi ChangeLog
	dh_installchangelogs -pphp3-dev
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	echo "apache:Depends=apache-common (>= $(apachever)), apache-common (<< $(apachever).1)" >>debian/substvars
	for i in $(modules); do \
		echo "php3:Depends=php3 (= $(php3ver))" >>debian/php3-$$i.substvars; \
		echo "php3-cgi:Depends=php3-cgi (= $(php3ver))" >>debian/php3-cgi-$$i.substvars; \
	done
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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