Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  4 Dec 2013 16:17:41 -0500 (EST)
From:      Christopher K Davis <ckd-freebsd@ckdhr.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/184503: [patch] mail/policyd2 port assumes MySQL for web UI, requires web UI
Message-ID:  <20131204211741.563B9D4121@sergyar.ckdhr.com>
Resent-Message-ID: <201312042130.rB4LU0QP045859@freefall.freebsd.org>

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

>Number:         184503
>Category:       ports
>Synopsis:       [patch] mail/policyd2 port assumes MySQL for web UI, requires web UI
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 04 21:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Christopher K Davis
>Release:        FreeBSD 9.2-RELEASE amd64
>Organization:
Google Inc.
>Environment:
System: FreeBSD escobar.ckdhr.com 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
	The mail/policyd2 port unconditionally sets USE_PHP to use pdo_mysql
	even if PORT_OPTIONS doesn't include MYSQL.  This will make the PHP
	web UI nonfunctional if an alternate database is used.

	In addition, it always installs the PHP-based web UI rather than
	making doing so a configuration option.
>How-To-Repeat:
	Install mail/policyd2 with MYSQL unset in the port config.
>Fix:

	Attached patch makes two changes:
	1. Adds a WEBUI configuration option to bsd.options.desc.mk for
	   use by this port as well as by any future ports that include
	   an optional web-based user interface component.
	2. Uses the WEBUI configuration option as well as the chosen
	   database(s) to install the appropriate PHP database module(s)
	   if the web UI is desired.

--- Mk/bsd.options.desc.mk~	2013-09-07 08:08:39.000000000 -0400
+++ Mk/bsd.options.desc.mk	2013-09-09 20:53:52.000000000 -0400
@@ -447,6 +447,7 @@
 WEBKIT_DESC?=		WebKit support
 WEBP_DESC?=		WebP image format support
 WEBSERVER_DESC?=	Build and/or install internal web server
+WEBUI_DESC?=		Build and/or install web user interface
 WMA_DESC?=		Windows Media Audio support
 WMF_DESC?=		Windows Metafile support
 WXGTK_DESC?=		wxGTK GUI toolkit support
--- mail/policyd2/Makefile.orig	2012-11-17 00:59:10.000000000 -0500
+++ mail/policyd2/Makefile	2013-09-09 20:00:18.000000000 -0400
@@ -1,7 +1,4 @@
-# New ports collection makefile for:	policyd2
-# Date created:				2 December 2008
-# Whom:	      				Chifeng QU <chifeng@gmail.com>
-#
+# Created by: Chifeng QU <chifeng@gmail.com>
 # $FreeBSD: ports/mail/policyd2/Makefile,v 1.17 2012/11/17 05:59:10 svnexp Exp $
 #
 
@@ -20,7 +17,6 @@
 		p5-Cache-FastMmap>=0:${PORTSDIR}/devel/p5-Cache-FastMmap
 
 USE_PERL5=	yes
-USE_PHP=	yes
 NO_BUILD=	yes
 USE_RC_SUBR=	policyd2
 BINMODE=	0755
@@ -30,20 +26,28 @@
 PORTDOCS=	AUTHORS ChangeLog INSTALL TODO WISHLIST
 PORTDATA=	*
 
-OPTIONS_DEFINE=	MYSQL PGSQL SQLITE
-OPTIONS_DEFAULT=	MYSQL
+OPTIONS_DEFINE=	MYSQL PGSQL SQLITE WEBUI
+OPTIONS_DEFAULT=	MYSQL WEBUI
 
 .include <bsd.port.pre.mk>
-USE_PHP=	pdo_mysql
 .if ${PORT_OPTIONS:MMYSQL}
 RUN_DEPENDS+=	p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
-.endif
+.if ${PORT_OPTIONS:MWEBUI}
+USE_PHP=	pdo_mysql
+.endif # MYSQL && WEBUI
+.endif # MYSQL
 .if ${PORT_OPTIONS:MSQLITE}
 RUN_DEPENDS+=	p5-DBD-SQLite>=0:${PORTSDIR}/databases/p5-DBD-SQLite
-.endif
+.if ${PORT_OPTIONS:MWEBUI}
+USE_PHP=	pdo_sqlite
+.endif # SQLITE && WEBUI
+.endif # SQLITE
 .if ${PORT_OPTIONS:MPGSQL}
 RUN_DEPENDS+=	p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
-.endif
+.if ${PORT_OPTIONS:MWEBUI}
+USE_PHP=	pdo_pgsql
+.endif # PGSQL && WEBUI
+.endif # PGSQL
 
 post-patch:
 	@${REINPLACE_CMD} 's|/etc|${PREFIX}/etc|' ${WRKSRC}/cbpadmin \
>Release-Note:
>Audit-Trail:
>Unformatted:



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