File: rules

package info (click to toggle)
php-apc 3.1.13-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,208 kB
  • sloc: ansic: 10,815; php: 1,023; xml: 981; makefile: 75; sh: 44; pascal: 32
file content (105 lines) | stat: -rwxr-xr-x 2,747 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
#!/usr/bin/make -f
# template debian/rules provided by dh-make-php.
# GNU copyright 2005 by Uwe Steinmann.
# modified for php-apc by Pietro Ferrari

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

CFLAGS = -O2 -Wall
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
	DEBUG := --enable-debug
else
	DEBUG := --disable-debug
endif

PECL_PKG_NAME=apc
PECL_PKG_REALNAME=APC
PACKAGE_NAME=php-apc
PHPIZE=/usr/bin/phpize
PHPCONFIG=/usr/bin/php-config
EXT_DIR=$(shell $(PHPCONFIG) --extension-dir)
SOURCE_DIR=$(shell echo $(PECL_PKG_REALNAME)-*)

phpapiver=$(shell $(PHPCONFIG) --phpapi)

configure: configure-stamp

configure-stamp:
	dh_testdir
	(cd $(SOURCE_DIR); \
	$(PHPIZE); \
	./configure --with-php-config=$(PHPCONFIG) --prefix=/usr \
	--enable-apc --enable-apc-mmap )
	touch $@

build-arch: build

build-indep: build

build: build-stamp

build-stamp: configure
	dh_testdir
	(cd $(SOURCE_DIR); $(MAKE); mkdir -p ../tmp/modules; cp -p modules/* ../tmp/modules;)
	touch build-stamp

clean:
	dh_clean
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -rf tmp
	rm -rf debian/$(PACKAGE_NAME)
	(cd $(SOURCE_DIR); \
	$(MAKE) clean; \
	$(PHPIZE) --clean)

install: build
	dh_testdir
	dh_testroot
	# can't dh_clean here without specifically excluding the possibly existing installed dirs
	# for other version.
	#dh_clean -k
	dh_installdirs
	mkdir -p debian/$(PACKAGE_NAME)/$(EXT_DIR)
	install -m 644 -o root -g root tmp/modules/$(PECL_PKG_NAME).so debian/$(PACKAGE_NAME)/$(EXT_DIR)/$(PECL_PKG_NAME).so
	if [ -f "debian/$(PECL_PKG_NAME).ini" ]; then \
		mkdir -p debian/$(PACKAGE_NAME)/etc/php5/mods-available/; \
		cp debian/$(PECL_PKG_NAME).ini debian/$(PACKAGE_NAME)/etc/php5/mods-available/; \
	fi
	# copy the apc.php script to /usr/share/doc/php-apc
	# this script provides some statistics about php-apc use.
	if [ -f "$(SOURCE_DIR)/apc.php" ]; then \
		mkdir -p debian/$(PACKAGE_NAME)/usr/share/doc/$(PACKAGE_NAME); \
		cp $(SOURCE_DIR)/apc.php debian/$(PACKAGE_NAME)/usr/share/doc/$(PACKAGE_NAME); \
	fi

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

# Build architecture-dependent files here.
binary-arch: install
	echo "php:Depends=phpapi-$(phpapiver)" >> debian/$(PACKAGE_NAME).substvars
	dh_testdir
	dh_testroot
	dh_installdocs $(SOURCE_DIR)/TODO
	dh_installchangelogs $(SOURCE_DIR)/CHANGELOG
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip
endif
	dh_compress -Xapc.php
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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