Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Apr 2006 04:00:39 +0100
From:      Shaun Amott <shaun@inerd.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/96298: www/hydra - update 0.1.7 -> 0.1.8; take maintainership
Message-ID:  <1145934039.6581@charon.picobyte.net>
Resent-Message-ID: <200604250310.k3P3AD49003305@freefall.freebsd.org>

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

>Number:         96298
>Category:       ports
>Synopsis:       www/hydra - update 0.1.7 -> 0.1.8; take maintainership
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 25 03:10:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shaun Amott
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
>Environment:

>Description:

- Update to 0.1.8
- Move WWW root in default config
- Create log dir to avoid initial errors
- Add rc.d script
- Take maintainership

Tested on 6.x i386, 6.x sparc64

>How-To-Repeat:

>Fix:

--- hydra.diff begins here ---
diff -urN hydra.orig/Makefile hydra/Makefile
--- hydra.orig/Makefile	Wed Apr  5 19:13:38 2006
+++ hydra/Makefile	Tue Apr 25 03:33:33 2006
@@ -7,18 +7,18 @@
 #
 
 PORTNAME=	hydra
-PORTVERSION=	0.1.7
-PORTREVISION=	1
+PORTVERSION=	0.1.8
 CATEGORIES=	www
 MASTER_SITES=	ftp://ftp.hellug.gr/pub/software/hydra/
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	shaun@inerd.com
 COMMENT=	A high performance multi-threaded web server
 
 LIB_DEPENDS=	gnutls.15:${PORTSDIR}/security/gnutls
 
+USE_RC_SUBR=	hydra.sh
+
 NO_LATEST_LINK=	yes
-USE_REINPLACE=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
@@ -26,18 +26,32 @@
 CPPFLAGS=	-I${LOCALBASE}/include
 LDFLAGS=	-L${LOCALBASE}/lib
 
+WWWOWN?=	www
+WWWGRP?=	www
+LOGDIR?=	/var/log/hydra
+
+SUB_FILES=	pkg-deinstall
+PLIST_SUB=	LOGDIR=${LOGDIR}
+SUB_LIST=	LOGDIR=${LOGDIR}
+
 post-patch:
 	@${REINPLACE_CMD} -e "s,-pthread,${PTHREAD_LIBS},g" ${WRKSRC}/configure
