%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") Summary: Web viewer for projects in bazaar Name: loggerhead Version: 1.10 Release: 1%{?dist} License: GPLv2+ Group: Applications/System URL: https://launchpad.net/loggerhead Source0: http://launchpad.net/loggerhead/%{version}/%{version}/+download/loggerhead-%{version}.tar.gz Source1: loggerhead.init Source2: loggerhead.sysconfig BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(pre): /usr/sbin/useradd Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig, /sbin/service Requires(postun): /sbin/service Requires: python-simpletal Requires: python-paste Requires: python-paste-deploy BuildArch: noarch %description Web viewer for projects in bazaar. It can be used to navigate a branch history, annotate files, view patches, perform searches, etc. It's originally based on bazaar-webserve, which is itself based on hgweb for Mercurial. %prep # We need -c since the tarball doesn't include the usual single clean directory %setup -q -c %build %{__python} setup.py build %install %{__rm} -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} # None of the scripts get installed above %{__mkdir_p} %{buildroot}%{_bindir} %{__install} -p -m0755 serve-branches start-loggerhead stop-loggerhead \ %{buildroot}%{_bindir}/ # None of the man pages get installed above %{__mkdir_p} %{buildroot}%{_mandir}/man1 %{__install} -p -m0644 serve-branches.1 start-loggerhead.1 stop-loggerhead.1 \ %{buildroot}%{_mandir}/man1/ # Install example configuration %{__install} -D -p -m0644 loggerhead.conf.example \ %{buildroot}%{_sysconfdir}/loggerhead.conf # Install init script and sysconfig entry %{__install} -D -p -m0755 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/init.d/loggerhead %{__install} -D -p -m0644 %{SOURCE2} \ %{buildroot}%{_sysconfdir}/sysconfig/loggerhead # We install our own doc, so remove this %{__rm} -f %{buildroot}%{_datadir}/doc/loggerhead/loggerhead.conf.example # Log directory and PID directory used by the init script %{__mkdir_p} %{buildroot}/var/log/loggerhead %{__mkdir_p} %{buildroot}/var/run/loggerhead %clean %{__rm} -rf %{buildroot} %pre # Create system account /usr/sbin/useradd -c "Loggerhead" -r -M -d / -s /sbin/nologin \ loggerhead &>/dev/null || : %post if [ $1 -eq 1 ]; then /sbin/chkconfig --add loggerhead fi %preun if [ $1 -eq 0 ]; then /sbin/service loggerhead stop >/dev/null 2>&1 || : /sbin/chkconfig --del loggerhead fi %postun if [ $1 -ge 1 ]; then /sbin/service loggerhead condrestart >/dev/null 2>&1 || : fi %files %defattr(-,root,root,-) %doc COPYING.txt NEWS README.txt loggerhead.conf.example %{_sysconfdir}/init.d/loggerhead %config(noreplace) %{_sysconfdir}/loggerhead.conf %config(noreplace) %{_sysconfdir}/sysconfig/loggerhead %{_bindir}/serve-branches %{_bindir}/start-loggerhead %{_bindir}/stop-loggerhead %{python_sitelib}/loggerhead/ %{_mandir}/man1/serve-branches.1* %{_mandir}/man1/start-loggerhead.1* %{_mandir}/man1/stop-loggerhead.1* %attr(0775,loggerhead,loggerhead) /var/log/loggerhead %attr(0775,loggerhead,loggerhead) /var/run/loggerhead %changelog * Mon May 18 2009 Matthias Saou 0.10-1 - Initial RPM release.