# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global username bitten-slave %global homedir %_var/lib/%username %define svnrev 519 Name: bitten Version: 0.6 Release: 4.svn%{svnrev}%{?dist} Summary: A continuous integration plugin for Trac Group: Development/Tools License: BSD URL: http://bitten.edgewall.org # Source comes from SVN right now: svn co -r %{svnrev} http://svn.edgewall.org/repos/bitten/trunk bitten; \ # cd bitten; \ # python setup.py sdist --formats gztar # Source is now in the dist subdirectory. Source0: Bitten-%{version}dev-r%{svnrev}.tar.gz Source1: bitten-slave.conf Source2: bitten-slave.init Source3: bitten-slave.sysconf Source4: bitten-slave.logrotate Patch0: bitten-config-generalization.patch Patch1: bitten-form-login.patch Patch2: bitten-ignore-rmtree-errors.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools %description Bitten is a Python-based framework for collecting various software metrics via continuous integration. It builds on Trac to provide an integrated web-based user interface. %package master Summary: A continuous integration plugin for Trac Group: Development/Tools Requires: trac >= 0.10.4, python-setuptools Requires: bitten-common %description master Bitten is a Python-based framework for collecting various software metrics via continuous integration. It builds on Trac to provide an integrated web-based user interface. This package includes the Bitten master. It integrates into Trac and will supply Bitten slaves with build orders. %package common Summary: Common files for Bitten master and slave Group: Development/Libraries %description common This package contains files common to the Bitten build master and slave. %package slave Summary: Bitten build slave Group: Development/Tools Requires: bitten-common Requires: python-setuptools Requires(pre): %{_sbindir}/useradd Requires(postun): %{_sbindir}/userdel %description slave Bitten build slave. %prep %setup -q -n Bitten-%{version}dev-r%{svnrev} %patch0 -p0 %patch1 -p0 %patch2 -p0 %build %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT # skip-build doesn't work on el4 %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} mkdir -p $RPM_BUILD_ROOT%{_initrddir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d mkdir -p $RPM_BUILD_ROOT%{_var}/lib/bitten-slave sed -e 's/@DISTRO@/Fedora/g' -e 's/@DISTRO_VERSION@/%{fedora}/g' %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/bitten-slave.conf cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/bitten-slave cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/bitten-slave cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/bitten-slave %clean rm -rf $RPM_BUILD_ROOT %pre slave id '%username' >/dev/null 2>&1 || %{_sbindir}/useradd -r -d %homedir -s /sbin/nologin -c 'Bitten Slave' %username || : %postun slave test "$1" = "0" && %{_sbindir}/userdel -r %username %files common %defattr(-,root,root,-) %dir %{python_sitelib}/bitten/ # For noarch packages: sitelib %{python_sitelib}/bitten/__init__.py* %{python_sitelib}/bitten/build/api.py* %{python_sitelib}/bitten/build/config.py* %{python_sitelib}/bitten/build/__init__.py* %{python_sitelib}/bitten/recipe.py* %{python_sitelib}/bitten/util/ %{python_sitelib}/Bitten*/ %files master %defattr(-,root,root,-) %doc COPYING README.txt ChangeLog doc/*.txt # For noarch packages: sitelib %{python_sitelib}/bitten/admin.py* %{python_sitelib}/bitten/api.py* %{python_sitelib}/bitten/htdocs/ %{python_sitelib}/bitten/main.py* %{python_sitelib}/bitten/master.py* %{python_sitelib}/bitten/model.py* %{python_sitelib}/bitten/queue.py* %{python_sitelib}/bitten/report/ %{python_sitelib}/bitten/templates/ %{python_sitelib}/bitten/upgrades.py* %{python_sitelib}/bitten/web_ui.py* %files slave %defattr(-,root,root,-) # For noarch packages: sitelib %config(noreplace) %attr(640,%username,%username) %{_sysconfdir}/bitten-slave.conf %config(noreplace) %{_sysconfdir}/sysconfig/bitten-slave %config(noreplace) %{_sysconfdir}/logrotate.d/bitten-slave %{_bindir}/bitten-slave %{python_sitelib}/bitten/slave.py* %{python_sitelib}/bitten/build/*tools.py* %{_initrddir}/bitten-slave %dir %attr(-,%username,%username) %{_var}/lib/bitten-slave %changelog * Sat Jan 26 2008 Tim Niemueller 0.6svn519-4 - Added ignore-rmtree-error patch - Rename master package to bitten-master - Added init script - Added config files - Create custom user for bitten-slave - Added bitten-slave builddir - Added logrotate config * Mon Jan 14 2008 Tim Niemueller 0.6svn519-3 - Added config generalization patch - Fixes to form-login patch to make it work, support for storing credentials in config file - Provide example config file * Tue Jan 08 2008 Tim Niemueller 0.6svn519-2 - Moved some files from slave to common - Added form-login patch from #219 * Mon Jan 07 2008 Tim Niemueller 0.6svn519-1 - Initial revision based on trac-git-plugin spec file