Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Nov 2003 16:12:23 +0100 (CET)
From:      Alex Dupre <sysadmin@alexdupre.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        nork@FreeBSD.org
Subject:    ports/59418: [Maintainer Update] Port: PHP 4 (handling dependencies)
Message-ID:  <200311181512.hAIFCNmK098716@armada.alexdupre.com>
Resent-Message-ID: <200311181520.hAIFKGRQ032832@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59418
>Category:       ports
>Synopsis:       [Maintainer Update] Port: PHP 4 (handling dependencies)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 18 07:20:15 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alex Dupre
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD armada.alexdupre.com 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Thu Nov 13 00:04:58 CET 2003 alex@armada.alexdupre.com:/usr/obj/usr/src/sys/ARMADA i386


	
>Description:
A completely new bsd.php.mk file for checking and selecting dependencies
on various php ports. The system is backward compatible and adds the
WANT_PHP_PEAR knob and support for PHP5 (lang/php5 will be updated in a
next PR). It works much better and is more flexible (a future addition will
be support for Apache 2 compiled with threads).
This is the last step before moving the bsd.php.mk file into /usr/ports/Mk
with the addition of USE_PHP={yes,4,5} global knob.

While I'm here, remove the DEBUG option from the extension list and change the
postgresql dependency.
	
>How-To-Repeat:
	
>Fix:

	

--- php4.diff begins here ---
diff -ruN php4.orig/Makefile php4/Makefile
--- php4.orig/Makefile	Tue Nov 18 11:32:52 2003
+++ php4/Makefile	Tue Nov 18 15:50:44 2003
@@ -21,7 +21,7 @@
 
 PORTNAME=	php4
 PORTVERSION=	4.3.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES?=	lang devel www
 MASTER_SITES=	http://www.php.net/distributions/:release \
 		http://it.php.net/distributions/:release \
@@ -87,6 +87,11 @@
 EXT_DIR=	20020429
 SAPI_FILE=	"@comment "
 
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+=--enable-debug
+EXT_DIR:=	${EXT_DIR}-debug
+.endif
+
 CONFLICTS=	php4-cli-4* mod_php4-4* php4-cgi-4*
 .if defined(WITHOUT_APACHE)
 .if defined(WITHOUT_CLI)
@@ -125,7 +130,7 @@
 .endif
 
 ALL_OPTIONS=	BCMATH BZIP2 CALENDAR CDB CRACK CTYPE CURL DB4 DBASE DBX \
-		DEBUG DOMXML DOMXSLT EXIF FILEPRO FRIBIDI FTP GD GDBM GETTEXT \
+		DOMXML DOMXSLT EXIF FILEPRO FRIBIDI FTP GD GDBM GETTEXT \
 		GMP HYPERWAVE ICONV IMAP INTERBASE INIFILE MBSTRING MCAL MCVE \
 		MCRYPT MHASH MIME MING MNOGOSEARCH MYSQL NCURSES OPENLDAP \
 		OPENSSL ORACLE OVERLOAD PCNTL PCRE PDFLIB POSIX POSTGRESQL \
@@ -251,11 +256,6 @@
 CONFIGURE_ARGS+=--enable-dbx
 .endif
 
-.if defined(WITH_DEBUG)
-CONFIGURE_ARGS+=--enable-debug
-EXT_DIR:=${EXT_DIR}-debug
-.endif
-
 .if defined(WITH_DOMXML)
 LIB_DEPENDS+=	xml2.5:${PORTSDIR}/textproc/libxml2
 CONFIGURE_ARGS+=--with-dom=${LOCALBASE}
@@ -427,7 +427,7 @@
 .endif
 
 .if defined(WITH_POSTGRESQL)
-LIB_DEPENDS+=	pq.3:${PORTSDIR}/databases/postgresql7
+LIB_DEPENDS+=	pq.3:${PORTSDIR}/databases/postgresql7-client
 CONFIGURE_ARGS+=--with-pgsql=${LOCALBASE}
 .endif
 
@@ -626,13 +626,37 @@
 	@${ECHO_CMD} ""
 .endif
 
-.if !defined(WITHOUT_CLI)
 post-build:
