Fix the mod_php3 port dependency issues

Peter Pentchev roam at ringlet.net
Sun Feb 6 10:11:08 PST 2005


'Lo there,

Attached is a patch that fixes the various dependency issues of the
www/mod_php3 port.  The only exception is mcrypt support, and I'll get
it working in the next day or so.

With this patch, and with the BROKEN part commented out by hand, the
port gets at least as far as compilation, installation, loading in
Apache, and executing phpinfo(), with a maximum of options enabled.
This means four cases:
- sybasedb, !sybasect, !interbase, !mcrypt
- !sybasedb, sybasect, interbase, !mcrypt
- !sybasedb, !sybasect, interbase, !mcrypt
(all the rest are turned on)

As mentioned above, I'll probably get mcrypt running RSN.  The
sybasedb/interbase conflict seems to stem from both of them redefining a
couple of C types, which I don't think the mod_php3 port can work around
by itself.

The funny part is that I could not see any dependencies on MySQL 3.x;
what exactly is the BROKEN comment referring to?  Or is it something
that had been fixed in the meantime, or something that I am simply not
seeing since I have a DEFAULT_MYSQL_VER?=40 setting in /etc/make.conf?

If there are no objections, I could commit this (possibly leaving the
BROKEN comment intact until the situation is cleared up), and maybe even
take over maintainership of www/mod_php3 and lang/php3, since I have
something of a vested interest in keeping mod_php3 running for a couple
more months at least :)

G'luck,
Peter

-- 
Peter Pentchev	roam at ringlet.net    roam at cnsys.bg    roam at FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Do you think anybody has ever had *precisely this thought* before?
-------------- next part --------------
Index: ports/www/mod_php3/Makefile
===================================================================
RCS file: /home/ncvs/ports/www/mod_php3/Makefile,v
retrieving revision 1.145
diff -u -r1.145 Makefile
--- ports/www/mod_php3/Makefile	22 Dec 2004 02:19:21 -0000	1.145
+++ ports/www/mod_php3/Makefile	6 Feb 2005 18:10:09 -0000
@@ -32,6 +32,7 @@
 
 SLAVEDIRS=	lang/php3
 
+USE_REINPLACE=	yes
 USE_SUBMAKE=	yes
 GNU_CONFIGURE=	yes
 
@@ -72,6 +73,10 @@
 pre-fetch:
 	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.php
 
