Blob Blame Raw
%{!?python2_sitelib: %define python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           viewvc
Version:        1.1.26
Release:        9%{?dist}
Summary:        Browser interface for CVS and SVN version control repositories

License:        BSD
URL:            http://www.viewvc.org/
Source0:        http://www.viewvc.org/%{name}-%{version}.tar.gz
Source1:        viewvc-fcgi.conf
Source2:        viewvc-wsgi.conf
Source3:        README.httpd
Source4:        viewvc-lexer-mimetypes.py
Patch0:         viewvc-1.1.26-explicit-python2.patch

Obsoletes:      %{name}-selinux < 1.0.3-13
Conflicts:      selinux-policy < 2.5.10-2

BuildArch:      noarch
BuildRequires:  python2-devel >= 2.0, python2-pygments, perl-interpreter
Requires:       rcs, diffutils
Requires:       subversion >= 1.2
Requires:       python2-subversion >= 1.2
Requires:       cvsgraph
Requires:       python2-pygments

%description
ViewVC is a browser interface for CVS and Subversion version control
repositories. It generates templatized HTML to present navigable directory,
revision, and change log listings. It can display specific versions of files
as well as diffs between those versions. Basically, ViewVC provides the bulk
of the report-like functionality you expect out of your version control tool,
but much more prettily than the average textual command-line program output.

%package httpd-fcgi
Summary:        ViewVC configuration for Apache/mod_fcgid
Obsoletes:      viewvc-httpd < 1.1.13-2
Requires:       httpd, %{name} = %{version}-%{release}, mod_fcgid, python2-flup

%description httpd-fcgi
ViewVC configuration for Apache/mod_fcgid. This package should provide ViewVC
with decent performance when run under Apache.

%package httpd-wsgi
Summary:        ViewVC configuration for Apache/mod_wsgi
Requires:       httpd, %{name} = %{version}-%{release}, python2-mod_wsgi

%description httpd-wsgi
ViewVC configuration for Apache/mod_wsgi. This package should provide ViewVC
with decent performance when run under Apache.

%prep
%autosetup -p1

%build

%install
%{__rm} -rf %{buildroot}
%{__python2} viewvc-install --destdir="%{buildroot}" --prefix="%{python2_sitelib}/viewvc"

# Remove unneeded files
%{__rm} -f %{buildroot}%{python2_sitelib}/viewvc/bin/mod_python/.htaccess

# Move non-python to /usr/share
%{__mkdir} -p %{buildroot}%{_datadir}/viewvc
%{__mv} %{buildroot}%{python2_sitelib}/viewvc/templates %{buildroot}%{_datadir}/viewvc

# Fix python files shebang and CONF_PATHNAME
%{__perl} -pi \
  -e 's|/usr/local/bin/python|%{_bindir}/python2|g;' \
  -e 's|\s*/usr/bin/env python|%{_bindir}/python2|g;' \
  -e 's|CONF_PATHNAME =.*|CONF_PATHNAME = r"%{_sysconfdir}/viewvc/viewvc.conf"|g;' \
  $(find %{buildroot}%{python2_sitelib}/viewvc/ -type f)

# Fix python files shebang for WSGI files
%{__sed} -i -e '1i#!%{_bindir}/python2' \
 $(find %{buildroot}%{python2_sitelib}/viewvc/ -type f -name '*.wsgi')

# Set mode 755 on executable scripts
%{__grep} -rl '^#!' %{buildroot}%{python2_sitelib}/viewvc | xargs %{__chmod} 0755

# Fix paths in configuration
%{__perl} -pi \
  -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}%{python2_sitelib}/viewvc/viewvc.conf

# Install config to sysconf directory
%{__install} -Dp -m0644 %{buildroot}%{python2_sitelib}/viewvc/viewvc.conf %{buildroot}%{_sysconfdir}/viewvc/viewvc.conf
%{__rm} -f %{buildroot}%{python2_sitelib}/viewvc/viewvc.conf
%{__install} -Dp -m0644 %{buildroot}%{python2_sitelib}/viewvc/cvsgraph.conf %{buildroot}%{_sysconfdir}/viewvc/cvsgraph.conf
%{__rm} -f %{buildroot}%{python2_sitelib}/viewvc/cvsgraph.conf
%{__install} -Dp -m0644 %{buildroot}%{python2_sitelib}/viewvc/mimetypes.conf %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
%{__rm} -f %{buildroot}%{python2_sitelib}/viewvc/mimetypes.conf

