New PHP5 APC - version 3.0.18, using PHP5 5.2.0-8+etch10,
[php5-apc.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 export PHP_PREFIX="/usr"
13
14 package=php5-apc
15 phpapiver=$(shell php-config5 --phpapi)
16
17 CFLAGS = -Wall -g
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22         CFLAGS += -O2
23 endif
24
25 # shared library versions, option 1
26 version=2.0.5
27 major=2
28 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
29 #version=`ls src/.libs/lib*.so.* | \
30 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
31 #major=`ls src/.libs/lib*.so.* | \
32 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
33
34 configure: configure-stamp
35 configure-stamp:
36         dh_testdir
37
38         phpize5
39         ./configure \
40         --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
41         --prefix=/usr \
42         --enable-apc-mmap \
43         --with-apxs \
44         --with-php-config=$(PHP_PREFIX)/bin/php-config5
45
46         touch configure-stamp
47
48
49 build: build-stamp
50 build-stamp: configure-stamp 
51         dh_testdir
52
53         $(MAKE)
54
55         touch $@
56
57 clean:
58         dh_testdir
59         dh_testroot
60         rm -f build-stamp configure-stamp
61
62         -$(MAKE) clean
63
64         phpize5 --clean
65
66         dh_clean
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k 
72         dh_installdirs
73
74         $(MAKE) install INSTALL_ROOT=$(CURDIR)/debian/$(package)
75
76
77 # Build architecture-independent files here.
78 binary-indep: build install
79 # We have nothing to do by default.
80
81 # Build architecture-dependent files here.
82 binary-arch: build install
83         dh_testdir
84         dh_testroot
85         dh_install -X.svn
86         dh_installchangelogs CHANGELOG
87         dh_installdocs TECHNOTES.txt TODO INSTALL
88         dh_installexamples
89         dh_installdebconf       
90         dh_link
91         dh_strip
92         dh_compress
93         dh_fixperms
94         dh_makeshlibs
95         dh_installdeb
96         dh_shlibdeps
97
98 #       php api version we have been building against:
99         grep -v '^php:Depends' debian/${package}.substvars \
100                 > debian/${package}.substvars.$$ && \
101         mv debian/${package}.substvars.$$ debian/${package}.substvars
102         echo "php:Depends=phpapi-$(phpapiver)" >> debian/${package}.substvars
103
104         dh_gencontrol
105         dh_md5sums
106         dh_builddeb
107
108 binary: binary-indep binary-arch
109 .PHONY: build clean binary-indep binary-arch binary install configure