File: rules

package info (click to toggle)
php-memcache 3.0.4-4%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 132 kB
  • ctags: 4
  • sloc: sh: 38; makefile: 29
file content (47 lines) | stat: -rwxr-xr-x 1,577 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
#!/usr/bin/make -f

DEB_TAR_SRCDIR := $(shell basename $(wildcard *.tgz) .tgz)

include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

PHP_EX5=$(shell /usr/bin/php-config5 --extension-dir)

DEB_INSTALL_EXAMPLES_php5-memcache = $(DEB_SRCDIR)/example.php

#
# local hacks
#

patch: apply-patches

clean::
	rm -f php[5]-memcache.postrm php[5]-memcache.postinst
	rm -f *cdbs*
	rm -rf build-tree

configure_for_php%:
	cd $(DEB_SRCDIR) && phpize --clean && phpize && \
	    ./configure --with-memcache --with-php-config=/usr/bin/php-config$*
	sed -e 's/phpX/php$*/g' < debian/phpX-memcache.postinst > debian/php$*-memcache.postinst
	sed -e 's/phpX/php$*/g' < debian/phpX-memcache.postrm   > debian/php$*-memcache.postrm

#
# cdbs things
#

define install_rule
	chmod a-x $(DEB_SRCDIR)/example.php
	$(MAKE) -C $(DEB_SRCDIR)
	mkdir -p debian/php$1-memcache$(PHP_EX$1)
	install -m 644 -o root -g root $(DEB_SRCDIR)/modules/memcache.so debian/php$1-memcache$(PHP_EX$1)/memcache.so
	mkdir -p debian/php$1-memcache/usr/share/lintian/overrides
	echo "php5-memcache: no-shlibs-control-file $(PHP_EX$1)/memcache.so" > debian/php$1-memcache/usr/share/lintian/overrides/php$1-memcache
	echo "php$1:Depends=phpapi-`php-config$1 --phpapi`, php$1-common" >> debian/php$1-memcache.substvars
	mkdir -p debian/php$1-memcache/usr/share/php$1-memcache/
	cp debian/memcache.ini  debian/php$1-memcache/usr/share/php$1-memcache/memcache.ini-dist
endef

install/php5-memcache:: configure_for_php5
	$(call install_rule,5)