Package: src:php5
Version: 5.6.21+dfsg-1

Dear maintainer:

The "php5" binary package is "Architecture: all" and it does not
really contain any file which is generated by compiling C source code.

So, it would make sense if "dpkg-buildpackage -A" generated this
package directly without "building" anything.

Briefly, the attached patch does this:

* The old "build" target is renamed to "build-arch".

* The old "install" target is renamed to "install-arch".

* A new "build-indep" target is created which does nothing
  (because there is really nothing to build).

* A new "install-indep" target is created which just puts
  /usr/share/bug/php5/control in place. This is removed from
  the old install target.

* The /usr/share/bug/php5/script symlink is handled by dh_link
  and "debian/php5.links".


I've checked that "dpkg-buildpackage -A" generates exactly the same
"php5" package as before. I believe "dpkg-buildpackage -B" should also
work, but in either case, I am confindent that it would be easy to
fix if it does not.

In my i3 at home, the patch reduces build time for "dpkg-buildpackage -A"
from 85 minutes to a few seconds.

Thanks.
--- /dev/null
+++ b/debian/php5.links
@@ -0,0 +1 @@
+usr/share/bug/php5-common/script usr/share/bug/php5/script
--- a/debian/rules
+++ b/debian/rules
@@ -212,7 +212,9 @@ else
        echo 'nocheck found in DEB_BUILD_OPTIONS or unsupported architecture' | 
tee test-results.txt
 endif
 
-build: build-apache2-stamp build-apache2filter-stamp build-cgi-stamp 
build-cli-stamp build-phpdbg-stamp build-embed-stamp build-fpm-stamp 
test-results.txt
+build-indep:
+
+build-arch: build-apache2-stamp build-apache2filter-stamp build-cgi-stamp 
build-cli-stamp build-phpdbg-stamp build-embed-stamp build-fpm-stamp 
test-results.txt
 
 build-apache2-stamp: configure-apache2-stamp
        dh_testdir
@@ -500,8 +502,14 @@ clean: unprepared
 
 PCNTL_FUNCTIONS := $(shell < ext/pcntl/php_pcntl.h sed -ne "/^PHP_FUNCTION/ 
s/PHP_FUNCTION(\(.*\));/\1/;t end;d;:end p" | tr '\n' ',')
 
-install: DH_OPTIONS=
-install: build
+install-indep:
+       # Install reportbug for php5 package
+       mkdir -p debian/php5/usr/share/bug/php5
+       install -m644 debian/php5.bug.control 
debian/php5/usr/share/bug/php5/control
+
+install-arch: DH_OPTIONS=-a
+install-arch: install-arch-stamp
+install-arch-stamp: build-arch
        dh_testdir
        dh_testroot
        dh_prep
@@ -533,11 +541,6 @@ ifeq (yes,$(RUN_TESTS))
        cp test-results.txt debian/php5-common/usr/share/doc/php5-common/
 endif
 
-       # Install reportbug for php5 package
-       mkdir -p debian/php5/usr/share/bug/php5
-       install -m644 debian/php5.bug.control 
debian/php5/usr/share/bug/php5/control
-       ln -s ../php5-common/script debian/php5/usr/share/bug/php5/script
-
        # Install helper shell fragment
        install -m644 debian/php5-helper 
$(CURDIR)/debian/php5-common/usr/share/php5/
        install -m644 debian/debhelper/php5-maintscript-helper 
$(CURDIR)/debian/php5-common/usr/share/php5/
@@ -672,12 +675,12 @@ endif
        # directories cleanup:
        -rmdir -p debian/libapache2-mod-php5/usr/share/man/man1
 
-       touch install-stamp
+       touch install-arch-stamp
 
 # Build architecture-independent files here.
 # Pass -i to all debhelper commands in this target to reduce clutter.
 binary-indep: DH_OPTIONS=-i
-binary-indep: build install
+binary-indep: install-indep
        # Need this version of debhelper for DH_OPTIONS to work.
        dh_testdir
        dh_testroot
@@ -698,7 +701,8 @@ binary-indep: build install
        dh_builddeb
 
 # Build architecture-dependent files here.
-binary-arch: build install
+binary-arch: DH_OPTIONS=-a
+binary-arch: build-arch install-arch
        # Need this version of debhelper for DH_OPTIONS to work.
        dh_testdir
        dh_testroot
@@ -855,7 +859,5 @@ binary-arch: build install
        dh_builddeb -s
 
 binary: binary-arch binary-indep
-build-arch: build
-build-indep: build
 
 .PHONY: build build-arch build-indep clean binary-indep binary-arch binary 
install configure

Reply via email to