ports/122469: [patch] options for devel/viewvc
Olli Hauer
ohauer at gmx.de
Sun Aug 3 22:40:05 UTC 2008
The following reply was made to PR ports/122469; it has been noted by GNATS.
From: "Olli Hauer" <ohauer at gmx.de>
To: bug-followup at FreeBSD.org, pgollucci at FreeBSD.org, ohauer at gmx.de
Cc:
Subject: Re: ports/122469: [patch] options for devel/viewvc
Date: Mon, 04 Aug 2008 00:05:04 +0200
--========GMX153301217801104146213
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi,
I forgot about the open PR until I have to install ViewVC at another machine.
Now the port is nearly rewritten, with OPTIONS also a new rc script for the standalone
server was written.
With the rc script there is absolute no need to install a Webserver like Apache/LigHTTP.
Also it makes now no sense to track a depency/conflict to one of the Webservers, since
the pkg-plist will not change, but I keep this in the Makefile (before another flameware starts)
The pkg-message contains now a short explain/howto setup ViewVC standalone and with Apache/LigHTTP. I delete the passage to copy the cgi into the /cgi-bin directoy since in most
cases it provides more trouble for users during updates.
Since the patch is now a little bit bigger it is attached.
If the patch is garbled you can download the file here:
http://sorry.mine.nu/patches/FreeBSD/ports/viewvc/patch-viewvc_2008-08-03
Regards,
olli
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
--========GMX153301217801104146213
Content-Type: text/plain;
charset="iso-8859-15";
name="patch-viewvc_2008-08-03.txt"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="patch-viewvc_2008-08-03.txt"
--- viewvc/Makefile 2008-07-23 04:43:48.000000000 +0200
+++ viewvc/Makefile 2008-08-03 22:40:08.000000000 +0200
@@ -7,30 +7,72 @@
PORTNAME= viewvc
PORTVERSION= 1.0.5
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel python
MASTER_SITES= http://viewvc.tigris.org/files/documents/3330/41694/
MAINTAINER= pgollucci at FreeBSD.org
COMMENT= Web-based Version Control Repository Browsing
-RUN_DEPENDS= ${PYTHON_LIBDIR}/site-packages/svn/__init__.py:${PORTSDIR}/devel/py-subversion \
- ${PYTHON_LIBDIR}/site-packages/_mysql.so:${PORTSDIR}/databases/py-MySQLdb
+OPTIONS= SUBVERSION "use svn binding" on \
+ APACHE2 "use Apache as webserver" on \
+ LIGHTTPD "use Lighttp as webserver" off \
+ MODPYTHON3 "enable mod_python3 support" off \
+ MYSQL "enable experimental MYSQL support" off
+NO_BUILD= yes
USE_PYTHON= yes
-.if defined (WITH_APACHE)
+SUB_FILES= pkg-message
+SUB_LIST= INSTDIR="${PREFIX}/${INSTDIR}"
+
+INSTDIR?= ${PORTNAME}
+PLIST_SUB= INSTDIR=${INSTDIR}
+USE_RC_SUBR?= viewvc
+
+.include <bsd.port.pre.mk>
+
+# viewvc can support CVS or SVN, controlled with the parameter
+# cvs_roots (for CVS), svn_roots (for Subversion) in viewvc.conf
+.if defined (WITH_SUBVERSION)
+RUN_DEPENDS+= ${PYTHON_LIBDIR}/site-packages/svn/__init__.py:${PORTSDIR}/devel/py-subversion
+.endif
+
+.if defined (WITH_APACHE2)
USE_APACHE= 2.0+
.endif
+
+.if defined(WITH_LIGHTTPD)
+RUN_DEPENDS+= lighttpd:${PORTSDIR}/www/lighttpd
+.endif
+
.if defined(WITH_MODPYTHON3)
RUN_DEPENDS+= ${APACHEMODDIR}/mod_python.so:${PORTSDIR}/www/mod_python3
.endif
-NO_BUILD= yes
-SUB_FILES= pkg-message
-SUB_LIST= INSTDIR="${PREFIX}/${INSTDIR}"
+# This feature is a clone of the Mozilla Project's Bonsai database.
+# It catalogs every commit in the CVS or Subversion repository into a SQL database.
+# In fact, the databases are 100% compatible.
+.if defined(WITH_MYSQL)
+RUN_DEPENDS+= ${PYTHON_LIBDIR}/site-packages/_mysql.so:${PORTSDIR}/databases/py-MySQLdb
+.endif
-INSTDIR?= ${PORTNAME}
-PLIST_SUB= INSTDIR=${INSTDIR}
+pre-everything::
+.if defined(WITH_APACHE2) && defined(WITH_LIGHTTPD)
+ @${ECHO_CMD} "It doesn't make sense to depend on Apache *and* LighHTTPD choose only one."
+ @${FALSE}
+.endif
+.if !defined(WITH_APACHE2) && !defined(WITH_LIGHTTPD)
+ @${ECHO_CMD} "Please choose *between* Apache *or* LighHTTPD"
+ @${FALSE}
+.endif
+
+.if defined(WITH_MODPYTHON3) && !defined(WITH_APACHE2) && defined(WITH_LIGHTTPD)
+ @${ECHO_CMD} "mod_python3 needs Apache, please select Apache and deselect LighHTTPD"
+ @${FALSE}
+.elif defined(WITH_MODPYTHON3) && !defined(WITH_APACHE2)
+ @${ECHO_CMD} "mod_python3 needs Apache, please select Apache"
+ @${FALSE}
+.endif
do-install:
@(cd ${WRKSRC} && ${PYTHON_CMD} viewvc-install --prefix=${PREFIX}/${INSTDIR} --destdir="" --clean-mode=false)
@@ -38,4 +80,4 @@
post-install:
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--- viewvc/files/pkg-message.in 2007-04-11 12:37:05.000000000 +0200
+++ viewvc/files/pkg-message.in 2008-08-03 22:36:12.000000000 +0200
@@ -1,9 +1,55 @@
*****************************************************************
-If you would like to set up ViewVC in a usable manner, all
-you need to do is modify the configuration file, located at
-%%INSTDIR%%/viewvc.conf, to note where your
-CVSROOT is, and then copy the actual CGI (located at
-%%INSTDIR%%/bin/cgi/viewvc.cgi) to your cgi-bin.
+ To use ViewVC modify the configuration file, located at
+ %%INSTDIR%%/viewvc.conf.
+
+ There is no need for an Webserver, all you have to do is
+ enable the standalone ViewVC server in rc.conf with the
+ parameter viewvc_enable="YES".
+
+ You can also adjust the user wich runs the ViewVC standalone
+ server with the paramter viewvc_user.
+
+ If you want to run the ViewVC standalone server with another
+ IP/PORT use the parameter viewvc_flags
+
+ To see all aviable parameters use the command
+ %%PREFIX%%/viewvc/bin/standalone.py --help
+
+
+ To use ViewVC with Apache or LigHTTP as cgi script
+ see the following config exmples.
+
+ Example config lines for Apache
+ ==================================
+ Alias /viewvc "%%PREFIX%%/viewvc/bin/cgi/"
+ <Directory "%%PRFIX%%/viewvc/bin/cgi">
+ Options NONE +ExecCGI
+ DirectoryIndex /viewvc/viewvc.cgi
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+
+ Example config lines for LigHTTP
+ ================================
+ server.modules = (
+ "mod_alias",
+ "mod_access"
+ )
+
+ alias.url += ( "/viewvc" => "%%PREFIX%%/viewvc/bin/cgi" )
+
+ $HTTP["url"] =~ "^/viewvc/" {
+ index-file.names = ( "viewvc.cgi" )
+ cgi.assign = (
+ ".cgi" => "%%PREFIX%%/bin/python",
+ )
+ }
*****************************************************************
+
+
+
+
+
--- viewvc/files/viewvc.in 1970-01-01 01:00:00.000000000 +0100
+++ viewvc/files/viewvc.in 2008-08-03 20:43:53.000000000 +0200
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: viewvc
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable ViewVC:
+#
+# viewvc_enable="YES"
+# # optional
+# viewvc_flags="-h localhost -p PORT"
+# viewvc_user="www"
+#
+# To get aviable parameters and the default values use the
+# command %%PREFIX%%/viewvc/bin/standalone.py --help
+# for more info.
+#
+# Note:
+# If you choose a listen port less then 1024 then you have
+# to use a privileged user.
+# If the user www can not access your cvs/svn repository
+# adust the parameter viewvc_user and it should work.
+#
+# INFO:
+# The default port will change with the next release of ViewVC
+# from 7467 to 49152
+# see http://viewvc.tigris.org/issues/show_bug.cgi?id=234
+#
+# 2008-08-03 Olli Hauer
+
+. "/etc/rc.subr"
+
+name="viewvc"
+rcvar=`set_rcvar`
+
+# read settings and set default values
+load_rc_config ${name}
+: ${viewvc_enable="NO"}
+: ${viewvc_flags="-p 49152"}
+: ${viewvc_user="www"}
+: ${viewvc_procname="%%PREFIX%%/viewvc/bin/standalone.py"}
+
+command="%%PREFIX%%/viewvc/bin/standalone.py"
+
+# we need this, since our script interpreter is python
+command_interpreter="%%PREFIX%%/bin/python2.5"
+
+# extra required arguments
+command_args="2>/dev/null 1>/dev/null &"
+
+run_rc_command "$1"
--========GMX153301217801104146213--
More information about the freebsd-ports-bugs
mailing list