Subject: Re: call for review: extending www/apache/module.mk to support apache2
To: None <tech-pkg@NetBSD.org>
From: Stoned Elipot <seb@ssr.univ-paris7.fr>
List: tech-pkg
Date: 09/20/2004 23:29:05
--DSayHWYpDlRfCAAQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Of course attaching the diffs helps...

--DSayHWYpDlRfCAAQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="apache-mod.diffs"

Index: mk/apache.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/apache.mk,v
retrieving revision 1.6
diff -u -u -r1.6 apache.mk
--- mk/apache.mk	6 Jul 2004 22:49:16 -0000	1.6
+++ mk/apache.mk	20 Sep 2004 08:53:11 -0000
@@ -6,6 +6,9 @@
 #
 #	* set PKG_APACHE to the name of the apache web serverused
 #
+#	* set APACHE_MANUAL_DIR to apache's manual root installation
+#         pathname relative to $PREFIX
+#
 #	* add a full dependency on the apache server
 #
 #	* optionally add a full dependency on apr
@@ -157,6 +160,20 @@
 .  endif
 .endif
 
+# APACHE_MANUAL_DIR contains the apache's manual root installation
+# pathname relative to $PREFIX
+#
+.if ${_PKG_APACHE} == "apache2"
+APACHE_MANUAL_DIR=	share/httpd/manual
+.else
+APACHE_MANUAL_DIR=	share/httpd/htdocs/manual
+.endif
+
+PRINT_PLIST_AWK+=	/^@dirrm ${APACHE_MANUAL_DIR:S|/|\\/|g}.*/ { next; }
+PRINT_PLIST_AWK+=	{ gsub(/${APACHE_MANUAL_DIR:S|/|\\/|g}/, "$${APACHE_MANUAL_DIR}"); }
+
+PLIST_SUBST+=		APACHE_MANUAL_DIR=${APACHE_MANUAL_DIR}
+
 # PKG_APACHE is a publicly readable variable containing the name of the server
 #	we will be using.
 #
Index: www/apache/module.mk
===================================================================
RCS file: /cvsroot/pkgsrc/www/apache/module.mk,v
retrieving revision 1.9
diff -u -u -r1.9 module.mk
--- www/apache/module.mk	6 Jul 2004 22:55:35 -0000	1.9
+++ www/apache/module.mk	20 Sep 2004 08:53:11 -0000
@@ -19,31 +19,56 @@
 # APACHE_MODULE_SRC	the source files to be compiled for this
 #			module, defaults to *.c.
 #
+# APXS_FLAGS		Any apxs arguments
+#
+# And any variables expected by mk/apache.mk.
+#
 
 .if !defined(_APACHE_MODULE_MK)
 _APACHE_MODULE_MK=	# defined
 APACHE_MODULE=		# defined
 
-.if defined(USE_BUILDLINK3)
-.  include "../../www/apache/buildlink3.mk"
-.endif
+.include "../../mk/apache.mk"
 
+# Sources and location of the apache module.
 APACHE_MODULE_SRCDIR?=	${WRKSRC}
 APACHE_MODULE_SRC?=	*.c
 
+# Transition handling
+APACHE_MODULE_NAME:= ${APACHE_MODULE_NAME:C|\.[^.]*$||}
+
+# Set the right extension for apxs's output argument
+.if ${PKG_APACHE} == "apache2"
+_MOD_SUFFIX=	la
+.else
+_MOD_SUFFIX=	so
+.endif
+
+# Arguments to apxs
+APXS_FLAGS?=
+
 apache-module-build:
 	${_PKG_SILENT}${_PKG_DEBUG} \
 	cd ${APACHE_MODULE_SRCDIR} && \
-		${SETENV} PATH=${PATH} \
-		${APXS} ${CPPFLAGS} ${LDFLAGS} \
-			-c -o ${APACHE_MODULE_NAME} ${APACHE_MODULE_SRC}
+		${SETENV} ${MAKE_ENV} \
+		${APXS} ${APXS_FLAGS} \
+			-c -o ${APACHE_MODULE_NAME}.${_MOD_SUFFIX} \
+			${CPPFLAGS} \
+			${CFLAGS:N-I*:N-D*:C|^.+|-Wc,&|} \
+			${CFLAGS:M-I*} \
+			${CFLAGS:M-D*} \
+			${LDFLAGS:N-l*:N-L*:N-Wl,*:C|^.+|-Wl,&|} \
+			${LDFLAGS:M-Wl,*} \
+			${LDFLAGS:M-L*} \
+			${LDFLAGS:M-l*} \
+			${APACHE_MODULE_SRC}
 
 do-build: apache-module-build
 	${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA}
 
 apache-module-install:
 	${_PKG_SILENT}${PKG_DEBUG}					\
-	cd ${APACHE_MODULE_SRCDIR} && ${APXS} -i ${APACHE_MODULE_NAME}
+	cd ${APACHE_MODULE_SRCDIR} && ${APXS} -i ${APACHE_MODULE_NAME}.${_MOD_SUFFIX}
 
 do-install: apache-module-install
 	${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA}
