9958fee
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
9958fee
9958fee
# EL4 & EL5 do not have cvsgraph or enscript.. yet
9958fee
%if 0%{?rhel}
9958fee
%define with_cvsgraph_enscript 0
9958fee
%else
9958fee
%define with_cvsgraph_enscript 1
9958fee
%endif
9958fee
9958fee
# EL4 has a subversion that does not meet the minimum reqs for subversion
9958fee
%if 0%{?rhel} && "%rhel" < "5"
9958fee
%define with_subversion 0
9958fee
%else
9958fee
%define with_subversion 1
9958fee
%endif
9958fee
9958fee
9958fee
Name:           viewvc
32e49be
Version:        1.0.7
4794945
Release:        1%{?dist}
9958fee
Summary:        Browser interface for CVS and SVN version control repositories
9958fee
9958fee
Group:          Development/Tools
9958fee
License:        BSD
9958fee
URL:            http://www.viewvc.org/
9958fee
Source0:        http://www.viewvc.org/%{name}-%{version}.tar.gz
9958fee
Source1:        viewvc.conf
9958fee
Patch0:         viewvc-temp-location.patch
9958fee
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
9958fee
628650f
Obsoletes:      %{name}-selinux < 1.0.3-13
628650f
Conflicts:      selinux-policy < 2.5.10-2
c69dd44
9958fee
BuildArch:      noarch
9958fee
BuildRequires:  python-devel >= 2.0
9958fee
Requires:       mod_python, rcs, diffutils
9958fee
%if 0%{with_subversion}
9958fee
Requires:       subversion >= 1.2
9958fee
%endif
9958fee
%if 0%{with_cvsgraph_enscript}
9958fee
Requires:       enscript, cvsgraph
9958fee
%endif
9958fee
9958fee
%description
9958fee
ViewVC is a browser interface for CVS and Subversion version control
9958fee
repositories. It generates templatized HTML to present navigable directory,
9958fee
revision, and change log listings. It can display specific versions of files
9958fee
as well as diffs between those versions. Basically, ViewVC provides the bulk
9958fee
of the report-like functionality you expect out of your version control tool,
9958fee
but much more prettily than the average textual command-line program output.
9958fee
9958fee
%if 0%{!?with_subversion}
9958fee
This version only supports CVS repositories.
9958fee
%endif
9958fee
9958fee
%prep
9958fee
%setup -q
9958fee
%patch0 -p0 -b .temp-location
9958fee
9958fee
%build
9958fee
9958fee
%install
9958fee
%{__rm} -rf %{buildroot}
9958fee
%{__python} viewvc-install --destdir="%{buildroot}" --prefix="%{python_sitelib}/viewvc"
9958fee
9958fee
# Remove unneeded files
4794945
%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/.htaccess
9958fee
9958fee
# Move non-python to /usr/share
9958fee
%{__mkdir} -p %{buildroot}%{_datadir}/viewvc
9958fee
%{__mv} %{buildroot}%{python_sitelib}/viewvc/templates %{buildroot}%{_datadir}/viewvc
9958fee
9958fee
# Fix python files shebang and CONF_PATHNAME
9958fee
%{__perl} -pi \
9958fee
  -e 's|/usr/local/bin/python|%{_bindir}/python|g;' \
9958fee
  -e 's|\s*/usr/bin/env python|%{_bindir}/python|g;' \
9958fee
  -e 's|CONF_PATHNAME =.*|CONF_PATHNAME = r"%{_sysconfdir}/viewvc/viewvc.conf"|g;' \
9958fee
  $(find %{buildroot}%{python_sitelib}/viewvc/ -type f)
9958fee
9958fee
# Set mode 755 on executable scripts
9958fee
%{__grep} -rl '^#!' %{buildroot}%{python_sitelib}/viewvc | xargs %{__chmod} 0755
9958fee
9958fee
# Fix paths in configuration
9958fee
%{__perl} -pi \
9958fee
  -e 's|templates/|%{_datadir}/viewvc/templates/|g;' \
9958fee
  -e 's|^template_dir = .*|template_dir = %{_datadir}/viewvc/templates|g;' \
9958fee
  -e 's|^#docroot = .*|docroot = /viewvc-static|;' \
9958fee
  -e 's|^cvsgraph_conf = .*|cvsgraph_conf = %{_sysconfdir}/viewvc/cvsgraph.conf|;' \
9958fee
  %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
9958fee
9958fee
%if 0%{with_cvsgraph_enscript}
9958fee
%{__perl} -pi \
9958fee
  -e 's|^use_cvsgraph = .*|use_cvsgraph = 1|;' \
