Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 0a076bb4e61c3389e97621fd648744bd > files > 4

viewvc-1.1.17-2.mga3.src.rpm

Name:           viewvc
Version:        1.1.17
Release:        %mkrel 2
Epoch:          0
Summary:        Browser interface for CVS and Subversion version control repositories
License:        BSD
Group:          System/Servers
URL:            http://www.viewvc.org/
Source0:        http://viewvc.tigris.org/files/documents/3330/49243/%{name}-%{version}.tar.gz
Patch0:         %{name}-tools.patch
Patch1:         %{name}-1.1.14-fhs.patch
Requires:       apache
Requires(post): rpm-helper
Requires(postun): rpm-helper
BuildRequires:  python
Requires:       python
Suggests:       python-svn
BuildArch:      noarch

%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.

Here are some of the additional features of ViewVC:

    * Support for filesystem-accessible CVS and Subversion repositories.
    * Individually configurable virtual host support.
    * Line-based annotation/blame display (CVS only).
    * Revision graph capabilities (via integration with CvsGraph) (CVS 
      only).
    * Syntax highlighting support (via integration with GNU enscript).
    * Bonsai-like repository query facilities.
    * Template-driven output generation.
    * Colorized, side-by-side differences.
    * Tarball generation (by tag/branch for CVS, by revision for 
      Subversion).
    * I18N support based on the Accept-Language request header.
    * Ability to run either as CGI script or as a standalone server.
    * Regexp-based file searching.
    * INI-like configuration file (as opposed to requiring actual code 
      tweaks).

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1 -b .fhs

%build

%install
%{__rm} -rf %{buildroot}
%{__python} ./viewvc-install --destdir=%{buildroot} --prefix=%{_datadir}/%{name}

# remove uneeded files
%{__rm} -f %{buildroot}%{_datadir}/%{name}/bin/mod_python/.htaccess

# fix python files perms and shellbang
%{__perl} -pi \
        -e 's|/usr/local/bin/python|%{_bindir}/python|g;' \
        -e 's|\s*/usr/bin/env python|%{_bindir}/python|g;' \
        -e 's|CONF_PATHNAME =.*|CONF_PATHNAME = r"%{_sysconfdir}/%{name}/viewvc.conf"|g;' \
        `%{_bindir}/find %{buildroot}%{_datadir}/%{name} -type f` 

# fix paths in configuration
%{__perl} -pi \
  -e 's|^#template_dir = .*|template_dir = %{_datadir}/%{name}/templates/|g;' \
  -e 's|^#docroot = .*|docroot = /%{name}/static|;' \
  -e 's|^#cvsgraph_conf = .*|cvsgraph_conf = %{_sysconfdir}/%{name}/cvsgraph.conf|;' \
  -e 's|^#mime_types_files = .*|mime_types_files = %{_sysconfdir}/%{name}/mimetypes.conf, %{_sysconfdir}/httpd/conf/mime.types|;' \
  %{buildroot}%{_datadir}/%{name}/viewvc.conf

# install config to sysconf directory
%{__mkdir_p} %{buildroot}%{_sysconfdir}/%{name}
%{__install} -m 644 %{buildroot}%{_datadir}/%{name}/viewvc.conf %{buildroot}%{_sysconfdir}/%{name}/viewvc.conf
%{__rm} -f %{buildroot}%{_datadir}/%{name}/viewvc.conf
%{__install} -m 644 %{buildroot}%{_datadir}/%{name}/cvsgraph.conf %{buildroot}%{_sysconfdir}/%{name}/cvsgraph.conf
%{__rm} -f %{buildroot}%{_datadir}/%{name}/cvsgraph.conf
%{__install} -m 644 %{buildroot}%{_datadir}/%{name}/mimetypes.conf %{buildroot}%{_sysconfdir}/%{name}/mimetypes.conf
%{__rm} -f %{buildroot}%{_datadir}/%{name}/mimetypes.conf

# compile the python files
%{_bindir}/find %{buildroot}%{_datadir}/%{name}/lib -type f -name "*.pyc" | %{_bindir}/xargs %{__rm}
%{__python} -O %{_libdir}/python%{pyver}/compileall.py %{buildroot}%{_datadir}/%{name}/lib

