rpms/viewvc/EL-4 viewvc-1.1.3-config.patch, NONE, 1.1 viewvc-lexer-mimetypes.py, NONE, 1.1 viewvc.conf, 1.2, 1.3 viewvc.spec, 1.13, 1.14 viewvc-temp-location.patch, 1.1, NONE

bojan bojan at fedoraproject.org
Tue Feb 2 02:27:39 UTC 2010


Author: bojan

Update of /cvs/pkgs/rpms/viewvc/EL-4
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28787

Modified Files:
	viewvc.conf viewvc.spec 
Added Files:
	viewvc-1.1.3-config.patch viewvc-lexer-mimetypes.py 
Removed Files:
	viewvc-temp-location.patch 
Log Message:
Bump up to 1.1.3 (supported branch).
Patch upstream issue #445.

viewvc-1.1.3-config.patch:
 config.py |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- NEW FILE viewvc-1.1.3-config.patch ---
--- branches/1.1.x/lib/config.py	2010-01-07 07:56:29-0800	2316
+++ branches/1.1.x/lib/config.py	2010-01-07 08:08:31-0800	2317
@@ -274,9 +274,7 @@
     """Overlay per-root options for ROOTNAME atop the existing option
     set.  This is a destructive change to the configuration."""
 
-    # We can only deal with this happening once!
-    assert(self.root_options_overlayed == 0)
-    self.root_options_overlayed = 1
+    did_overlay = 0
     
     if not self.conf_path:
       return
@@ -285,7 +283,17 @@
       base_section = self._is_allowed_override(self.parser, 'root',
                                                rootname, section)
       if base_section:
+        # We can currently only deal with root overlays happening
+        # once, so check that we've not yet done any overlaying of
+        # per-root options.
+        assert(self.root_options_overlayed == 0)
         self._process_section(self.parser, section, base_section)
+        did_overlay = 1
+
+    # If we actually did any overlaying, remember this fact so we
+    # don't do it again later.
+    if did_overlay:
+      self.root_options_overlayed = 1
 
   def _get_parser_items(self, parser, section):
     """Basically implement ConfigParser.items() for pre-Python-2.3 versions."""


--- NEW FILE viewvc-lexer-mimetypes.py ---
#!/usr/bin/python

import sys
import re
from pygments.lexers import get_all_lexers

for fullname, names, exts, mimetype in get_all_lexers():
  if len(exts) > len(mimetype):
    for j in range(len(mimetype)):
      line=0
      for i in range(len(exts)):
        if re.match('\*\.',exts[i]):
          if i == 0:
            print mimetype[j],
            line=1
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
          else:
            print exts[i][2:],
        if line==1 and i == len(exts)-1:
          print
  elif len(exts) == 1:
    for i in range(len(mimetype)):
      if re.match('\*\.',exts[0]):
        if re.search('\[[0-9]+\]',exts[0]):
          s=re.search('\[[0-9]+\]',exts[0]).span()[0]+1
          e=re.search('\[[0-9]+\]',exts[0]).span()[1]-1
          print mimetype[i],
          for k in range(s,e):
            print exts[0][2:s-1]+exts[0][k]+exts[0][e+1:],
          print
        else:
          print mimetype[i], exts[0][2:]
  else:
    for i in range(len(mimetype)):
      if len(exts) > i:
        if re.match('\*\.',exts[i]):
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            print mimetype[i],
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
            print
          else:
            print mimetype[i], exts[i][2:]


Index: viewvc.conf
===================================================================
RCS file: /cvs/pkgs/rpms/viewvc/EL-4/viewvc.conf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- viewvc.conf	3 Jun 2007 05:34:14 -0000	1.2
+++ viewvc.conf	2 Feb 2010 02:27:39 -0000	1.3
@@ -4,6 +4,7 @@ Alias /viewvc-static __datadir__/viewvc/
 <Directory __python_sitelib__/viewvc/bin/mod_python>
     AddHandler python-program .py
     PythonHandler handler
+    PythonPath "sys.path+['__python_sitelib__/viewvc/bin/mod_python']"
     Order allow,deny
     Allow from 127.0.0.1
 </Directory>


Index: viewvc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/viewvc/EL-4/viewvc.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- viewvc.spec	11 Aug 2009 22:26:33 -0000	1.13
+++ viewvc.spec	2 Feb 2010 02:27:39 -0000	1.14
@@ -1,12 +1,5 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
-# EL4 & EL5 do not have cvsgraph or enscript.. yet
-%if 0%{?rhel}
-%define with_cvsgraph_enscript 0
-%else
-%define with_cvsgraph_enscript 1
-%endif
-
 # EL4 has a subversion that does not meet the minimum reqs for subversion
 %if 0%{?rhel} && "%rhel" < "5"
 %define with_subversion 0
@@ -16,7 +9,7 @@
 
 
 Name:           viewvc
-Version:        1.0.9
+Version:        1.1.3
 Release:        1%{?dist}
 Summary:        Browser interface for CVS and SVN version control repositories
 
@@ -25,21 +18,22 @@ License:        BSD
 URL:            http://www.viewvc.org/
 Source0:        http://www.viewvc.org/%{name}-%{version}.tar.gz
 Source1:        viewvc.conf