+	@${ECHO_CMD} "PHP_VER=4" > ${WRKDIR}/php.conf
+	@${ECHO_CMD} "PHP_VERSION=${PORTVERSION}" >> ${WRKDIR}/php.conf
+	@${ECHO_CMD} "PHP_EXT_DIR=${EXT_DIR}" >> ${WRKDIR}/php.conf
+	@${ECHO_CMD} "PHP_PORT=${.CURDIR}" >> ${WRKDIR}/php.conf
+.if !defined(WITHOUT_CLI) && !defined(WITHOUT_PEAR)
+	@${ECHO_CMD} "PHP_PEAR=yes" >> ${WRKDIR}/php.conf
+.else
+	@${ECHO_CMD} "PHP_PEAR=no" >> ${WRKDIR}/php.conf
+.endif
+.if !defined(WITHOUT_APACHE) && !defined(WITHOUT_CLI)
+	@${ECHO_CMD} "PHP_SAPI=full" >> ${WRKDIR}/php.conf
+.else
+.if defined(WITHOUT_APACHE) && !defined(WITHOUT_CLI)
+	@${ECHO_CMD} "PHP_SAPI=cli" >> ${WRKDIR}/php.conf
+.endif
+.if !defined(WITHOUT_APACHE) && defined(WITHOUT_CLI)
+	@${ECHO_CMD} "PHP_SAPI=mod" >> ${WRKDIR}/php.conf
+.endif
+.if defined(WITHOUT_APACHE) && defined(WITHOUT_CLI)
+	@${ECHO_CMD} "PHP_SAPI=cgi" >> ${WRKDIR}/php.conf
+.endif
+.endif
+.if !defined(WITHOUT_CLI)
 	@${ECHO_CMD} "You may run the tests from the PHP test framework, typing 'make test' now."
 	@${ECHO_CMD} "(It is safe to ignore errors about timestamp-related tests,"
 	@${ECHO_CMD} "since they are due to the different FreeBSD mktime() implementation)."
 	@${ECHO_CMD} ""
+.endif
 
+.if !defined(WITHOUT_CLI)
 test: all
 	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
 		${MAKEFILE} ${MAKE_ARGS} ${.TARGET})
@@ -644,6 +668,7 @@
 .endif
 	@${INSTALL_DATA} ${WRKSRC}/php.ini-dist ${PREFIX}/etc
 	@${INSTALL_DATA} ${WRKSRC}/php.ini-recommended ${PREFIX}/etc
+	@${INSTALL_DATA} ${WRKDIR}/php.conf ${PREFIX}/etc
 	@${TOUCH} ${PREFIX}/lib/php/${EXT_DIR}/.php
 .if !defined(WITHOUT_APACHE)
 	@${ECHO_CMD} "*****************************************************************************"
diff -ruN php4.orig/bsd.php.mk php4/bsd.php.mk
--- php4.orig/bsd.php.mk	Tue Nov 18 11:32:52 2003
+++ php4/bsd.php.mk	Tue Nov 18 15:49:39 2003
@@ -2,90 +2,128 @@
 #
 # The user/port can now set this options in the makefiles.
 #
-# USE_PHPIZE=yes   - Use to build a php extension.
-# WANT_PHP_CLI=yes - Want the CLI version of PHP.
-# WANT_PHP_CGI=yes - Want the CGI version of PHP.
-# WANT_PHP_MOD=yes - Want the Apache Module for PHP.
-# WANT_PHP_WEB=yes - Want the Apache Module or the CGI version of PHP.
+# USE_PHPIZE=yes    - Use to build a PHP extension.
+# WANT_PHP_CLI=yes  - Want the CLI version of PHP.
+# WANT_PHP_CGI=yes  - Want the CGI version of PHP.
+# WANT_PHP_MOD=yes  - Want the Apache Module for PHP.
+# WANT_PHP_WEB=yes  - Want the Apache Module or the CGI version of PHP.
+# WANT_PHP_PEAR=yes - Want the PEAR framework.
 #
 # You may combine multiple WANT_PHP_* knobs.
 # Don't specify any WANT_PHP_* knob if your port will work with every PHP SAPI.
 #
 
-.if exists(${LOCALBASE}/bin/php) && exists(${LOCALBASE}/bin/pear)
-HAVE_PHP_CLI=	yes
-HAVE_PHP=	yes
-PHP_PORT=	${PORTSDIR}/lang/php4-cli
-.endif
-.if exists(${LOCALBASE}/bin/php) && !exists(${LOCALBASE}/bin/pear)
-HAVE_PHP_CGI=	yes
-HAVE_PHP=	yes
-PHP_PORT=	${PORTSDIR}/www/php4-cgi
-.endif
-.if exists(${LOCALBASE}/libexec/apache/libphp4.so) || exists(${LOCALBASE}/libexec/apache2/libphp4.so)
-HAVE_PHP_MOD=	yes
-HAVE_PHP=	yes
-PHP_PORT=	${PORTSDIR}/www/mod_php4
-.endif
-.if defined(HAVE_PHP_CLI) && defined(HAVE_PHP_MOD)
-PHP_PORT=	${PORTSDIR}/lang/php4
-.endif
-
-.if defined(WANT_PHP_CGI) && (defined(WANT_PHP_CLI) || defined(WANT_PHP_MOD))
-.BEGIN:
-	@${ECHO_CMD} "The CGI version of PHP avoids the installation of other SAPIs."
-	@${ECHO_CMD} "Do not use WANT_PHP_CGI with other WANT_PHP_* knobs."
-	@${FALSE}
+.if exists(${LOCALBASE}/etc/php.conf)
+.include "${LOCALBASE}/etc/php.conf"
 .endif
 
