OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 11-Jan-2006 19:59:05
Branch: HEAD Handle: 2006011118590500
Added files:
openpkg-src/usemod usemod-apache.conf usemod.patch usemod.spec
Log:
commit a UseMod package I prepared in 2004 and since two years stayed
in my development queue. UseMod is a KISS and stand-alone Wiki engine
Summary:
Revision Changes Path
1.1 +18 -0 openpkg-src/usemod/usemod-apache.conf
1.1 +27 -0 openpkg-src/usemod/usemod.patch
1.1 +157 -0 openpkg-src/usemod/usemod.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/usemod/usemod-apache.conf
============================================================================
$ cvs diff -u -r0 -r1.1 usemod-apache.conf
--- /dev/null 2006-01-11 19:59:04 +0100
+++ usemod-apache.conf 2006-01-11 19:59:05 +0100
@@ -0,0 +1,18 @@
+##
+## usemod-apache.conf -- Apache Configuration for UseMod Wiki Engine
+##
+
+RewriteEngine on
+
+RewriteRule ^/usemod\.css$ @l_prefix@/etc/usemod/usemod.css [L]
+RewriteRule ^/usemod\.gif$ @l_prefix@/etc/usemod/usemod.gif [L]
+RewriteRule ^/usemod(.*) /openpkg-cgi/usemod [PT,L]
+
+Alias /usemod/ @l_prefix@/var/usemod/
+
+<Directory @l_prefix@/var/usemod>
+ Options FollowSymLinks +Includes
+ AllowOverride None
+ Allow from all
+</Directory>
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/usemod/usemod.patch
============================================================================
$ cvs diff -u -r0 -r1.1 usemod.patch
--- /dev/null 2006-01-11 19:59:04 +0100
+++ usemod.patch 2006-01-11 19:59:05 +0100
@@ -0,0 +1,27 @@
+Index: wiki.pl
+--- wiki.pl.orig 2003-09-11 14:21:02 +0200
++++ wiki.pl 2004-11-07 14:59:31 +0100
+@@ -404,6 +404,11 @@
+ } else {
+ $CGI::DISABLE_UPLOADS = 1; # no uploads
+ }
++ # Modify query string and script path for slashed links
++ if ($SlashLinks && (length($ENV{'PATH_INFO'}) > 1)) {
++ $ENV{'QUERY_STRING'} .= '&' if ($ENV{'QUERY_STRING'});
++ $ENV{'QUERY_STRING'} .= substr($ENV{'PATH_INFO'}, 1);
++ }
+ $q = new CGI;
+ # Fix some issues with editing UTF8 pages (if charset specified)
+ if ($HttpCharset ne '') {
+@@ -411,6 +416,11 @@
+ }
+ $Now = time; # Reset in case script is persistent
+ $ScriptName = pop(@ScriptPath); # Name used in links
++ # Fix script name for relative links when slashed page links are used
++ if ($SlashLinks) {
++ my $numberOfSlashes = ($ENV{PATH_INFO} =~ tr[/][/]);
++ $ScriptName = ('../' x $numberOfSlashes) . $ScriptName;
++ }
+ $IndexInit = 0; # Must be reset for each request
+ $InterSiteInit = 0;
+ %InterSite = ();
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/usemod/usemod.spec
============================================================================
$ cvs diff -u -r0 -r1.1 usemod.spec
--- /dev/null 2006-01-11 19:59:04 +0100
+++ usemod.spec 2006-01-11 19:59:05 +0100
@@ -0,0 +1,157 @@
+##
+## usemod.spec -- OpenPKG RPM Package Specification
+## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
+## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
+##
+## Permission to use, copy, modify, and distribute this software for
+## any purpose with or without fee is hereby granted, provided that
+## the above copyright notice and this permission notice appear in all
+## copies.
+##
+## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+
+# package version
+%define V_real 1.0
+%define V_comp 10
+
+# package information
+Name: usemod
+Summary: UseMod Wiki Engine
+URL: http://www.usemod.com/
+Vendor: Clifford A. Adams
+Packager: OpenPKG
+Distribution: OpenPKG
+Class: EVAL
+Group: Web
+License: GPL
+Version: %{V_real}
+Release: 20060111
+
+# list of sources
+Source0: http://www.usemod.com/wikicode/usemod%{V_comp}.tar.gz
+Source1: usemod-apache.conf
+Patch0: usemod.patch
+
+# build information
+Prefix: %{l_prefix}
+BuildRoot: %{l_buildroot}
+BuildPreReq: OpenPKG, openpkg >= 20040130
+PreReq: OpenPKG, openpkg >= 20040130, perl, perl-www, MTA
+AutoReq: no
+AutoReqProv: no
+
+%description
+ UseMod is a small implementation of the original Wiki concept
+ created by Ward Cunningham. It uses no backend databases and is
+ fully self-contained.
+
+%track
+ prog usemod = {
+ version = %{V_comp}
+ url = http://www.usemod.com/cgi-bin/wiki.pl?UseModWiki/Download
+ regex = usemod(__VER__)\.tar\.gz
+ }
+
+%prep
+ %setup -q -n usemod%{V_comp}
+ %patch -p0
+
+%build
+
+%install
+ rm -rf $RPM_BUILD_ROOT
+
+ # create installation area
+ rm -rf $RPM_BUILD_ROOT
+ %{l_shtool} mkdir -f -p -m 755 \
+ $RPM_BUILD_ROOT%{l_prefix}/cgi \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/usemod \
+ $RPM_BUILD_ROOT%{l_prefix}/var/usemod
+
+ # install UseMod CGI
+ %{l_shtool} install -c -m 755 \
+ -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \
+ -e
's;^\($DataDir[^=]*=[^"]*"\)[^"]*\("\);\1%{l_prefix}/var/usemod\2;' \
+ -e
's;^\($ConfigFile[^=]*=[^"]*"\)[^"]*\("\);\1%{l_prefix}/etc/usemod/usemod.cfg\2;'
\
+ wiki.pl $RPM_BUILD_ROOT%{l_prefix}/cgi/usemod
+
+ # install UseMod configuration
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ -e 's;/usr/bin/;%{l_prefix}/bin;' \
+ -e 's;^\($CookieName[^=]*=[^"]*"\)[^"]*\("\);\1UseModWiki\2;' \
+ -e 's;^\($SiteName[^=]*=[^"]*"\)[^"]*\("\);\1UseMod Wiki\2;' \
+ -e 's;^\($LogoUrl[^=]*=[^"]*"\)[^"]*\("\);\1/usemod.gif\2;' \
+ -e 's;^\($StyleSheet[^=]*=[^"]*"\)[^"]*\("\);\1/usemod.css\2;' \
+ -e 's;^\($EmailFromt[^=]*=[^"]*"\)[^"]*\("\);\1UseMod\2;' \
+ -e
's;^\($SendMail[^=]*=[^"]*"\)[^"]*\("\);\1%{l_prefix}/sbin/sendmail\2;' \
+ -e
's;^\($UploadDir[^=]*=[^"]*"\)[^"]*\("\);\1%{l_prefix}/var/usemod/upload\2;' \
+ -e 's;^\($UploadUrl[^=]*=[^"]*"\)[^"]*\("\);\1/usemod/upload\2;' \
+ -e 's;^\($UseUpload[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ -e 's;^\($EmailNotify[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ -e 's;^\($ShowEdits[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ -e 's;^\($ThinLine[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ -e 's;^\($NetworkFile[^=]*=[^"]*"\)[^"]*\("\);\10\2;' \
+ -e 's;^\($NumberDates[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ -e 's;^\($EditNameLink[^=]*=[^"]*"\)[^"]*\("\);\11\2;' \
+ config $RPM_BUILD_ROOT%{l_prefix}/etc/usemod/usemod.cfg
+
+ # install Apache configuration
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE usemod-apache.conf} \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/usemod/
+
+ # install additional files
+ %{l_shtool} install -c -m 644 \
+ wiki.css $RPM_BUILD_ROOT%{l_prefix}/etc/usemod/usemod.css
+ %{l_shtool} install -c -m 644 \
+ wiki.gif $RPM_BUILD_ROOT%{l_prefix}/etc/usemod/usemod.gif
+
+ # determine installation files
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+ %{l_files_std} \
+ '%config %{l_prefix}/etc/usemod/*' \
+ '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/usemod'
+
+%files -f files
+
+%clean
+ rm -rf $RPM_BUILD_ROOT
+
+%post
+ if [ ".$1" = .1 ]; then
+ # add hook to Apache configuration
+ apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
+ if [ -f $apacheconf ]; then
+ ( echo "Include
$RPM_INSTALL_PREFIX/etc/usemod/usemod-apache.conf"
+ ) | $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
+ -a -i "$RPM_INSTALL_PREFIX:usemod" $apacheconf
+ fi
+
+ # display information about steps the admin should perform next
+ ( echo "UseMod was successfully installed. You should now start
Apache with"
+ echo " \$ $RPM_INSTALL_PREFIX/etc/rc apache start"
+ ) | %{l_rpmtool} msg -b -t notice
+ fi
+
+%postun
+ if [ ".$1" = .0 ]; then
+ # remove hook from Apache configuration
+ apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
+ if [ -f $apacheconf ]; then
+ $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
+ -r -i "$RPM_INSTALL_PREFIX:usemod" $apacheconf
+ fi
+ fi
+
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]