File: rules

package info (click to toggle)
php-sasl 0.1.0-1.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 108 kB
  • sloc: ansic: 518; makefile: 89; xml: 42
file content (144 lines) | stat: -rwxr-xr-x 4,136 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
#!/usr/bin/make -f

# 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

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_MULTIARCH

TAR=tar
PECL_PKG_NAME=sasl
PECL_PKG_REALNAME=sasl
PECL_PKG_VERSION=0.1.0
PACKAGE_NAME=php-sasl
BIN_PACKAGE_NAME=php$*-sasl
PHPIZE=/usr/bin/phpize
PHPCONFIG=/usr/bin/php-config
EXT_DIR=$(shell $(PHPCONFIG)$* --extension-dir)
SOURCE_DIR=$(shell ls -d $(PECL_PKG_REALNAME)-*)
BINARYTARGETS=binary-arch-v5
BUILDTARGETS=build-v5
CLEANTARGETS=clean-v5

# Sarge doesn't support --phpapi option (Bug #365667)
phpapiver4=$(shell /usr/bin/php-config4 --phpapi)
#phpapiver4=$(/usr/bin/php-config4 --extension-dir | xargs basename)
phpapiver5=$(shell /usr/bin/php-config5 --phpapi)

configure-v4 configure-v5: configure-v%: configure-stamp-v%
configure-stamp-v4 configure-stamp-v5: configure-stamp-v%:
	dh_testdir
	# Add here commands to configure the package
	(cd $(SOURCE_DIR); \
	$(PHPIZE)$*; \
	./configure --with-php-config=$(PHPCONFIG)$* --prefix=/usr)
	#rm -f configure-stamp-v*
	touch $@

build: $(BUILDTARGETS)

build-v4 build-v5: build-v%: build-stamp-v%

build-stamp:
	#xsltproc --nonet --novalid debian/changelog.xsl package.xml > debian/Changelog
	$(shell /usr/share/dh-make-php/phppkginfo . changelog > debian/Changelog)
	touch build-stamp

build-stamp-v4 build-stamp-v5: build-stamp-v%: build-stamp configure-stamp-v%
	dh_testdir

	# Add here commands to compile the package
	(cd $(SOURCE_DIR); $(MAKE); mkdir -p ../tmp/modules$*; cp modules/* ../tmp/modules$*; $(MAKE) clean)
	#rm -f build-stamp-v*
	touch $@

clean: $(CLEANTARGETS)
	dh_clean debian/Changelog

clean-v4 clean-v5: clean-v%:
	dh_testdir
	dh_testroot
	rm -f build-stamp* configure-stamp*

	# Add here commands to clean up after the build process
	(cd $(SOURCE_DIR); \
	$(MAKE) clean; \
	$(PHPIZE)$* --clean)
	rm -rf tmp/modules$*

install-v4 install-v5: install-v%: build-v%
	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
	#dh_pecl

	# Add here commands to install the package into debian/$(PACKAGE_NAME).
	#$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(PACKAGE_NAME) install
	#sh -c 'VERSION=`egrep "#define ZEND_MODULE_API_NO" \
	#	/usr/include/php4/Zend/zend_modules.h \
	#	| sed "s/#define ZEND_MODULE_API_NO //"`; \
	#	chmod 644 debian/$(PACKAGE_NAME)/usr/lib/php4/$$VERSION/*.so'
	mkdir -p debian/$(BIN_PACKAGE_NAME)/$(EXT_DIR)
	install -m 644 -o root -g root tmp/modules$*/$(PECL_PKG_NAME).so debian/$(BIN_PACKAGE_NAME)/$(EXT_DIR)/$(PECL_PKG_NAME).so
	if [ -f "debian/$(PECL_PKG_NAME).ini" ]; then \
		mkdir -p debian/$(BIN_PACKAGE_NAME)/etc/php$*/conf.d; \
		cp debian/$(PECL_PKG_NAME).ini debian/$(BIN_PACKAGE_NAME)/etc/php$*/conf.d; \
	fi

# Build architecture-independent files here
binary-indep:
	# We have nothing to do by default

# Build architecture-dependent files here
binary-arch-v4 binary-arch-v5: binary-arch-v%: install-v%
	echo "php:Depends=phpapi-$(phpapiver$*)" >> debian/$(BIN_PACKAGE_NAME).substvars

binary-arch: $(BINARYTARGETS)
	dh_testdir
	dh_testroot
	dh_installchangelogs debian/Changelog
	dh_installdocs
	dh_installexamples
	#dh_install --sourcedir=debian/$(BIN_PACKAGE_NAME)
	#dh_installmenu
	dh_installdebconf
	#dh_installlogrotate
	#dh_installemacsen
	#dh_installpam
	#dh_installmime
	#dh_installinit
	#dh_installcron
	#dh_installinfo
	#dh_installman
	#dh_link
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip
endif
	dh_compress
	dh_fixperms
	#dh_perl
	#dh_python
	#dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build build-v4 build-v5 clean clean-v4 clean-v5 binary-indep binary-arch binary-arch-v4 binary-arch-v5 binary install-v4 install-v5 configure-v4 configure-v5