%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global mtn_snapshot 1 %global mtn_rev 0030ad67c4daf3d38193f558c48474ddbcf19d1a %global mtn_date 20100308 %if 0%{?mtn_snapshot} %global mtn_short %(echo %{mtn_rev} | cut -c-8) %endif Name: viewmtn Version: 0.10 Release: 6%{?mtn_short:.%{mtn_date}mtn%{mtn_short}}%{?dist} Summary: Web interface for Monotone version control system Group: Development/Tools License: GPLv2+ URL: http://viewmtn.1erlei.de/ %if 0%{?mtn_snapshot} # wget http://mtn-view.1erlei.de/revision/tar/%%{mtn_rev} -O- | # bzip2 -c > %%{name}-%%{mtn_short}.tar.bz2 Source0: %{name}-%{mtn_short}.tar.bz2 %else Source0: http://viewmtn.1erlei.de/downloads/%{name}-%{version}.tgz %endif Source1: viewmtn.conf.httpd Source2: viewmtn.conf.py BuildArch: noarch BuildRequires: python-devel Requires: python-cheetah Requires(pre): httpd Requires: monotone >= 0.46 Requires: mod_wsgi Requires: gnome-icon-theme Requires: shared-mime-info Requires: highlight Requires: graphviz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %global mydata %{_datadir}/viewmtn %global mypy %{python_sitelib}/viewmtn %global 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 %if 0%{?mtn_snapshot} %setup -q -n %{mtn_rev} %else %setup -q %endif 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 %{buildroot} install -d -m 755 %{buildroot}%{mypy}/fdo install -d -m 755 %{buildroot}%{mypy}/web install -d -m 755 %{buildroot}%{mydata}/templates install -d -m 755 %{buildroot}%{mydata}/MochiKit install -d -m 755 %{buildroot}%{mygraph} install -Dp -m 0644 viewmtn.conf \ %{buildroot}/%{_sysconfdir}/httpd/conf.d/viewmtn.conf install -Dp -m 644 -t %{buildroot}%{mypy} *.py install -Dp -m 644 -t %{buildroot}%{mypy}/fdo fdo/*.py install -Dp -m 644 -t %{buildroot}%{mypy}/web web/*.py install -Dp -m 644 -t %{buildroot}%{mydata}/templates templates/*.html install -Dp -m 644 -t %{buildroot}%{mydata} \ static/*.gif static/*.css static/*.js install -Dp -m 644 -t %{buildroot}%{mydata}/MochiKit \ static/MochiKit/*.js install -d -m 755 %{buildroot}%{_sysconfdir}/%{name} install -Dp -m 0644 viewmtn.conf.py \ %{buildroot}%{_sysconfdir}/%{name}/conf.py mypy_rel=`echo %{mypy} | sed 's,/[^/]*,../,g;s,/$,,'` ln -snf $mypy_rel%{_sysconfdir}/%{name}/conf.py \ %{buildroot}%{mypy}/user_config.py # Pacify overeager rpmlint #! checks. find %{buildroot}%{mypy} -type f -name '*.py' -print0 | xargs -0 sed -i '1{/^#!/d;}' %clean rm -rf %{buildroot} %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 * Fri Aug 6 2010 Thomas Moschny <thomas.moschny@gmx.de> - 0.10-6.20100308mtn0030ad67 - Update to latest head, to support monotone >= 0.46. - Minor specfile updates. * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.10-5 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * 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.