-.if defined(WANT_PHP_CLI) && !defined(WANT_PHP_MOD)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CLI)
-.BEGIN:
-	@${ECHO_CMD} "This port requires the CLI version of PHP, but you have already"
-	@${ECHO_CMD} "installed a conflicting PHP port without CLI."
-	@${FALSE}
+PHP_VER?=	4
+.if !defined(WITH_DEBUG)
+PHP_EXT_DIR?=	20020429
 .else
-PHP_PORT?=	${PORTSDIR}/lang/php4-cli
+PHP_EXT_DIR?=	20020429-debug
 .endif
+.if !defined(WITHOUT_PEAR)
+PHP_PEAR?=	yes
+.else
+PHP_PEAR?=	no
+.endif
+PHP_SAPI?=	""
+
+.if defined(BROKEN_WITH_PHP)
+.       for VER in ${BROKEN_WITH_PHP}
+.               if (${PHP_VER} == "${VER}")
+BROKEN=         "Doesn't work with PHP version : ${PHP_VER} (Doesn't support PHP ${BROKEN_WITH_PHP})"
+.               endif
+.       endfor
 .endif
 
 .if defined(WANT_PHP_WEB)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CGI) && !defined(HAVE_PHP_MOD)
+.	if defined(WANT_PHP_CGI) || defined(WANT_PHP_MOD)
+.BEGIN:
+		@${ECHO_CMD} "If you define WANT_PHP_WEB you cannot set also WANT_PHP_CGI"
+		@${ECHO_CMD} "or WANT_PHP_MOD. Use only one of them."
+		@${FALSE}
+.	else
+.	if defined(PHP_VERSION) && ${PHP_SAPI} == "cli"
 .BEGIN:
-        @${ECHO_CMD} "This port requires the Apache Module or the CGI version of PHP, but you have"
-        @${ECHO_CMD} "already installed a conflicting PHP port without them."
-        @${FALSE}
+		@${ECHO_CMD} "This port requires the Apache Module or the CGI version of PHP, but you have"
+		@${ECHO_CMD} "already installed a conflicting PHP port without them."
+		@${FALSE}
+.	else
+.	if defined(WANT_PHP_CLI) || defined(WANT_PHP_PEAR)
+PHP_PORT?=	${PORTSDIR}/lang/php${PHP_VER}
+.	else
+PHP_PORT?=	${PORTSDIR}/www/mod_php${PHP_VER}
+PHP_PEAR?=	no
+.	endif
+.	endif
+.	endif
 .else
-PHP_PORT?=	${PORTSDIR}/www/mod_php4
-.endif
-.endif
 
 .if defined(WANT_PHP_CGI)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_CGI)
+.	if defined(WANT_PHP_CLI) || defined(WANT_PHP_MOD)
+.BEGIN:
+		@${ECHO_CMD} "The CGI version of PHP avoids the installation of other SAPIs."
+		@${ECHO_CMD} "Do not use WANT_PHP_CGI with other WANT_PHP_* knobs."
+		@${FALSE}
+.	else
+.	if defined(PHP_VERSION) && ${PHP_SAPI} != "cgi"
 .BEGIN:
-	@${ECHO_CMD} "This port requires the CGI version of PHP, but you have already"
-	@${ECHO_CMD} "installed a conflicting PHP port without CGI."
-	@${FALSE}
+		@${ECHO_CMD} "This port requires the CGI version of PHP, but you have already"
+		@${ECHO_CMD} "installed a conflicting PHP port without CGI."
+		@${FALSE}
+.	else
+PHP_PORT?=	${PORTSDIR}/www/php${PHP_VER}-cgi
+PHP_PEAR?=	no
+.	endif
+.	endif
+.else
+
+.if defined(WANT_PHP_CLI) && !defined(WANT_PHP_MOD)
+.	if defined(PHP_VERSION) && ${PHP_SAPI} != "full" && ${PHP_SAPI} != "cli"
+.BEGIN:
+		@${ECHO_CMD} "This port requires the CLI version of PHP, but you have already"
+		@${ECHO_CMD} "installed a conflicting PHP port without CLI."
+		@${FALSE}
+.	else
+PHP_PORT?=	${PORTSDIR}/lang/php${PHP_VER}-cli
+.	endif
 .else