Index: www/ap-fastcgi/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/ap-fastcgi/Makefile,v
retrieving revision 1.26
diff -u -u -r1.26 Makefile
--- www/ap-fastcgi/Makefile	8 May 2004 15:19:18 -0000	1.26
+++ www/ap-fastcgi/Makefile	20 Sep 2004 08:53:11 -0000
@@ -1,22 +1,22 @@
 # $NetBSD: Makefile,v 1.26 2004/05/08 15:19:18 grant Exp $
 #
 
-DISTNAME=	mod_fastcgi_2.2.10
-PKGNAME=	ap-fastcgi-2.2.10
+DISTNAME=	mod_fastcgi-2.4.2
+PKGNAME=	ap-fastcgi-2.4.2
 CATEGORIES=	www
 MASTER_SITES=	http://www.fastcgi.com/dist/
 
 MAINTAINER=	tech-pkg@NetBSD.org
 HOMEPAGE=	http://www.fastcgi.com/
-COMMENT=	New, improved CGI-like interface module for Apache
+COMMENT=	New, improved CGI-like interface module for Apache (${PKG_APACHE})
 
-USE_BUILDLINK3=	yes
+USE_BUILDLINK3=		yes
 
-APACHE_MODULE_NAME=	mod_fastcgi.so
+APACHE_MODULE_NAME=	mod_fastcgi
 
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/docs/mod_fastcgi.html \
-		${PREFIX}/share/httpd/htdocs/manual/mod/
+		${PREFIX}/${APACHE_MANUAL_DIR}/mod
 
 .include "../../www/apache/module.mk"
 .include "../../mk/bsd.pkg.mk"
Index: www/ap-fastcgi/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/www/ap-fastcgi/PLIST,v
retrieving revision 1.1
diff -u -u -r1.1 PLIST
--- www/ap-fastcgi/PLIST	1 Nov 2001 02:15:44 -0000	1.1
+++ www/ap-fastcgi/PLIST	20 Sep 2004 08:53:11 -0000
@@ -1,3 +1,3 @@
-@comment $NetBSD: PLIST,v 1.1 2001/11/01 02:15:44 zuntum Exp $
+@comment $NetBSD$
 lib/httpd/mod_fastcgi.so
-share/httpd/htdocs/manual/mod/mod_fastcgi.html
+${APACHE_MANUAL_DIR}/mod/mod_fastcgi.html
Index: www/ap-fastcgi/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/www/ap-fastcgi/distinfo,v
retrieving revision 1.2
diff -u -u -r1.2 distinfo
--- www/ap-fastcgi/distinfo	20 Apr 2001 12:02:31 -0000	1.2
+++ www/ap-fastcgi/distinfo	20 Sep 2004 08:53:11 -0000
@@ -1,4 +1,4 @@
 $NetBSD: distinfo,v 1.2 2001/04/20 12:02:31 skrll Exp $
 
-SHA1 (mod_fastcgi_2.2.10.tar.gz) = 1c80be5f65f7bc1d05dc8e29830967979446aae4
-Size (mod_fastcgi_2.2.10.tar.gz) = 83474 bytes
+SHA1 (mod_fastcgi-2.4.2.tar.gz) = a56be62a3f08262ae187989f5dacb3464a030e2e
+Size (mod_fastcgi-2.4.2.tar.gz) = 98295 bytes
Index: www/ap2-auth-pgsql/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/ap2-auth-pgsql/Makefile,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile
--- www/ap2-auth-pgsql/Makefile	27 Aug 2004 06:29:11 -0000	1.3
+++ www/ap2-auth-pgsql/Makefile	20 Sep 2004 08:53:11 -0000
@@ -13,23 +13,13 @@
 CONFLICTS=		ap-auth-postgresql-*
 USE_BUILDLINK3=	yes
 
-APACHE_MODULE =		yes
-APACHE_MODULE_NAME =	ap2-auth-pgsql
+APACHE_MODULE=		yes
+APACHE_MODULE_NAME=	mod_auth_pgsql
+PKG_APACHE_ACCEPTED=	apache2
 
-do-build:
-	cd ${WRKSRC} && \
-		${APXS} -c -n ${APACHE_MODULE_NAME} \
-		-I${PGSQL_PREFIX}/include/postgresql \
-		-L${LOCALBASE}/lib \
-		${COMPILER_RPATH_FLAG}${LOCALBASE}/lib \
-		-lpq ${DISTNAME:C/-[^-]*$//}.c
+LDFLAGS+=	-lpq
 
-do-install:
-	(cd ${WRKSRC} && ${APXS} -A -i ${DISTNAME:C/-[^-]*$//}.la)
-	#${MKDIR} ${DOCSDIR}
-	#${INSTALL_DATA} ${WRKSRC}/mod_auth_pgsql.html ${DOCSDIR}
-
-.include "../../www/apache2/buildlink3.mk"
+.include "../../www/apache/module.mk"
 
 .include "../../mk/pgsql.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

--DSayHWYpDlRfCAAQ--