124 lines
4.2 KiB
RPMSpec
124 lines
4.2 KiB
RPMSpec
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
|
|
|
Name: viewmtn
|
|
Version: 0.10
|
|
Release: 3%{?dist}
|
|
|
|
Summary: Web interface for Monotone version control system
|
|
Group: Development/Tools
|
|
License: GPLv2+
|
|
|
|
URL: http://grahame.angrygoats.net/moinmoin/ViewMTN
|
|
Source0: http://grahame.angrygoats.net/source/%{name}/%{name}-%{version}.tgz
|
|
|
|
Source1: viewmtn.conf.httpd
|
|
Source2: viewmtn.conf.py
|
|
|
|
BuildArch: noarch
|
|
BuildRequires: python-devel
|
|
Requires: python-cheetah
|
|
Requires(pre): httpd
|
|
Requires: monotone >= 0.35
|
|
Requires: mod_wsgi
|
|
Requires: gnome-icon-theme
|
|
Requires: shared-mime-info
|
|
Requires: highlight
|
|
Requires: graphviz
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
|
%define mydata %{_datadir}/viewmtn
|
|
%define mypy %{python_sitelib}/viewmtn
|
|
%define mygraph %{_localstatedir}/cache/viewmtn-graph
|
|
|
|
%description
|
|
ViewMTN is a web interface to the Monotone distributed version
|
|
control system. It aims to provide a convenient and useful web
|
|
interface to Monotone. If you've used interfaces to other version
|
|
control systems, ViewMTN will be immediately familiar.
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
cat > __init__.py <<\EOF
|
|
from viewmtn import assemble_urls, web
|
|
urls, fvars = assemble_urls()
|
|
application = web.wsgifunc(web.webpyfunc(urls, fvars))
|
|
EOF
|
|
|
|
%build
|
|
%{__sed} -e s,__datadir__,%{_datadir}, \
|
|
-e s,__python_sitelib__,%{python_sitelib}, %{SOURCE1} > viewmtn.conf
|
|
%{__sed} -e s,__datadir__,%{_datadir}, \
|
|
-e s,__python_sitelib__,%{python_sitelib}, %{SOURCE2} > viewmtn.conf.py
|
|
%{__sed} -e s,/usr/bin,%{_bindir},g \
|
|
-e '/^dbfile/s,= .*$,'"= '%{mydb}',"\
|
|
-e '/^dynamic_uri_path/s,= .*$,'"= '/viewmtn/'," \
|
|
-e '/^static_uri_path/s,= .*$,'"= '/viewmtn-static/'," \
|
|
-e '/^templates_directory/s,= .*$,'"= '%{mydata}/templates/'," \
|
|
-e '/viewmtn-graph/s|: .*$|'": '%{mygraph}/',|" \
|
|
-e '/^running_under_apache2/s/$/ # not relevant to mod_wsgi setup/' \
|
|
config.py.example > config.py
|
|
|
|
cat >> config.py <<\EOF
|
|
|
|
# Get the local configuration linked from %{_sysconfdir}/.
|
|
from user_config import *
|
|
EOF
|
|
|
|
|
|
%install
|
|
rm -rf $RPM_BUILD_ROOT
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mypy}/fdo
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mypy}/web
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mydata}/templates
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mydata}/MochiKit
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{mygraph}
|
|
%{__install} -Dp -m 0644 viewmtn.conf \
|
|
$RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/viewmtn.conf
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy} *.py
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy}/fdo fdo/*.py
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mypy}/web web/*.py
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata}/templates templates/*.html
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata} \
|
|
static/*.gif static/*.css static/*.js
|
|
%{__install} -Dp -m 644 -t $RPM_BUILD_ROOT%{mydata}/MochiKit \
|
|
static/MochiKit/*.js
|
|
|
|
%{__install} -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
|
%{__install} -Dp -m 0644 viewmtn.conf.py \
|
|
$RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.py
|
|
|
|
mypy_rel=`echo %{mypy} | sed 's,/[^/]*,../,g;s,/$,,'`
|
|
%{__ln_s} -nf $mypy_rel%{_sysconfdir}/%{name}/conf.py \
|
|
$RPM_BUILD_ROOT%{mypy}/user_config.py
|
|
|
|
# Pacify overeager rpmlint #! checks.
|
|
find $RPM_BUILD_ROOT%{mypy} -type f -name '*.py' -print0 |
|
|
xargs -0 sed -i '1{/^#!/d;}'
|
|
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
%files
|
|
%defattr(-,root,root,-)
|
|
%doc README AUTHORS LICENSE ChangeLog TODO INSTALL
|
|
%{mypy}
|
|
%{mydata}
|
|
%dir %attr(0755,apache,apache) %{mygraph}
|
|
%config(noreplace) %{_sysconfdir}/httpd/conf.d/viewmtn.conf
|
|
%dir %{_sysconfdir}/%{name}
|
|
%config(noreplace) %{_sysconfdir}/%{name}/conf.py*
|
|
|
|
|
|
%changelog
|
|
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-3
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
|
|
|
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.10-2
|
|
- Rebuild for Python 2.6
|
|
|
|
* Sun Mar 23 2008 Roland McGrath <roland@redhat.com> - 0.10-1
|
|
- New package. Thanks to Thomas Moschny for packaging assistance.
|