-PHP_PORT?=	${PORTSDIR}/www/php4-cgi
-.endif
-.endif
 
-.if defined(WANT_PHP_MOD) && !defined(WANT_PHP_CLI)
-.if defined(HAVE_PHP) && !defined(HAVE_PHP_MOD)
+.if !defined(WANT_PHP_CLI) && defined(WANT_PHP_MOD)
+.	if defined(PHP_VERSION) && (${PHP_SAPI} != "full" && ${PHP_SAPI} != "mod")
 .BEGIN:
-	@${ECHO_CMD} "This port requires the Apache Module for PHP, but you have already"
-	@${ECHO_CMD} "installed a conflicting PHP port without the Apache Module."
-	@${FALSE}
+		@${ECHO_CMD} "This port requires the Apache Module for PHP, but you have already"
+		@${ECHO_CMD} "installed a conflicting PHP port without the Apache Module."
+		@${FALSE}
+.	else
+.	if defined(WANT_PHP_PEAR)
+PHP_PORT?=	${PORTSDIR}/lang/php${PHP_VER}
+.	else
+PHP_PORT?=	${PORTSDIR}/www/mod_php${PHP_VER}
+PHP_PEAR?=	no
+.	endif
+.	endif
 .else
-PHP_PORT?=	${PORTSDIR}/www/mod_php4
+
+PHP_PORT?=	${PORTSDIR}/lang/php${PHP_VER}
+
 .endif
+
+.endif
+
+.endif
+
+.endif
+
+.if defined(WANT_PHP_PEAR) && ${PHP_PEAR} == "no"
+BROKEN=	"This port requires the PEAR framework, but you have already" \
+	"installed a PHP port without PEAR"
 .endif
 
-PHP_PORT?=	${PORTSDIR}/lang/php4
 RUN_DEPENDS+=	${LOCALBASE}/include/php/main/php.h:${PHP_PORT}
 
-PHP_EXT_DIR?=	20020429
 PLIST_SUB+=	PHP_EXT_DIR=${PHP_EXT_DIR}
 
 .if defined(USE_PHPIZE)
diff -ruN php4.orig/pkg-plist php4/pkg-plist
--- php4.orig/pkg-plist	Tue Nov 18 11:32:52 2003
+++ php4/pkg-plist	Tue Nov 18 11:54:43 2003
@@ -3,6 +3,7 @@
 bin/php-config
 bin/phpextdist
 bin/phpize
+etc/php.conf
 etc/php.ini-dist
 etc/php.ini-recommended
 include/php/TSRM/TSRM.h
diff -ruN php4.orig/scripts/configure.php php4/scripts/configure.php
--- php4.orig/scripts/configure.php	Tue Nov 18 11:32:52 2003
+++ php4/scripts/configure.php	Tue Nov 18 11:34:54 2003
@@ -28,7 +28,6 @@
 DB4		"Berkeley DB4 support" ${WITH_DB4:-OFF} \
 DBASE		"dBase library support" ${WITH_DBASE:-OFF} \
 DBX		"dbx support" ${WITH_DBX:-OFF} \
-DEBUG		"debug support" ${WITH_DEBUG:-OFF} \
 DOMXML		"DOM support" ${WITH_DOMXML:-OFF} \
 DOMXSLT		"DOM XSLT and EXSLT support (implies DOMXML)" ${WITH_DOMXSLT:-OFF} \
 EXIF		"EXIF support" ${WITH_EXIF:-OFF} \
diff -ruN php4.orig/scripts/php4_options php4/scripts/php4_options
--- php4.orig/scripts/php4_options	Tue Nov 18 11:32:52 2003
+++ php4/scripts/php4_options	Tue Nov 18 11:35:01 2003
@@ -8,7 +8,6 @@
 WITH_DB4=OFF
 WITH_DBASE=OFF
 WITH_DBX=OFF
-WITH_DEBUG=OFF
 WITH_DOMXML=OFF
 WITH_DOMXSLT=OFF
 WITH_EXIF=OFF
--- php4.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311181512.hAIFCNmK098716>