9958fee
  -e 's|^use_enscript = .*|use_enscript = 1|;' \
9958fee
  %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
9958fee
%endif
9958fee
9958fee
# Install config to sysconf directory
9958fee
%{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/viewvc.conf %{buildroot}%{_sysconfdir}/viewvc/viewvc.conf
9958fee
%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
9958fee
%{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf %{buildroot}%{_sysconfdir}/viewvc/cvsgraph.conf
9958fee
%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf
9958fee
9958fee
# Install Apache configuration
9958fee
%{__sed} -e s,__datadir__,%{_datadir}, \
9958fee
         -e s,__python_sitelib__,%{python_sitelib}, %{SOURCE1} > viewvc.conf
9958fee
%{__install} -Dp -m0644 viewvc.conf %{buildroot}/etc/httpd/conf.d/viewvc.conf
9958fee
9958fee
# mod_python files mustn't be executable since they don't have shebang
9958fee
# make rpmlint happy!
9958fee
%{__chmod} 0644 %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/*.py
9958fee
6b2e58e
# Rename viewvc.py to viewvc-mp.py for mod_python to avoid import cycle errors
6b2e58e
%{__mv} %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/viewvc.py \
6b2e58e
        %{buildroot}%{python_sitelib}/viewvc/bin/mod_python/viewvc-mp.py
6b2e58e
6b2e58e
# Kill patch backup file
6b2e58e
%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/lib/viewvc.py.temp-location
6b2e58e
9958fee
# Make spool directory for temp files
9958fee
%{__mkdir} -p %{buildroot}%{_localstatedir}/spool/viewvc
9958fee
9958fee
%clean
9958fee
%{__rm} -rf %{buildroot}
9958fee
9958fee
%files
9958fee
%defattr(-, root, root, -)
4794945
%doc CHANGES README INSTALL TODO COMMITTERS LICENSE.html docs
9958fee
%config(noreplace) %{_sysconfdir}/viewvc
9958fee
%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc.conf
9958fee
%{python_sitelib}/*
9958fee
%{_datadir}/*
9958fee
%attr(0700,apache,apache) %{_localstatedir}/spool/viewvc
9958fee
9958fee
%changelog
32e49be
* Wed Oct 15 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.7-1
32e49be
- Bump up to 1.0.7
32e49be
1ef89a7
* Fri Sep 19 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.6-1
1ef89a7
- Bump up to 1.0.6
1ef89a7
4794945
* Fri Feb 29 2008 Bojan Smojver <bojan@rexursive.com> - 1.0.5-1
4794945
- Bump up to 1.0.5
4794945
6b2e58e
* Sun Jun  3 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.4-2
6b2e58e
- Avoid import cycle errors (temporary fix)
6b2e58e
ec53f53
* Tue May 15 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.4-1
ec53f53
- Bump up to 1.0.4
ec53f53
c69dd44
* Wed Mar 28 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-13
628650f
- Supply obsoletes/conflicts
628650f
  (suggestions by Peter Gordon, Bernard Johnson and Ville Skyttä)
c69dd44
78cba07
* Thu Mar 22 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-12
78cba07
- Drop selinux package, required context now in official policy
78cba07
d72d0f8
* Fri Mar 09 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-11
d72d0f8
- Bump for tag
d72d0f8
9958fee
* Tue Mar 06 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-10
9958fee
- Enable enscript only when available
9958fee
9958fee
* Tue Mar 06 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-9
9958fee
- Enable cvsgraph
9958fee
9958fee
* Sun Mar 04 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-8
9958fee
- EPEL support patch by Bernard Johnson
9958fee
9958fee
* Sat Mar 03 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-7
9958fee
- Incorporate suggestions from package review process by Bernard Johnson
9958fee
9958fee
* Sat Mar 03 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-6
9958fee
- Use restorecon instead of chcon
9958fee
9958fee
* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-5
9958fee
- SELinux integration
9958fee
9958fee
* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-4
9958fee
- Incorporate suggestions from package review process by Bernard Johnson
9958fee
9958fee
* Fri Mar 02 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-3
9958fee
- Move non-python files out of %%{python_sitelib}
9958fee
9958fee
* Thu Mar 01 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-2
9958fee
- Incorporate suggestions from package review process by Bernard Johnson
9958fee
9958fee
* Thu Mar 01 2007 Bojan Smojver <bojan@rexursive.com> - 1.0.3-1
9958fee
- Initial release, 1.0.3
9958fee
- Based on package provided by Dag Wieers