From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 8 03:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AEE106568B for ; Sun, 8 Nov 2009 03:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 923F58FC16 for ; Sun, 8 Nov 2009 03:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nA83U2j5069722 for ; Sun, 8 Nov 2009 03:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nA83U2ZJ069719; Sun, 8 Nov 2009 03:30:02 GMT (envelope-from gnats) Resent-Date: Sun, 8 Nov 2009 03:30:02 GMT Resent-Message-Id: <200911080330.nA83U2ZJ069719@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jarrod Sayers Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DBC8106566B for ; Sun, 8 Nov 2009 03:28:43 +0000 (UTC) (envelope-from jarrod@manhattan.downtools.com.au) Received: from manhattan.downtools.com.au (manhattan.downtools.com.au [123.136.33.242]) by mx1.freebsd.org (Postfix) with ESMTP id 36A458FC08 for ; Sun, 8 Nov 2009 03:28:42 +0000 (UTC) Received: from manhattan.downtools.com.au (localhost [127.0.0.1]) by manhattan.downtools.com.au (8.14.3/8.14.3) with ESMTP id nA83C5aa031837; Sun, 8 Nov 2009 13:42:05 +1030 (CST) (envelope-from jarrod@manhattan.downtools.com.au) Received: (from jarrod@localhost) by manhattan.downtools.com.au (8.14.3/8.14.3/Submit) id nA83C5An031836; Sun, 8 Nov 2009 13:42:05 +1030 (CST) (envelope-from jarrod) Message-Id: <200911080312.nA83C5An031836@manhattan.downtools.com.au> Date: Sun, 8 Nov 2009 13:42:05 +1030 (CST) From: Jarrod Sayers To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/140380: [patch] www/apache22: Add support for inclusion of profile_* directive X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jarrod Sayers List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2009 03:30:02 -0000 >Number: 140380 >Category: ports >Synopsis: [patch] www/apache22: Add support for inclusion of profile_* directive >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 08 03:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Jarrod Sayers >Release: FreeBSD 7.2-RELEASE-p4 i386 >Organization: >Environment: System: FreeBSD manhattan.downtools.com.au 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #18: Sat Oct 3 19:20:23 CST 2009 root@manhattan.netleader.com.au:/usr/obj/usr/src/sys/MANHATTAN i386 >Description: The www/apache22 port has support for multiple profiles which are controlled from a single rc.d script. However, in some instances multiple profiles share a common base configuration or only differ by a few directives. This patch adds support for a new rc.conf flag, apache22_profile_directives, which when set adds an additional directive to the command line specifying the name of the profile itself. Consider the following example: apache22_enable="YES" apache22_profiles="httpd mail" apache22_httpd_configfile="/usr/local/etc/apache22/httpd.manhattan.conf" apache22_mail_configfile="/usr/local/etc/apache22/httpd.mail.conf" The two configuration files only differ in a few places that define the Listen address and ServerName, plus a Directory directive or two. Due to the small number of differences, these files could be collapsed in to one which simplifies global level changes. Consider the following modified example: Listen manhattan.downtools.com.au:80 ServerName manhattan.downtools.com.au DocumentRoot /home/htdocs/default/data Listen mail.downtools.com.au:443 ServerName mail.downtools.com.au DocumentRoot /home/htdocs/mail/data ... ... SSLRequireSSL By collapsing the minor differences, both profiles can still be controlled individually via the rc.d script as a -Dprofile_${profile} flag will be added to the command line for each. This results in a slightly simplified rc.conf configuration and less duplication. apache22_enable="YES" apache22_profiles="httpd mail" apache22_profile_directives="YES" apache22_httpd_configfile="/usr/local/etc/apache22/httpd.manhattan.conf" apache22_mail_configfile="${apache22_httpd_configfile}" >How-To-Repeat: >Fix: --- www-apache22-apache22_profile_directives.diff begins here --- diff -ruN ports/www/apache22.orig/Makefile ports/www/apache22/Makefile --- ports/www/apache22.orig/Makefile 2009-09-16 23:47:57.000000000 +0930 +++ ports/www/apache22/Makefile 2009-11-08 12:11:56.000000000 +1030 @@ -9,6 +9,7 @@ PORTNAME= apache PORTVERSION= 2.2.13 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD} DISTNAME= httpd-${PORTVERSION} diff -ruN ports/www/apache22.orig/files/apache22.in ports/www/apache22/files/apache22.in --- ports/www/apache22.orig/files/apache22.in 2009-08-03 05:05:57.000000000 +0930 +++ ports/www/apache22/files/apache22.in 2009-11-08 12:31:27.000000000 +1030 @@ -13,6 +13,9 @@ # Set it to "YES" to enable apache22 # apache22_profiles (str): Set to "" by default. # Define your profiles here. +# apache22_profile_directives (bool): Set to "NO" by default. +# Set to "YES" to include a profile_* +# directive on the httpd command line. # apache22limits_enable (bool):Set to "NO" by default. # Set it to yes to run `limits $limits_args` # just before apache starts. @@ -43,6 +46,7 @@ required_files=%%PREFIX%%/etc/apache22/httpd.conf [ -z "$apache22_enable" ] && apache22_enable="NO" +[ -z "$apache22_profile_directives" ] && apache22_profile_directives="NO" [ -z "$apache22limits_enable" ] && apache22limits_enable="NO" [ -z "$apache22limits_args" ] && apache22limits_args="-e -C daemon" [ -z "$apache22_http_accept_enable" ] && apache22_http_accept_enable="NO" @@ -84,6 +88,13 @@ eval apache22limits_enable="\${apache22limits_${profile}_enable:-${apache22limits_enable}}" eval apache22limits_args="\${apache22limits_${profile}_args:-${apache22limits_args}}" eval apache22_fib="\${apache22_${profile}_fib:-${apache22_fib}}" + case "${apache22_profile_directives}" in + [Yy][Ee][Ss]) + apache22_flags="-Dprofile_${profile} ${apache22_flags}" + ;; + *) + ;; + esac apache22_flags="-f ${apache22_configfile} -c \"PidFile ${pidfile}\" ${apache22_flags}" else echo "$0: extra argument ignored" --- www-apache22-apache22_profile_directives.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: