File: rules

package info (click to toggle)
php3-dbase 1%3A3.0.5-1
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 264 kB
  • ctags: 596
  • sloc: ansic: 1,826; makefile: 140; sh: 33
file content (90 lines) | stat: -rwxr-xr-x 3,033 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
#!/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.

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

php3ver=$(shell head -1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g' | cut -d- -f1)
dbfver=1.6-4

build: build-stamp

dbase-stamp:
	dh_testdir
	cd dbase && make so all
	touch dbase-stamp

apache-stamp: dbase-stamp
	dh_testdir
	# Add here commands to compile the package.
	test -d apache || mkdir apache
	$(CC) -shared -fPIC -DCOMPILE_DL=1 -I. -I/usr/include/php3 -I/usr/include/php3/apache -I/usr/include/apache-1.3 -o apache/dbase.so dbase.c -Ldbase -ldbf -lc
	touch apache-stamp

cgi-stamp: dbase-stamp
	dh_testdir
	# Add here commands to compile the package.
	test -d cgi || mkdir cgi
	$(CC) -shared -fPIC -DCOMPILE_DL=1 -I. -I/usr/include/php3 -I/usr/include/php3/cgi -o cgi/dbase.so dbase.c -Ldbase -ldbf -lc
	touch cgi-stamp

build-stamp: dbase-stamp apache-stamp cgi-stamp
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp dbase-stamp apache-stamp cgi-stamp
	# Add here commands to clean up after the build process.
	rm -rf apache cgi
	-cd dbase && make clean
	-cd dbase && rm -f dbfadd dbfcr dbfcreat dbfdel dbfget dbflst dbfndx dbfpack dbfscan dbftst tmpl tmpl.dbf
	dh_clean

# Build architecture-independent files here.
binary-indep:

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir -a
	dh_testroot  -a
	dh_clean -k -a
	dh_installdirs -a
	cp apache/dbase.so debian/tmp/usr/lib/php3/apache
	cp cgi/dbase.so debian/php3-cgi-dbase/usr/lib/php3/cgi
	cd dbase && make prefix=`pwd`/../debian/dbf/usr install 
	cp -a dbase/libdbf.so.1.6 debian/libdbf1.6/usr/lib
	mv debian/dbf/usr/lib/lib* debian/libdbf1.6-dev/usr/lib
	cp dbase/*.h debian/libdbf1.6-dev/usr/include/dbf
	ln -s libdbf.so.1.6 debian/libdbf1.6-dev/usr/lib/libdbf.so
	dh_installdocs -pphp3-dbase
	dh_installdocs -pphp3-cgi-dbase
	dh_installdocs -plibdbf1.6
	dh_installdocs -plibdbf1.6-dev
	dh_installdocs -pdbf dbase/README dbase/HISTORY
	dh_installchangelogs -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	LD_LIBRARY_PATH=`pwd`/dbase dh_shlibdeps -a
	echo "php3:Depends=php3 (>= $(php3ver)), php3 (<< $(php3ver).1)" >>debian/substvars
	echo "php3-cgi:Depends=php3-cgi (>= $(php3ver)), php3-cgi (<< $(php3ver).1)" >>debian/php3-cgi-dbase.substvars
	echo "libdbf:Depends=libdbf1.6 (= $(dbfver))" >>debian/libdbf1.6-dev.substvars
	dh_gencontrol -pphp3-dbase
	dh_gencontrol -pphp3-cgi-dbase
	dh_gencontrol -plibdbf1.6 -u-v$(dbfver)
	dh_gencontrol -plibdbf1.6-dev -u-v$(dbfver)
	dh_gencontrol -pdbf -u-v$(dbfver)
	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