%{SOURCE4} >> %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf

# Install Apache configuration and README
%{__sed} -e s,__datadir__,%{_datadir}, \
         -e s,__python2_sitelib__,%{python2_sitelib}, %{SOURCE1} > viewvc-fcgi.conf
%{__sed} -e s,__datadir__,%{_datadir}, \
         -e s,__python2_sitelib__,%{python2_sitelib}, %{SOURCE2} > viewvc-wsgi.conf
%{__install} -Dp -m0644 viewvc-fcgi.conf %{buildroot}/etc/httpd/conf.d/viewvc-fcgi.conf
%{__install} -Dp -m0644 viewvc-wsgi.conf %{buildroot}/etc/httpd/conf.d/viewvc-wsgi.conf
%{__cp} %{SOURCE3} README.httpd

# mod_python files mustn't be executable since they don't have shebang
# make rpmlint happy!
%{__chmod} 0644 %{buildroot}%{python2_sitelib}/viewvc/bin/mod_python/*.py

# Rename viewvc.py to viewvc-mp.py for mod_python to avoid import cycle errors
%{__mv} %{buildroot}%{python2_sitelib}/viewvc/bin/mod_python/viewvc.py \
        %{buildroot}%{python2_sitelib}/viewvc/bin/mod_python/viewvc-mp.py

# Make spool directory for temp files
%{__mkdir} -p %{buildroot}%{_localstatedir}/spool/viewvc

%files
%doc CHANGES README README.httpd INSTALL COMMITTERS LICENSE docs
%config(noreplace) %{_sysconfdir}/viewvc
%{python2_sitelib}/*
%{_datadir}/*

%files httpd-fcgi
%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc-fcgi.conf
%attr(0700,apache,apache) %{_localstatedir}/spool/viewvc

%files httpd-wsgi
%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc-wsgi.conf
%attr(0700,apache,apache) %{_localstatedir}/spool/viewvc

%changelog
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.26-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Sep 11 2018 Bojan Smojver <bojan@rexursive.com> - 1.1.26-8
- explicitly change shebang lines to use python2

* Sat Jul 21 2018 Bojan Smojver <bojan@rexursive.com> - 1.1.26-7
- use correct python2 macros and binaries

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.26-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.1.26-5
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.26-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.26-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.26-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jan 31 2017 Bojan Smojver <bojan@rexursive.com> - 1.1.26-1
- bump up to 1.1.26

* Wed Jul 20 2016 Bojan Smojver <bojan@rexursive.com> - 1.1.24-4
- add perl to build requirements

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.24-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.24-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Oct  6 2015 Bojan Smojver <bojan@rexursive.com> - 1.1.24-1
- bump up to 1.1.24

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.23-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Nov  6 2014 Bojan Smojver <bojan@rexursive.com> - 1.1.23-1
- bump up to 1.1.23

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.22-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Jan 15 2014 Bojan Smojver <bojan@rexursive.com> - 1.1.22-1
- bump up to 1.1.22

* Sat Sep 14 2013 Bojan Smojver <bojan@rexursive.com> - 1.1.21-1
- bump up to 1.1.21

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.20-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Apr 25 2013 Bojan Smojver <bojan@rexursive.com> - 1.1.20-1
- bump up to 1.1.20

* Tue Apr 23 2013 Bojan Smojver <bojan@rexursive.com> - 1.1.19-1
- bump up to 1.1.19

* Fri Mar  1 2013 Bojan Smojver <bojan@rexursive.com> - 1.1.18-1
- bump up to 1.1.18

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.17-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jan 12 2013 Bojan Smojver <bojan@rexursive.com> - 1.1.17-3
- add default authorisation for CGI scripts too

* Wed Oct 31 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.17-2
- fix bug #871492

* Fri Oct 26 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.17-1
- bump up to 1.1.17

* Thu Oct 25 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.16-1
- bump up to 1.1.16
- drop patch for CVE-2012-4533, part of the release

* Mon Oct 22 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.15-3
- patch CVE-2012-4533, bug #868606

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jun 23 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.15-1
- bump up to 1.1.15

* Wed Jun 13 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.14-1
- bump up to 1.1.14

* Sun Apr 29 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.13-2
- drop viewvc-httpd package, which depends on mod_python
- introduce viewvc-httpd-fcgi, obsoletes viewvc-httpd
- introduce viewvc-httpd-wsgi

* Tue Jan 24 2012 Bojan Smojver <bojan@rexursive.com> - 1.1.13-1
- bump up to 1.1.13

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Fri Nov  4 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.12-1
- bump up to 1.1.12

* Tue Nov  1 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.11-3
- require subversion-python

* Wed Jun  1 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.11-2
- in response to bug #708721:
-   remove webserver dependency, can run standalone
-   require httpd for httpd package
-   move spool directory to httpd package

* Wed May 18 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.11-1
- bump up to 1.1.11

* Wed Mar 16 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.10-1
- bump up to 1.1.10

* Mon Feb 21 2011 Bojan Smojver <bojan@rexursive.com> - 1.1.9-1
- bump up to 1.1.9

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Dec  6 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.8-1
- bump up to 1.1.8

* Fri Sep 10 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.7-1
- bump up to 1.1.7
- address bug #565805, allow access to templates from localhost

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Thu Jun  3 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.6-1
- bump up to 1.1.6
- drop patch for upstream issue #454

* Tue May 25 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.5-2
- patch upstream issue #454

* Tue Mar 30 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.5-1
- bump up to 1.1.5

* Thu Mar 11 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.4-1
- bump up to 1.1.4

* Fri Jan  8 2010 Bojan Smojver <bojan@rexursive.com> - 1.1.3-2
- patch upstream issue #445

* Wed Dec 23 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.3-1
- bump up to 1.1.3
- drop patch for upstream issue #427

* Wed Sep 23 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.2-5
- patch upstream issue #427

* Thu Aug 13 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.2-4
- try one more time

* Thu Aug 13 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.2-3
- better mimetypes.conf generation script

* Wed Aug 12 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.2-2
- fix replacement of various config variables

* Wed Aug 12 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.2-1
- bump up to 1.1.2
- security fix: validate the 'view' parameter to avoid XSS attack
- security fix: avoid printing illegal parameter names and values

* Tue Aug 11 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.1-3
- install mimetypes.conf
- populate mimetypes.conf with what pygments understands

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jun  4 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.1-1
- Bump up to 1.1.1

* Thu May 14 2009 Bojan Smojver <bojan@rexursive.com> - 1.1.0-1
- Final 1.1.0

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-0.beta1.1.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.1.0-0.beta1.1.1
- Rebuild for Python 2.6

* Thu Nov  6 2008 Bojan Smojver <bojan@rexursive.com> - 1.1.0-0.beta1.1
- Rebase to 1.1.x

* Mon Oct 27 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.7-2
- Depend on webserver to avoid pulling in Apache/mod_python (bug #457691)
- Provide viewvc-httpd package for mod_python specific configuration

* Wed Oct 15 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.7-1
- Bump up to 1.0.7

* Fri Sep 19 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.6-1
- Bump up to 1.0.6

* Fri Feb 29 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.5-1
- Bump up to 1.0.5

* Sun Jun  3 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.4-2
- Avoid import cycle errors (temporary fix)

* Tue May 15 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.4-1
- Bump up to 1.0.4

* Wed Mar 28 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-13
- Supply obsoletes/conflicts
  (suggestions by Peter Gordon, Bernard Johnson and Ville Skyttä)

* Thu Mar 22 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-12
- Drop selinux package, required context now in official policy

* Fri Mar 09 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-11
- Bump for tag

* Tue Mar 06 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-10
- Enable enscript only when available

* Tue Mar 06 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-9
- Enable cvsgraph

* Sun Mar 04 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-8
- EPEL support patch by Bernard Johnson

* Sat Mar 03 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-7
- Incorporate suggestions from package review process by Bernard Johnson

* Sat Mar 03 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-6
- Use restorecon instead of chcon

* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-5
- SELinux integration

* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-4
- Incorporate suggestions from package review process by Bernard Johnson

* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-3
- Move non-python files out of %%{python_sitelib}

* Thu Mar 01 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-2
- Incorporate suggestions from package review process by Bernard Johnson

* Thu Mar 01 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-1
- Initial release, 1.0.3
- Based on package provided by Dag Wieers