Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F134104
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/debian/control b/debian/control
index d3d62155..f6f04056 100644
--- a/debian/control
+++ b/debian/control
@@ -1,28 +1,29 @@
Source: php-mongodb
Section: php
Priority: optional
Maintainer: Debian PHP PECL Maintainers <pkg-php-pecl@lists.alioth.debian.org>
Uploaders: Ondřej Surý <ondrej@debian.org>
Build-Conflicts: libbson-dev,
libmongoc-dev,
libmongoc-priv-dev
Build-Depends: debhelper (>= 9~),
dh-php (>= 0.7~),
libpcre3-dev,
libsasl2-dev,
php-all-dev,
- pkg-config
+ pkg-config,
+ xml2
Standards-Version: 3.9.8
Homepage: https://pecl.php.net/package/mongodb
Package: php-mongodb
Architecture: any
Depends: ucf,
${misc:Depends},
${php:Depends},
${shlibs:Depends}
Description: MongoDB driver for PHP
The purpose of this driver is to provide exceptionally thin glue
between MongoDB and PHP, implementing only fundemental and
performance-critical components necessary to build a fully-functional
MongoDB driver.
diff --git a/debian/rules b/debian/rules
index e304bdb9..0430c081 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,40 +1,71 @@
#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
+
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
SHELL=/bin/sh -e
-PECL_NAME := $(shell dpkg-parsechangelog -SSource | sed -e s/php-//)
-SOURCE_DIR := $(shell ls -1d $(PECL_NAME)-*)
-INSTALL_ROOT := $(CURDIR)/debian/php-$(PECL_NAME)
+PECL_NAME := $(subst php-,,$(DEB_SOURCE))
+INSTALL_ROOT := $(CURDIR)/debian/$(DEB_SOURCE)
PHP_VERSIONS := $(shell /usr/sbin/phpquery -V)
+# find corresponding package-PHP_MAJOR.PHP_MINOR.xml, package-PHP_MAJOR.xml or package.xml
+$(foreach ver,$(PHP_VERSIONS),$(eval PACKAGE_XML_$(ver) := $(word 1,$(wildcard package-$(ver).xml package-$(basename $(ver)).xml package.xml))))
+# fill DH_PHP_VERSIONS with versions that have corresponding package.xml
+export DH_PHP_VERSIONS := $(foreach ver,$(PHP_VERSIONS),$(if $(PACKAGE_XML_$(ver)),$(ver)))
+# for each ver in $(DH_PHP_VERSIONS), look into each corresponding package.xml for upstream PECL version
+$(foreach ver,$(DH_PHP_VERSIONS),$(eval PECL_SOURCE_$(ver) := $(PECL_NAME)-$(shell xml2 < $(PACKAGE_XML_$(ver)) | sed -ne "s,^/package/version/release=,,p")))
+
+CONFIGURE_TARGETS := $(addprefix configure-,$(addsuffix -stamp,$(DH_PHP_VERSIONS)))
+BUILD_TARGETS := $(addprefix build-,$(addsuffix -stamp,$(DH_PHP_VERSIONS)))
+INSTALL_TARGETS := $(addprefix install-,$(addsuffix -stamp,$(DH_PHP_VERSIONS)))
+CLEAN_TARGETS := $(addprefix clean-,$(addsuffix -stamp,$(DH_PHP_VERSIONS)))
+
%:
- dh $@ --with php --sourcedirectory=$(SOURCE_DIR)
-
-override_dh_auto_configure:
- for v in $(PHP_VERSIONS); do \
- cp -a $(CURDIR)/$(SOURCE_DIR) $(CURDIR)/build-$$v; \
- cd $(CURDIR)/build-$$v; \
- phpize$$v; \
- done
- cd $(SOURCE_DIR) && phpize
- for v in $(PHP_VERSIONS); do \
- dh_auto_configure --builddirectory=$(CURDIR)/build-$$v --sourcedirectory=$(SOURCE_DIR) -- --enable-$(PECL_NAME) --with-php-config=/usr/bin/php-config$$v --without-libbson --without-libmongoc; \
- done
-
-override_dh_auto_build:
- for v in $(PHP_VERSIONS); do \
- dh_auto_build --builddirectory=$(CURDIR)/build-$$v --sourcedirectory=$(SOURCE_DIR); \
- done
-
-override_dh_auto_install:
- for v in $(PHP_VERSIONS); do \
- dh_auto_install --builddirectory=$(CURDIR)/build-$$v --sourcedirectory=$(SOURCE_DIR) -- INSTALL_ROOT=$(INSTALL_ROOT); \
- done
-
-override_dh_auto_clean:
- for v in $(PHP_VERSIONS); do \
- dh_auto_clean --builddirectory=$(CURDIR)/build-$$v --sourcedirectory=$(SOURCE_DIR); \
- rm -rf $(CURDIR)/build-$$v; \
- done
- cd $(SOURCE_DIR) && phpize --clean
+ dh $@ --with php
+
+override_dh_auto_configure: $(CONFIGURE_TARGETS)
+override_dh_auto_build: $(BUILD_TARGETS)
+override_dh_auto_install: $(INSTALL_TARGETS)
+override_dh_auto_clean: $(CLEAN_TARGETS)
+ -rm -f $(CONFIGURE_TARGETS) $(BUILD_TARGETS) $(INSTALL_TARGETS) $(CLEAN_TARGETS)
+
+configure-%-stamp: SOURCE_DIR = build-$(*)
+configure-%-stamp:
+ cp -a $(PECL_SOURCE_$(*)) $(SOURCE_DIR)
+ cd $(SOURCE_DIR) && phpize$(*)
+ dh_auto_configure --sourcedirectory=$(SOURCE_DIR) -- --enable-$(PECL_NAME) --with-php-config=/usr/bin/php-config$*
+ touch configure-$(*)-stamp
+
+build-%-stamp: SOURCE_DIR = build-$(*)
+build-%-stamp:
+ dh_auto_build --sourcedirectory=$(SOURCE_DIR)
+ touch build-$*-stamp
+
+install-%-stamp: SOURCE_DIR = build-$(*)
+install-%-stamp:
+ dh_auto_install --sourcedirectory=$(SOURCE_DIR) -- INSTALL_ROOT=$(INSTALL_ROOT)
+ touch install-$*-stamp
+
+clean-%-stamp: SOURCE_DIR = build-$(*)
+clean-%-stamp:
+ rm -rf $(SOURCE_DIR)
+ touch clean-$*-stamp
+
+override_dh_gencontrol: ,:=,
+override_dh_gencontrol:
+ dh_gencontrol -- "-Vphp:Provides=$(addprefix php,$(addsuffix -$(PECL_NAME)$(,) ,$(DH_PHP_VERSIONS)))"
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:17 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70358
Default Alt Text
(5 KB)
Attached To
Mode
R114 php-mongodb
Attached
Detach File
Event Timeline