+post-patch:
+	${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -e 's/malloc\.h/stdlib.h/'
+	${REINPLACE_CMD} -e 's/-lsnmp/-lnetsnmp/' ${WRKSRC}/configure
+
 post-install:
 .if !defined(STANDALONE)
 	@${INSTALL_DATA} ${WRKSRC}/php3.ini-dist ${PREFIX}/etc
@@ -102,6 +107,10 @@
 .include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
 .endif
 
+.if !empty(LIB_DEPENDS:Mgds.*) && !empty(LIB_DEPENDS:Msybdb.*)
+BROKEN=		Conflicts between the Interbase and SybaseDB drivers
+.endif
+
 # XXX:
 # Has to be kept in sync with the defaults in configure.php
 .ifndef(WITHOUT_MYSQL)
Index: ports/www/mod_php3/files/patch-functions::ldap.c
===================================================================
RCS file: ports/www/mod_php3/files/patch-functions::ldap.c
diff -N ports/www/mod_php3/files/patch-functions::ldap.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/www/mod_php3/files/patch-functions::ldap.c	6 Feb 2005 17:18:15 -0000
@@ -0,0 +1,110 @@
+--- functions/ldap.c.orig	Sun Feb  6 19:17:23 2005
++++ functions/ldap.c	Sun Feb  6 19:17:29 2005
+@@ -400,12 +400,18 @@
+ 
+ 	if (ldap_bind_s(ldap, ldap_bind_rdn, ldap_bind_pw, LDAP_AUTH_SIMPLE) != LDAP_SUCCESS) {
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++		int ldaperror;
++		ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ldaperror);
++		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldaperror));
++#else
+ # if LDAP_API_VERSION > 2000
+ 		/* New versions of OpenLDAP do it this way */
+ 		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ # else
+ 		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap->ld_errno));
+ # endif
++# endif
+ #else
+ 		php3_error(E_WARNING,"LDAP:  Unable to bind to server: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #endif
+@@ -431,11 +437,19 @@
+ 	if (ldap == NULL) RETURN_LONG(0);
+ 
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++	{
++		int ldaperror;
++		ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ldaperror);
++		RETURN_LONG(ldaperror);
++	}
++#else
+ # if LDAP_API_VERSION > 2000
+    RETURN_LONG(ldap_get_lderrno(ldap, NULL, NULL));
+ # else
+    RETURN_LONG(ldap->ld_errno);
+ # endif
++# endif
+ #else
+    RETURN_LONG(ldap_get_lderrno(ldap, NULL, NULL));
+ #endif
+@@ -459,11 +473,15 @@
+ 	if (ldap == NULL) RETURN_FALSE;
+ 
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++	ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ld_errno);
++#else
+ # if LDAP_API_VERSION > 2000
+ 	ld_errno = ldap_get_lderrno(ldap, NULL, NULL);
+ # else
+ 	ld_errno = ldap->ld_errno;
+ # endif
++# endif
+ #else
+ 	ld_errno = ldap_get_lderrno(ldap, NULL, NULL);
+ #endif
+@@ -601,11 +619,17 @@
+ 
+ 	if (ldap_search_s(ldap, ldap_base_dn, scope, ldap_filter, ldap_attrs, attrsonly, &ldap_result) != LDAP_SUCCESS) {
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++		int ldaperror;
++		ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ldaperror);
++		php3_error(E_WARNING,"LDAP:  Unable to perform the search: %s",ldap_err2string(ldaperror));
++#else
+ # if LDAP_API_VERSION > 2000
+ 		php3_error(E_WARNING,"LDAP:  Unable to perform the search: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ # else
+ 		php3_error(E_WARNING, "LDAP: Unable to perform the search: %s", ldap_err2string(ldap->ld_errno));
+ # endif
++# endif
+ #else
+ 		php3_error(E_WARNING,"LDAP:  Unable to perform the search: %s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #endif
+@@ -972,11 +996,17 @@
+ 
+ 	if ((ldap_value = ldap_get_values(ldap, ldap_result_entry, attribute)) == NULL) {
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++		int ldaperror;
++		ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ldaperror);
++		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s",ldap_err2string(ldaperror));
++#else
+ # if LDAP_API_VERSION > 2000
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ # else
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap->ld_errno));
+ # endif
++# endif
+ #else
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ #endif
+@@ -1027,10 +1057,16 @@
+ 
+ 	if ((ldap_value_len = ldap_get_values_len(ldap, ldap_result_entry, attribute)) == NULL) {
+ #if !HAVE_NSLDAP
++# if LDAP_API_VERSION > 3000
++		int ldaperror;
++		ldap_get_option(ldap, LDAP_OPT_RESULT_CODE, &ldaperror);
++		php3_error(E_WARNING,"LDAP: Cannot get the value(s) of attribute %s",ldap_err2string(ldaperror));
++#else
+ # if LDAP_API_VERSION > 2000
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
+ # else
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap->ld_errno));
++# endif
+ # endif
+ #else
+ 		php3_error(E_WARNING, "LDAP: Cannot get the value(s) of attribute %s", ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
Index: ports/www/mod_php3/files/patch-functions::snmp.c
===================================================================
RCS file: ports/www/mod_php3/files/patch-functions::snmp.c
diff -N ports/www/mod_php3/files/patch-functions::snmp.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ports/www/mod_php3/files/patch-functions::snmp.c	6 Feb 2005 17:23:22 -0000
@@ -0,0 +1,37 @@
+--- functions/snmp.c.orig	Sun Feb  6 19:18:38 2005
++++ functions/snmp.c	Sun Feb  6 19:23:02 2005
+@@ -70,6 +70,7 @@
+ #ifdef HAVE_DEFAULT_STORE_H
+ #include <default_store.h>
+ #endif
++#include <net-snmp/net-snmp-config.h>
+ #include <asn1.h>
+ #include <snmp_api.h>
+ #include <snmp_client.h>
+@@ -283,7 +284,7 @@
+ 						continue;       /* not part of this subtree */
+ 
+ 					if (st!=11)
+-					  sprint_value(buf,vars->name, vars->name_length, vars);
++					  snprint_value(buf,sizeof(buf),vars->name, vars->name_length, vars);
+ #if 0
+ 					Debug("snmp response is: %s\n",buf);
+ #endif
+@@ -293,7 +294,7 @@
+ 						/* Add to returned array */
+ 						add_next_index_string(return_value,buf,1);
+ 					} else if (st==3) {
+-						sprint_objid(buf2, vars->name, vars->name_length);
++						snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
+ 						add_assoc_string(return_value,buf2,buf,1);
+ 					}
+ 					if (st>=2 && st!=11) {
+@@ -310,7 +311,7 @@
+ 					if (response->errstat == SNMP_ERR_NOSUCHNAME) {
+ 						for(count=1, vars = response->variables; vars && count != response->errindex;
+ 							vars = vars->next_variable, count++);
+-						if (vars) sprint_objid(buf,vars->name, vars->name_length);
++						if (vars) snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
+ 						php3_error(E_WARNING,"This name does not exist: %s\n",buf);
+ 					}
+ 					if (st==1) {
Index: ports/www/mod_php3/scripts/configure.php
===================================================================
RCS file: /home/ncvs/ports/www/mod_php3/scripts/configure.php,v
retrieving revision 1.126
diff -u -r1.126 configure.php
--- ports/www/mod_php3/scripts/configure.php	3 Jun 2004 15:49:13 -0000	1.126
+++ ports/www/mod_php3/scripts/configure.php	6 Feb 2005 18:04:40 -0000
@@ -95,15 +95,14 @@
 			MYSQL=1
 			;;
 		\"PostgreSQL\")
-			echo "POSTGRESQL_PORT?=	databases/postgresql7"
-			echo "LIB_DEPENDS+=	pq.3:\${PORTSDIR}/\${POSTGRESQL_PORT}"
+			echo "USE_PGSQL=	yes"
 			echo "CONFIGURE_ARGS+=--with-pgsql=\${PREFIX}"
-			if /usr/bin/ldd ${PREFIX}/bin/postgres | /usr/bin/grep -q "libssl"; then
+			if /usr/bin/ldd ${PREFIX}/bin/psql | /usr/bin/grep -q "libssl"; then
 				LIBS="-lcrypto -lssl"
 			fi
 			;;
 		\"SybaseDB\")
-			echo "LIB_DEPENDS+=	sybdb.1:\${PORTSDIR}/databases/freetds"
+			echo "LIB_DEPENDS+=	sybdb.4:\${PORTSDIR}/databases/freetds"
 			echo "LIB_DEPENDS+=	iconv.3:\${PORTSDIR}/converters/libiconv"
 			echo "CONFIGURE_ARGS+=--with-sybase=\${PREFIX}"
 			LIBS="${LIBS} -L\${LOCALBASE}/lib -liconv"
@@ -115,7 +114,7 @@
 			SYBASEDB=1
 			;;
 		\"SybaseCT\")
-			echo "LIB_DEPENDS+=	ct.0:\${PORTSDIR}/databases/freetds"
+			echo "LIB_DEPENDS+=	ct.2:\${PORTSDIR}/databases/freetds"
 			echo "LIB_DEPENDS+=	iconv.3:\${PORTSDIR}/converters/libiconv"
 			echo "CONFIGURE_ARGS+=--with-sybase-ct=\${PREFIX}"
 			LIBS="${LIBS} -L\${LOCALBASE}/lib -liconv"
@@ -135,28 +134,26 @@
 			echo "CONFIGURE_ARGS+=--with-dbase"
 			;;
 		\"OpenLDAP\")
-			echo "LIB_DEPENDS+=	ldap.1:\${PORTSDIR}/net/openldap12"
-			echo "LIB_DEPENDS+=	lber.1:\${PORTSDIR}/net/openldap12"
+			echo "USE_OPENLDAP=	yes"
 			echo "CONFIGURE_ARGS+=--with-ldap=\${PREFIX}"
 			if [ -f /usr/lib/libkrb.a -a -f /usr/lib/libdes.a -a ! -L /usr/lib/libdes.a ]; then
 				LIBS="${LIBS} -lkrb -ldes -L\${PREFIX}/lib"
 			fi
 			;;
 		\"SNMP\")
-			echo "LIB_DEPENDS+=	snmp.4:\${PORTSDIR}/net/net-snmp"
+			echo "LIB_DEPENDS+=	netsnmp.7:\${PORTSDIR}/net-mgmt/net-snmp"
 			echo "CONFIGURE_ARGS+=--with-snmp=\${PREFIX} --enable-ucd-snmp-hack"
+			echo "CPPFLAGS+=	-I${PREFIX}/include/net-snmp/library/"
 			;;
 		\"XML\")
-			echo "BUILD_DEPENDS+=	\${PREFIX}/lib/libexpat.a:\${PORTSDIR}/textproc/expat"
-			echo "BUILD_DEPENDS+=	\${PREFIX}/include/xml/xmlparse.h:\${PORTSDIR}/textproc/expat"
-			echo "BUILD_DEPENDS+=	\${PREFIX}/include/xml/xmltok.h:\${PORTSDIR}/textproc/expat"
+			echo "USE_APACHE=	yes"
 			echo "CONFIGURE_ARGS+=--with-xml=\${PREFIX}"
 			;;
 		\"FTP\")
 			echo "CONFIGURE_ARGS+=--with-ftp"
 			;;
 		\"gettext\")
-			echo "LIB_DEPENDS+=	intl.5:\${PORTSDIR}/devel/gettext"
+			echo "LIB_DEPENDS+=	intl.6:\${PORTSDIR}/devel/gettext"
 			echo "CONFIGURE_ARGS+=--with-gettext=\${PREFIX}"
 			;;
 		\"YP\")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-apache/attachments/20050206/2325007b/attachment.bin


More information about the freebsd-apache mailing list