Package: php5
Version: 5.3.8.0-1
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd

Hi,

currently, php5 cannot be compiled on GNU/Hurd.

There are two problems, solved by the attached patches:
- debian.diff:
  there's no firebird compiled on Hurd, so exclude the firebird stuff
  on Hurd; the architecture for php5-interbase has to be restricted
  this way, as you cannot use negative archs (eg "!hurd-any") there
- hurd-noptrace.diff:
  it looks like Hurd's ptrace system is broken, so the ptrace() test
  indefinitely hangs; hence, let it fail straight away
  (I'm not sure this is nice for upstream, but can work in Debian for
  now)

Both the patches should also apply to the php5 version in experimental.

Thanks,
-- 
Pino
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@
 	       bison,
 	       chrpath,
 	       debhelper (>= 5),
-	       firebird2.5-dev | firebird2.1-dev,
+	       firebird2.5-dev [!hurd-any] | firebird2.1-dev [!hurd-any],
 	       flex,
 	       freetds-dev,
 	       hardening-wrapper,
@@ -317,7 +317,7 @@
  with the Suhosin patch.
 
 Package: php5-interbase
-Architecture: any
+Architecture: linux-any kfreebsd-any
 Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php5-common (= ${binary:Version})
 Description: interbase/firebird module for php5
  This package provides a module for interbase/firebird functions in PHP scripts.
--- a/debian/rules
+++ b/debian/rules
@@ -19,6 +19,7 @@
 DEB_HOST_GNU_TYPE    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_ARCH   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_ARCH_OS     ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 
 PHP5_SOURCE_VERSION   = $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
 PHP5_UPSTREAM_VERSION = $(shell echo $(PHP5_SOURCE_VERSION) | sed -e "s/-.*//" -e "s/.*://")
@@ -59,6 +60,10 @@
   CFLAGS += -gstabs
 endif
 
+ifneq ($(DEB_HOST_ARCH_OS),hurd)
+  CONFIGURE_APACHE_ARGS = --with-interbase=shared,/usr --with-pdo-firebird=shared,/usr
+endif
+
 # some other helpful (for readability at least) shorthand variables
 PHPIZE_BUILDDIR = debian/php5-dev/usr/lib/php5/build
 
@@ -267,8 +272,6 @@
 		--with-freetype-dir=shared,/usr \
 		--with-imap=shared,/usr \
 		--with-imap-ssl \
-		--with-interbase=shared,/usr \
-		--with-pdo-firebird=shared,/usr \
 		--enable-intl=shared \
 		--with-ttf=shared,/usr \
 		--with-t1lib=shared,/usr \
@@ -294,7 +297,8 @@
 		--with-pdo-odbc=shared,unixODBC,/usr \
 		--with-pdo-pgsql=shared,/usr/bin/pg_config \
 		--with-pdo-sqlite=shared,/usr \
-		--with-pdo-dblib=shared,/usr
+		--with-pdo-dblib=shared,/usr \
+		$(CONFIGURE_APACHE_ARGS)
 	cd apache2-build && \
 	cp ../Zend/zend_ini_scanner.c ../Zend/zend_language_scanner.c \
 	   ../Zend/zend_ini_parser.h ../Zend/zend_language_parser.h \
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -146,6 +146,11 @@
         pid_t child;
         int status;
 
+        /* broken ptrace on Hurd, avoid hanging */
+        #ifdef __GNU__
+        return 10;
+        #endif
+
         if ( (child = fork()) ) { /* parent */
           int ret = 0;
 

Reply via email to