-Patch0:         viewvc-temp-location.patch
+Source2:        README.httpd
+Source3:        viewvc-lexer-mimetypes.py
+Patch1:         viewvc-1.1.3-config.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Obsoletes:      %{name}-selinux < 1.0.3-13
 Conflicts:      selinux-policy < 2.5.10-2
 
 BuildArch:      noarch
-BuildRequires:  python-devel >= 2.0
-Requires:       mod_python, rcs, diffutils
+BuildRequires:  python-devel >= 2.0, python-pygments
+Requires:       webserver, rcs, diffutils
 %if 0%{with_subversion}
 Requires:       subversion >= 1.2
 %endif
-%if 0%{with_cvsgraph_enscript}
-Requires:       enscript, cvsgraph
-%endif
+Requires:       cvsgraph
+Requires:       python-pygments
 
 %description
 ViewVC is a browser interface for CVS and Subversion version control
@@ -53,9 +47,18 @@ but much more prettily than the average 
 This version only supports CVS repositories.
 %endif
 
+%package httpd
+Summary:        ViewVC configuration for Apache/mod_python
+Group:          Development/Tools
+Requires:       %{name} = %{version}-%{release}, mod_python
+
+%description httpd
+ViewVC configuration for Apache/mod_python. This package should provide ViewVC
+with decent performance when run under Apache.
+
 %prep
 %setup -q
-%patch0 -p0 -b .temp-location
+%patch1 -p2 -b .config
 
 %build
 
@@ -82,29 +85,27 @@ This version only supports CVS repositor
 
 # Fix paths in configuration
 %{__perl} -pi \
-  -e 's|templates/|%{_datadir}/viewvc/templates/|g;' \
-  -e 's|^template_dir = .*|template_dir = %{_datadir}/viewvc/templates|g;' \
-  -e 's|^#docroot = .*|docroot = /viewvc-static|;' \
-  -e 's|^cvsgraph_conf = .*|cvsgraph_conf = %{_sysconfdir}/viewvc/cvsgraph.conf|;' \
-  %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
-
-%if 0%{with_cvsgraph_enscript}
-%{__perl} -pi \
-  -e 's|^use_cvsgraph = .*|use_cvsgraph = 1|;' \
-  -e 's|^use_enscript = .*|use_enscript = 1|;' \
+  -e 's|^#* *template_dir = .*|template_dir = %{_datadir}/viewvc/templates|g;' \
+  -e 's|^#* *docroot = .*|docroot = /viewvc-static|;' \
+  -e 's|^#* *cvsgraph_conf = .*|cvsgraph_conf = %{_sysconfdir}/viewvc/cvsgraph.conf|;' \
+  -e 's|^#* *use_cvsgraph = .*|use_cvsgraph = 1|;' \
   %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
-%endif
 
 # Install config to sysconf directory
 %{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/viewvc.conf %{buildroot}%{_sysconfdir}/viewvc/viewvc.conf
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
 %{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf %{buildroot}%{_sysconfdir}/viewvc/cvsgraph.conf
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf
+%{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
+%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf
+
+%{SOURCE3} >> %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
 
-# Install Apache configuration
+# Install Apache configuration and README
 %{__sed} -e s,__datadir__,%{_datadir}, \
          -e s,__python_sitelib__,%{python_sitelib}, %{SOURCE1} > viewvc.conf
 %{__install} -Dp -m0644 viewvc.conf %{buildroot}/etc/httpd/conf.d/viewvc.conf
+%{__cp} %{SOURCE2} README.httpd
 
 # mod_python files mustn't be executable since they don't have shebang
 # make rpmlint happy!
@@ -114,9 +115,6 @@ This version only supports CVS repositor
 %{__mv} %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/viewvc.py \
         %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/viewvc-mp.py
 
-# Kill patch backup file
-%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/lib/viewvc.py.temp-location
-
 # Make spool directory for temp files
 %{__mkdir} -p %{buildroot}%{_localstatedir}/spool/viewvc
 
@@ -125,14 +123,21 @@ This version only supports CVS repositor
 
 %files
 %defattr(-, root, root, -)
-%doc CHANGES README INSTALL TODO COMMITTERS LICENSE.html docs
+%doc CHANGES README README.httpd INSTALL COMMITTERS LICENSE.html docs
 %config(noreplace) %{_sysconfdir}/viewvc
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc.conf
 %{python_sitelib}/*
 %{_datadir}/*
 %attr(0700,apache,apache) %{_localstatedir}/spool/viewvc
 
+%files httpd
+%defattr(-, root, root, -)
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc.conf
+
 %changelog
+* Tue Feb  2 2010 Bojan Smojver <bojan at rexursive.com> - 1.1.3-1
+- bump up to 1.1.3
+- patch upstream issue #445
+
 * Wed Aug 12 2009 Bojan Smojver <bojan at rexursive.com> - 1.0.9-1
 - bump up to 1.0.9
 - security fix: validate the 'view' parameter to avoid XSS attack


--- viewvc-temp-location.patch DELETED ---



More information about the scm-commits mailing list