# apache configuration
%{__mkdir_p} %{buildroot}%{_webappconfdir}
%{__cat} > %{buildroot}%{_webappconfdir}/%{name}.conf <<EOF
# %{name} configuration

Alias /%{name}/static %{_datadir}/%{name}/templates/docroot

<Directory %{_datadir}/%{name}/templates/docroot>
    Require local granted
    ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf"
</Directory>

Alias /%{name} %{_datadir}/%{name}/bin/cgi

<Directory %{_datadir}/%{name}/bin/cgi>
    Require local granted
    ErrorDocument 403 "Access denied per %{_webappconfdir}/%{name}.conf"
    DirectoryIndex viewvc.cgi
</Directory>
EOF

# set mode 755 on executable scripts
%{__grep} -rl '^#!' %{buildroot}%{_datadir}/%{name} | %{_bindir}/xargs %{__chmod} 755

cat >README.mga <<EOF
Mageia RPM specific notes
=========================

Setup
-----
The setup used here differs from default one in order to achieve better FHS
compliance:

- the configuration file is located at /etc/viewvc/viewvc.conf
- the other files are in /usr/share/viewvc

Post-installation
-----------------
You have manually to create the MySQL database if you want to use query mode.

Additional useful packages
--------------------------
- cvs and rcs provide a web interface for CVS repositories
- python-svn provides a web interface for SVN repositories
- MySQL-python and a MySQL database are needed for query mode
- apache-mod_python, will be accessible at http://localhost/viewvc-mp (instead
  of the cgi files)
EOF

%files
%doc CHANGES COMMITTERS INSTALL LICENSE.html README README.mga docs/
%config(noreplace) %{_sysconfdir}/%{name}
%config(noreplace) %{_webappconfdir}/%{name}.conf
%{_datadir}/%{name}


%changelog

* Mon Jan 14 2013 umeabot <umeabot> 0:1.1.17-2.mga3
+ Revision: 385412
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Thu Oct 25 2012 guillomovitch <guillomovitch> 0:1.1.17-1.mga3
+ Revision: 310105
- new version

* Wed Oct 24 2012 luigiwalser <luigiwalser> 0:1.1.15-3.mga3
+ Revision: 309707
- add patch from fedora to fix CVE-2012-4533

* Sat Sep 08 2012 guillomovitch <guillomovitch> 0:1.1.15-2.mga3
+ Revision: 290475
- make webapp configuration file compatible with apache 2.4
- drop mod_python support in webapp configuration file, it doesn't exist anymure

* Wed Jul 04 2012 dams <dams> 0:1.1.15-1.mga3
+ Revision: 267711
- new version 1.1.15

* Wed Jun 13 2012 guillomovitch <guillomovitch> 0:1.1.14-1.mga3
+ Revision: 260277
- FHS compliance: move everything under %%{_datadir}/name
- default configuration now offers consistent access, wether mod_python is
  installed or not
- drop old obsoletes tag
- new version
- spec cleanup

* Sat Jun 09 2012 zezinho <zezinho> 0:1.1.13-2.mga3
+ Revision: 258863
- add a suggests for python-svn, as it does not work on svn repos without it

* Sun Mar 04 2012 supp <supp> 0:1.1.13-1.mga2
+ Revision: 217646
- update to latest version - 1.1.13

* Fri Nov 04 2011 fwang <fwang> 0:1.1.12-1.mga2
+ Revision: 162610
- new version 1.1.12

* Thu May 19 2011 dmorgan <dmorgan> 0:1.1.11-1.mga1
+ Revision: 99736
- Update to version 1.1.11 ( sec fix )
  Remove buildroot
  Remove Mandriva word

* Thu Apr 14 2011 tv <tv> 0:1.1.9-1.mga1
+ Revision: 84871
- new release

* Tue Jan 11 2011 supp <supp> 0:1.1.8-1.mga1
+ Revision: 6530
- clean up archaic macros!
- imported package viewvc