-diff -uNr cvsweb.orig/cvsweb.cgi cvsweb/cvsweb.cgi
---- cvsweb.orig/cvsweb.cgi Sun Oct 3 19:24:58 1999
-+++ cvsweb/cvsweb.cgi Tue Oct 12 21:27:48 1999
-@@ -73,7 +73,7 @@
- ##### Start of Configuration Area ########
- # == EDIT this ==
- # User configuration is stored in
--$config = $ENV{'CVSWEB_CONFIG'} || '/usr/local/web/apache/conf/cvsweb.conf';
-+$config = $ENV{'CVSWEB_CONFIG'} || '/etc/cvsweb.conf';
-
- # == Configuration defaults ==
- # Defaults for configuration variables that shouldn't need
---- ./cvsweb.conf~ 2005-04-02 03:00:23.000000000 +0300
-+++ ./cvsweb.conf 2005-04-02 03:01:29.000000000 +0300
-@@ -23,14 +23,15 @@
-
- # 'symbolic_name' 'path_to_the_actual_repository'
- %CVSROOT = (
-- 'Development' => '/usr/local/src/cvsrep',
-- 'Configuration' => '/tmp/cvsroot/conf',
-- 'HTML-files' => '/tmp/upload'
-+# Uncomment next line and modify the path if you have only one CVS repository.
-+# 'Development' => '/usr/local/src/cvsrep',
-+# 'Configuration' => '/tmp/cvsroot/conf',
-+# 'HTML-files' => '/tmp/upload'
- );
-
- # This tree is enabled by default when
- # you enter the page
--$cvstreedefault = 'Configuration';
-+$cvstreedefault = 'Local-CVS';
-
- ##############
- # Defaults for UserSettings
-@@ -81,7 +82,7 @@
- ##############
-
- # color settings in the body-tag
--$body_tag = '<body text="#000000" bgcolor="#ffffff">';
-+$body_tag = '<body text="#000000" bgcolor="#ffffff" link="#0000ff" alink="#ff0000" vlink="#800080">';
-
- # Wanna have a logo on the page ?
- $logo = '<img src="/icons/apache_pb.gif">';
-@@ -291,6 +292,8 @@
- "gif" => "image/gif",
- "jpeg" => "image/jpeg",
- "jpg" => "image/jpeg",
-+ "png" => "image/png",
-+ "xpm" => "image/xpm",
- "*" => "text/plain",
- );
-
---- ./cvsweb.conf~ 2005-04-02 03:05:40.000000000 +0300
-+++ ./cvsweb.conf 2005-04-02 03:10:52.000000000 +0300
-@@ -279,7 +279,7 @@
- # cvsweb to guess the correct mime-type on
- # checkout; you can use the mime.types from
- # apache here:
--$mime_types = '/usr/local/web/apache/conf/mime.types';
+diff -Nur cvsweb-3.0.1/cvsweb.cgi cvsweb-3.0.1.new/cvsweb.cgi
+--- cvsweb-3.0.1/cvsweb.cgi 2004-05-08 16:13:40.000000000 +0200
++++ cvsweb-3.0.1.new/cvsweb.cgi 2004-08-19 14:06:58.000000000 +0200
+@@ -214,7 +214,7 @@
+
+ # == EDIT this ==
+ # Locations to search for user configuration, in order:
+-for (catfile($mydir, 'cvsweb.conf'), '/usr/local/etc/cvsweb/cvsweb.conf') {
++for (catfile($mydir, 'cvsweb.conf'), '/etc/cvsweb/cvsweb.conf') {
+ if (-r $_) {
+ $config = $_;
+ last;
+diff -Nur cvsweb-3.0.1/cvsweb.conf cvsweb-3.0.1.new/cvsweb.conf
+--- cvsweb-3.0.1/cvsweb.conf 2004-05-05 01:40:50.000000000 +0200
++++ cvsweb-3.0.1.new/cvsweb.conf 2004-08-19 14:08:34.000000000 +0200
+@@ -19,7 +19,7 @@
+ # cvsgraph (if you enable $allow_graph)
+ # enscript (if you enable $allow_enscript)
+ #
+-@command_path = qw(/bin /usr/bin /usr/local/bin);
++@command_path = qw(/bin /usr/bin);
+
+ # Search the above directories for each command (prefer gtar over tar).
+ #
+@@ -47,7 +47,7 @@
+ # 'symbolic_name' => ['Name to display', '/path/to/cvsroot']
+ #
+ @CVSrepositories = (
+- 'local' => ['Local Repository', '/var/cvs'],
++ 'local' => ['Local Repository', '/home/services/cvsroot'],
+ # 'freebsd' => ['FreeBSD', '/var/ncvs'],
+ # 'openbsd' => ['OpenBSD', '/var/ncvs'],
+ # 'netbsd' => ['NetBSD', '/var/ncvs'],
+@@ -62,7 +62,7 @@
+ # For example:
+ #
+ #$cvstreedefault = $CVSrepositories[2 * 0];
+-#$cvstreedefault = 'local';
++$cvstreedefault = 'local';
+
+ # Bug tracking system linking options ("PR" means Problem Report, as in GNATS)
+ #
+@@ -86,7 +86,7 @@
+ # Manual gateway linking.
+ #
+ $mancgi =
+- "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html";
++ "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.2-current&format=html";
+
+ # Defaults for user options.
+ #
+@@ -202,7 +202,7 @@
+ # check out the "mini" versions in the icons/ directory; they have a
+ # width/height of 16/16.
+ #
+-my $iconsdir = '/icons';
++my $iconsdir = '/cvsweb/icons';
+
+ # format: TEXT ICON-URL width height
+ %ICONS = (
+@@ -216,7 +216,7 @@
+
+ # An URL where to find the CSS.
+ #
+-$cssurl = '/css/cvsweb.css';
++$cssurl = '/cvsweb/css/cvsweb.css';
+
+ # The length to which the last log entry should be truncated when shown
+ # in the directory view.
+@@ -344,7 +344,7 @@
+ # The traditional mime.types file, eg. the one from Apache is fine.
+ # See above where this gets used.
+ #
+-$mime_types = '/usr/local/etc/apache/mime.types';
+$mime_types = '/etc/mime.types';
- # quick mime-type lookup; maps file-suffices to
- # mime-types for displaying checkouts in the browser.
+ # Charset appended to the Content-Type HTTP header for text/* MIME types.
+ # Note that the web server may default to some charset which may take effect
+@@ -470,7 +470,7 @@
+ # settings in the configuration file with command line options, see
+ # doGraph() and doGraphView() in cvsweb.cgi for details.
+ #
+-#$cvsgraph_config = "/etc/cvsgraph.conf";
++#$cvsgraph_config = "/etc/cvsgraph/cvsgraph.conf";
+
+ # URL to the CVSHistory script. This should be absolute (but does not need
+ # to include the host and port if the script is on the same server as
+%include /usr/lib/rpm/macros.perl
Summary: Visual (www) interface to explore a cvs repository
Summary(pl): Wizualny (WWW) interfejs do przegl±dania repozytorium cvs
Name: cvsweb
-Version: 1.112
-Release: 7.3
+Version: 3.0.5
+Release: 0.15
Epoch: 1
-License: BSD-like
+License: BSD
Group: Development/Tools
-URL: http://stud.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi/
-Source0: http://stud.fh-heilbronn.de/~zeller/download/%{name}-%{version}.tar.gz
-# Source0-md5: 30ff2783ff8e01bf72193902decd0c73
+Source0: http://people.FreeBSD.org/~scop/cvsweb/%{name}-%{version}.tar.gz
+# Source0-md5: 572dbb2d66ad6487c0a3536f93023086
+URL: http://www.freebsd.org/projects/cvsweb.html
Patch0: %{name}-config.patch
-Patch1: %{name}-fix_perl_options.patch
-Patch2: %{name}-fixes.patch
-Requires: perl(IPC::Open2)
-Requires: perl(Time::Local)
+BuildRequires: rpmbuild(macros) >= 1.223
+# for %{_libdir}/cgi-bin
+Requires: FHS >= 2.3-8
Requires: rcs
+# for /etc/mime.types
+Requires: mailcap
Requires: webserver
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+# because of wrong module load order
+Conflicts: apache1 < 1.3.33-6.3
BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%description
-cvsweb is a visual (www) interface to explore a cvs repository. This
-is an enhanced cvsweb developed by Henner Zeller. Enhancements include
-recognition and display of popular mime-types, visual, color-coded,
-side by side diffs of changes and the ability sort the file display
-and to hide old files from view. One living example of the enhanced
-cvsweb is the KDE cvsweb.
+%define _sysconfdir /etc/%{name}
+%define _appdir %{_datadir}/%{name}
+%define _cgibindir %{_libdir}/cgi-bin
-cvsweb requires the server to have cvs and a cvs repository worth
-exploring.
+%description
+CVSweb is a WWW interface for CVS repositories with which you can
+browse a file hierarchy on your browser to view each file's revision
+history in a very handy manner. CVSweb was originally written by Bill
+Fenner for the FreeBSD Project. FreeBSD-CVSweb, formerly known as
+knu-CVSweb, is an enhanced version of CVSweb based on Henner Zeller's
+CVSweb, which is an extended version of the original CVSweb. This
+version contains numerous cleanups, bug-fixes, security enhancements
+and feature improvements.
%description -l pl
-cvsweb jest wizualnym interfejsem do eksploracji repozytorium cvs.
-Jest to ulepszona wersja programu cvsweb Hennera Zellera. Do ulepszeñ
-zaliczyæ mo¿na rozpoznawanie i wy¶wietlanie popularnych typów MIME;
-wizualnych, kolorowych, umieszczonych obok siebie ró¿nic miêdzy
-plikami oraz zdolno¶æ sortowania widoku plików oraz ukrywania starych
-plików. ¯ywym przyk³adem ulepszonego cvsweba jest cvsweb projektu KDE.
-
-cvsweb wymaga, by na serwerze by³ zainstalowany CVS oraz repozytorium
-CVS warte eksploracji.
+CVSweb jest interfejsem WWW dla repozytoriów CVS dziêki któremu mo¿na
+przegl±daæ ich zawarto¶æ w przegl±darce WWW widz±c pe³n± historiê
+zmian i numerów rewizji dla ka¿dego z plików. CVSWeb zosta³ stworzony
+przez Billa Fennera dla projektu FreeBSD. FreeBSD-CVSweb dawniej znany
+jako knu-CVSweb jest rozszerzon± wersj± opart± na wersji Hennera
+Zellera, która z kolei by³a oparta na oryginalnej wersji. Kod obecnej
+wersji zosta³ uporz±dkowany i oczysczony, usuniêtych zosta³o równie¿
+wiele b³êdów. Wprowadzono tak¿e du¿o poprawek bezpieczeñstwa oraz
+rozbudowano funkcjonalno¶æ.
%prep
-%setup -q -n %{name}
+%setup -q
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
+
+install cvsweb.conf* samples
+
+# remove backups
+find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/{/home/services/httpd/cgi-bin,%{_sysconfdir}}
-install cvsweb.cgi $RPM_BUILD_ROOT/home/services/httpd/cgi-bin
-install cvsweb.conf $RPM_BUILD_ROOT%{_sysconfdir}
+install -d $RPM_BUILD_ROOT{%{_appdir}/{css,enscript,icons},%{_cgibindir},%{_sysconfdir}}
+
+install %{name}.cgi $RPM_BUILD_ROOT%{_cgibindir}
+install css/* $RPM_BUILD_ROOT%{_appdir}/css
+install enscript/* $RPM_BUILD_ROOT%{_appdir}/enscript
+install icons/* $RPM_BUILD_ROOT%{_appdir}/icons
+
+install %{name}.conf $RPM_BUILD_ROOT%{_sysconfdir}
+echo '# vim:syn=perl' >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
+
+cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+Alias /%{name}/ %{_appdir}/
+ScriptAlias /cgi-bin/%{name}.cgi %{_cgibindir}/%{name}.cgi
+
+<Location /cgi-bin/cvsweb.cgi>
+ # See also $charset in cvsweb.conf.
+ #AddDefaultCharset UTF-8
+
+ # mod_perl >= 1.99:
+ <IfModule mod_perl.c>
+ SetHandler perl-script
+ PerlResponseHandler ModPerl::Registry
+ PerlOptions +ParseHeaders
+ Options ExecCGI
+ </IfModule>
+</Location>
+
+# vim: filetype=apache ts=4 sw=4 et
+EOF
+
+%post
+if [ "$1" = 1 ]; then
+%banner %{name} -e <<'EOF'
+You might want to install optionally 'cvsgraph' program.
+EOF
+fi
%clean
rm -rf $RPM_BUILD_ROOT
+# 09_ instead of 99_ is for ScriptAlias /cgi-bin/cvsweb.cgi ...
+%triggerin -- apache1 >= 1.3.33-2
+%apache_config_install -v 1 -c %{_sysconfdir}/apache.conf -n 09
+
+%triggerun -- apache1 >= 1.3.33-2
+%apache_config_uninstall -v 1 -n 09
+
+%triggerin -- apache >= 2.0.0
+%apache_config_install -v 2 -c %{_sysconfdir}/apache.conf -n 09
+
+%triggerun -- apache >= 2.0.0
+%apache_config_uninstall -v 2 -n 09
+
+%triggerpostun -- %{name} < 1:3.0.5-0.11
+# migrate from old config location (only apache2, as there was no apache1 support)
+if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
+ cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
+ mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/apache.conf
+ if [ -f /var/lock/subsys/httpd ]; then
+ /etc/rc.d/init.d/httpd restart 1>&2
+ fi
+fi
+
+# place new config location, as trigger puts config only on first install, do it here.
+# apache1
+if [ -d /etc/apache/conf.d ]; then
+ ln -sf %{_sysconfdir}/apache.conf /etc/apache/conf.d/09_%{name}.conf
+ if [ -f /var/lock/subsys/apache ]; then
+ /etc/rc.d/init.d/apache restart 1>&2
+ fi
+fi
+# apache2
+if [ -d /etc/httpd/httpd.conf ]; then
+ ln -sf %{_sysconfdir}/apache.conf /etc/httpd/httpd.conf/09_%{name}.conf
+ if [ -f /var/lock/subsys/httpd ]; then
+ /etc/rc.d/init.d/httpd restart 1>&2
+ fi
+fi
+
%files
%defattr(644,root,root,755)
-%doc INSTALL README TODO
-%doc icons
-%attr(755,root,root) /home/services/httpd/cgi-bin/cvsweb.cgi
-%config(noreplace) %{_sysconfdir}/cvsweb.conf
+%doc ChangeLog INSTALL NEWS README TODO samples
+%dir %attr(750,root,http) %{_sysconfdir}
+%config(noreplace) %verify(not md5 mtime size) %attr(640,root,http) %{_sysconfdir}/%{name}.conf
+%config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) %{_sysconfdir}/apache.conf
+%attr(755,root,root) %{_cgibindir}/cvsweb.cgi
+%{_datadir}/%{name}