-.for file in src/defines.h examples/hydra.conf
-	@${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" ${WRKSRC}/${file}
+.for f in src/defines.h examples/hydra.conf
+	@${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
+	                  -e "s,%%LOGDIR%%,${LOGDIR},g" \
+	                  -e "s,%%WWWOWN%%,${WWWOWN},g" \
+	                  -e "s,%%WWWGRP%%,${WWWGRP},g" \
+	                  ${WRKSRC}/${f}
 .endfor
 
 post-install:
 	@${MKDIR} ${PREFIX}/etc/hydra
-.for file in hydra.conf mime.types
-	${INSTALL_DATA} ${WRKSRC}/examples/${file} ${PREFIX}/etc/hydra/${file}-dist
-	[ -f ${PREFIX}/etc/hydra/${file} ] || \
-		${INSTALL_DATA} ${WRKSRC}/examples/${file} ${PREFIX}/etc/hydra/
+.for f in hydra.conf mime.types
+	${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/${f}-dist
+	[ -f ${PREFIX}/etc/hydra/${f} ] || \
+		${INSTALL_DATA} ${WRKSRC}/examples/${f} ${PREFIX}/etc/hydra/
 .endfor
+	[ -d ${LOGDIR} ] || \
+		( ${MKDIR} ${LOGDIR} && ${CHOWN} ${WWWOWN}:${WWWGRP} ${LOGDIR} )
 
 .include <bsd.port.mk>
diff -urN hydra.orig/distinfo hydra/distinfo
--- hydra.orig/distinfo	Wed Apr  5 19:13:38 2006
+++ hydra/distinfo	Tue Apr 25 02:42:45 2006
@@ -1,3 +1,3 @@
-MD5 (hydra-0.1.7.tar.gz) = 81f62f6bcf89a8f2e9babed8d9206562
-SHA256 (hydra-0.1.7.tar.gz) = 3406a7343d23d5a014d6c061a45b6233b6bb8bf92cda82e29b5bbd36b266411a
-SIZE (hydra-0.1.7.tar.gz) = 286484
+MD5 (hydra-0.1.8.tar.gz) = 895b5e03ec8fb7d023070fcd0c721455
+SHA256 (hydra-0.1.8.tar.gz) = ce139dc891b7220a9c128e702b7c7b8d07ede95c13ecea925eecd72e614c1fa3
+SIZE (hydra-0.1.8.tar.gz) = 282119
diff -urN hydra.orig/files/hydra.sh.in hydra/files/hydra.sh.in
--- hydra.orig/files/hydra.sh.in	Thu Jan  1 01:00:00 1970
+++ hydra/files/hydra.sh.in	Tue Apr 25 02:52:45 2006
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# PROVIDE: hydra
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# $FreeBSD$
+#
+
+hydra_enable=${hydra_enable-"NO"}
+
+. %%RC_SUBR%%
+
+load_rc_config hydra
+
+name=hydra
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/${name}
+
+load_rc_config ${name}
+run_rc_command "$1"
diff -urN hydra.orig/files/patch-hydra.conf hydra/files/patch-hydra.conf
--- hydra.orig/files/patch-hydra.conf	Wed Apr  5 19:13:39 2006
+++ hydra/files/patch-hydra.conf	Tue Apr 25 03:07:19 2006
@@ -1,6 +1,91 @@
---- examples/hydra.conf.orig	Wed Apr  2 22:05:45 2003
-+++ examples/hydra.conf	Wed Apr  2 22:08:18 2003
-@@ -163,7 +163,7 @@
+--- examples/hydra.conf.orig	Thu Mar  9 18:31:13 2006
++++ examples/hydra.conf	Tue Apr 25 03:06:31 2006
+@@ -12,7 +12,7 @@
+ # $Id: hydra.conf,v 1.23 2006-03-09 18:31:13 nmav Exp $
+ 
+ # ServerRoot: The directory the .html (and related) files are placed.
+-ServerRoot /var/www
++ServerRoot %%PREFIX%%/www
+ 
+ # number of threads to spawn
+ # One thread might be ok for a single CPU system, but in some systems, 
+@@ -53,8 +53,8 @@
+ #  User: The name or UID the server should run as.
+ # Group: The group name or GID the server should run as.
+ 
+-User nobody
+-Group nogroup
++User %%WWWOWN%%
++Group %%WWWGRP%%
+ 
+ # ServerAdmin: The email address where server problems should be sent.
+ # Note: this is not currently used, except as an environment variable
+@@ -74,26 +74,26 @@
+ # Set to /dev/null if you don't want errors logged.
+ # If unset, defaults to /dev/stderr
+ 
+-ErrorLog /var/log/hydra/error_log
++ErrorLog %%LOGDIR%%/error_log
+ # Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+ #  is somewhat experimental and might fail under heavy load.
+ # "Usual libc implementations of printf will stall the whole
+ #  process if the receiving end of a pipe stops reading."
+-#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/hydra/error_log /var/log/hydra/error-%Y%m%d.log"
++#ErrorLog "|/usr/sbin/cronolog --symlink=%%LOGDIR%%/error_log %%LOGDIR%%/error-%Y%m%d.log"
+ 
+ # AccessLog: The location of the access log file. If this does not
+ # start with /, it is considered relative to the server root.
+ # Comment out or set to /dev/null (less effective) to disable 
+ # Access logging.
+ 
+-AccessLog /var/log/hydra/access_log
++AccessLog %%LOGDIR%%/access_log
+ # Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+ #  is somewhat experimental and might fail under heavy load.
+ # "Usual libc implementations of printf will stall the whole
+ #  process if the receiving end of a pipe stops reading."
+-#AccessLog  "|/usr/sbin/cronolog --symlink=/var/log/hydra/access_log /var/log/hydra/access-%Y%m%d.log"
++#AccessLog  "|/usr/sbin/cronolog --symlink=%%LOGDIR%%/access_log %%LOGDIR%%/access-%Y%m%d.log"
+ 
+-# CGILog /var/log/hydra/cgi_log
++# CGILog %%LOGDIR%%/cgi_log
+ # CGILog: The location of the CGI stderr log file. If this does not
+ # start with /, it is considered relative to the server root.
+ # The log file would contain any contents send to /dev/stderr
+@@ -103,7 +103,7 @@
+ #  is somewhat experimental and might fail under heavy load.
+ # "Usual libc implementations of printf will stall the whole
+ #  process if the receiving end of a pipe stops reading."
+-#CGILog  "|/usr/sbin/cronolog --symlink=/var/log/hydra/cgi_log /var/log/hydra/cgi-%Y%m%d.log"
++#CGILog  "|/usr/sbin/cronolog --symlink=%%LOGDIR%%/cgi_log %%LOGDIR%%/cgi-%Y%m%d.log"
+ 
+ # CGIumask 027 (no mask for user, read-only for group, and nothing for user)
+ # CGIumask 027
+@@ -132,11 +132,11 @@
+ # directory if a ~user request is received.
+ #
+ # Example: 
+-# VirtualHost www.dot.com * /var/www public_html
+-# VirtualHost www.dot.com 127.0.0.1 /var/www ""
++# VirtualHost www.dot.com * %%PREFIX%%/www public_html
++# VirtualHost www.dot.com 127.0.0.1 %%PREFIX%%/www ""
+ #
+ 
+-#VirtualHost www.dot.com * /var/www ""
++#VirtualHost www.dot.com * %%PREFIX%%/www ""
+ 
+ # DocumentRoot: The root directory of the HTML documents.
+ # Comment out to disable server non user files.
+@@ -144,7 +144,7 @@
+ # Note that if VirtualHost is enabled, this will be the fallback
+ # for the clients that did not supply any host.
+ 
+-DocumentRoot /var/www
++DocumentRoot %%PREFIX%%/www
+ 
+ # DirectoryIndex: Name of the file to use as a pre-written HTML
+ # directory index.  Please MAKE AND USE THESE FILES.  On the
+@@ -160,7 +160,7 @@
  # DirectoryIndex are commented out, accessing a directory will give
  # an error (though accessing files in the directory are still ok).
  
@@ -9,7 +94,7 @@
  
  # DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
  # has been commented out, the the on-the-fly indexing of Hydra can be used
-@@ -199,7 +199,7 @@
+@@ -196,7 +196,7 @@
  # Set to /dev/null if you do not want to load a mime types file.
  # Do *not* comment out (better use AddType!)
  
diff -urN hydra.orig/files/pkg-deinstall.in hydra/files/pkg-deinstall.in
--- hydra.orig/files/pkg-deinstall.in	Thu Jan  1 01:00:00 1970
+++ hydra/files/pkg-deinstall.in	Tue Apr 25 03:49:53 2006
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+case $2 in
+	DEINSTALL)
+		;;
+	POST-DEINSTALL)
+		if [ ! -d %%LOGDIR%% ] ; then
+			rmdir %%LOGDIR%%
+		else
+			echo "--------------------------------------------"
+			echo " Don't forget to delete %%LOGDIR%% when"
+			echo " you've finished with hydra's log files."
+			echo "--------------------------------------------"
+		fi
+		;;
+esac
--- hydra.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?1145934039.6581>