File viewvc.spec of Package viewvc

# spec file for package viewvc
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define	apxs	%{_sbindir}/apxs2
%define	apache_libexecdir	%(%{apxs} -q LIBEXECDIR)
%define	apache_sysconfdir	%(%{apxs} -q SYSCONFDIR)
%define site_python	%(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
%define viewvc_dir /srv/viewvc
Name:           viewvc
Version:        1.1.22
Release:        0
Summary:        Browse a Subversion Repository with a Web Browser
License:        BSD-3-Clause
Group:          Development/Tools/Version Control
Source1:        viewvc.conf
Source99:       viewvc-rpmlintrc
Patch0:         viewvc-buglink.patch
BuildRequires:  apache2-devel
%if 0%{?sles_version} && 0%{?sles_version <= 11}
BuildRequires:  python-devel
BuildRequires:  pkgconfig(python)
BuildRequires:  pkgconfig(python-2.7)
BuildRequires:  pkgconfig(python2)
Requires:       subversion-python
Supplements:    packageand(subversion-server:apache2)
Provides:       subversion-viewcvs = %{version}
Provides:       viewcvs = %{version}
Obsoletes:      subversion-viewcvs < %{version}
Obsoletes:      viewcvs < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

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 prettier than the average
textual command-line program output.

ViewVC is the successor of ViewCVS.

%setup -q


rm -rf "lib/vclib/ccvs/rcsparse/test-data"
mkdir -p %{buildroot}/%{apache_sysconfdir}/conf.d
cp -avL %{SOURCE1} %{buildroot}/%{apache_sysconfdir}/conf.d/viewvc.conf
# viewvc
./viewvc-install --prefix "%{viewvc_dir}" --destdir %{buildroot}
# hack for usage under mod_python
# rename /srv/viewcvs/bin/mod_python/ to
# to prevent import cycle with a newer mod_python versions
mv %{buildroot}/srv/viewvc/bin/mod_python/ \
rm -f %{buildroot}/srv/viewvc/cvsgraph.conf.dist
sed '
s@^#docroot.*@docroot = /viewvc-docroot@
s@^default_root.*@default_root = your_unnamed_project@
s@^cvsgraph_conf.*@cvsgraph_conf = %{viewvc_dir}/cvsgraph.conf@
s@^hr_funout.*@hr_funout = 1@
s@^show_changed_paths.*@show_changed_paths = 0@
	your_unnamed_project : /srv/svn/repos/<your_unnamed_project> , \
	another_project : /srv/svn/repos/<another_project> \
' < conf/viewvc.conf.dist > %{buildroot}%{viewvc_dir}/viewvc.conf
diff -up conf/viewvc.conf.dist %{buildroot}%{viewvc_dir}/viewvc.conf || true
find %{buildroot}%{viewvc_dir} -type d | \
sed "s@%{buildroot}@%dir @" > files.viewvc
find %{buildroot}%{viewvc_dir} -type f | \
sed "s@%{buildroot}@@;/\/templates\/\|\.conf$/s@^@%config (noreplace) @" >> files.viewvc
cat files.viewvc

%files -f files.viewvc
%dir %{apache_sysconfdir}/conf.d
%config (noreplace) %{apache_sysconfdir}/conf.d/viewvc.conf

openSUSE Build Service is sponsored by