%define _hardened_build 1 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} # eval to 2.3 if python isn't yet present, workaround for no python in fc4 minimal buildroot %{!?python_version: %define python_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0]' || echo "2.3")} Name: distcc Version: 3.2rc1 Release: %mkrel 3 Summary: Distributed C/C++ compilation Group: Development/Tools License: GPLv2+ URL: http://distcc.org/ Source0: http://distcc.googlecode.com/files/%{name}-%{version}.tar.bz2 Source1: hosts.sample Source2: distccd.service Patch0: %{name}-3.2rc1-mga-fix-sv-coding-in-distccmon-gnome.desktop.patch #Patch0: distcc-2.18.3-avahi.patch BuildRequires: popt-devel BuildRequires: gnomeui2-devel BuildRequires: pango-devel BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: avahi-common-devel avahi-client-devel avahi-core-devel %description distcc is a program to distribute compilation of C or C++ code across several machines on a network. distcc should always generate the same results as a local compile, is simple to install and use, and is often two or more times faster than a local compile. %package server Summary: Server for distributed C/C++ compilation Group: Development/Tools License: GPLv2+ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %description server This package contains the compilation server needed to use %{name}. %prep %setup -q %patch0 -p0 #%%patch0 -p1 -b .avahi %build %configure --with-gnome --with-docdir=%{_datadir}/doc/%{name}-%{version} --disable-Werror %make %install %makeinstall_std # Move desktop file to right directory mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications mv $RPM_BUILD_ROOT%{_datadir}/%{name}/*.desktop $RPM_BUILD_ROOT%{_datadir}/applications/ sed -i 's@Icon=@Icon=%{_datadir}/%{name}/@' $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop # Install sample hosts file install -Dm 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/hosts # Install sample distccd config file install -Dm 0644 contrib/redhat/sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/distccd # Install distcdd unit file mkdir -p $RPM_BUILD_ROOT%{_unitdir} install -Dm 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/distccd.service %post server #[ $1 -lt 2 ] && /sbin/chkconfig --add distccd ||: if [ $1 -eq 1 ] ; then # Initial installation /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %preun server #[ $1 -eq 0 ] && /sbin/chkconfig --del distccd ||: if [ $1 -eq 0 ] ; then # Package removal, not upgrade /usr/bin/systemctl --no-reload disable distccd.service > /dev/null 2>&1 || : /usr/bin/systemctl stop distccd.service > /dev/null 2>&1 || : fi %postun server /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /usr/bin/systemctl try-restart distccd.service >/dev/null 2>&1 || : fi %files %doc %{_datadir}/doc/%{name}-%{version} %{_bindir}/distcc %{_bindir}/distccmon* %{_bindir}/lsdistcc %{_bindir}/pump %{_mandir}/man1/distcc.* %{_mandir}/man1/distccmon* %{_datadir}/%{name} %{_datadir}/applications/*.desktop %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/hosts %files server %doc COPYING README %{_bindir}/distccd %{_unitdir}/* %{_sysconfdir}/default/distcc %{_sysconfdir}/distcc/*allow* %{_mandir}/man1/distccd* %{_mandir}/man1/include_server* %{_mandir}/man1/pump* %config(noreplace) %{_sysconfdir}/sysconfig/distccd %{python_sitearch}/include_server* %changelog * Fri Jan 11 2013 umeabot <umeabot> 3.2rc1-3.mga3 + Revision: 348827 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Fri Jan 04 2013 kamil <kamil> 3.2rc1-2.mga3 + Revision: 338794 - add P0: mga-fix-sv-coding-in-distccmon-gnome.desktop.patch - remove triggerrun - adapt for Mageia - imported package distcc