diff --git a/distcc.spec b/distcc.spec index 0e62c3d..c9dd005 100644 --- a/distcc.spec +++ b/distcc.spec @@ -1,9 +1,14 @@ %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: 22%{?dist} Summary: Distributed C/C++ compilation +Group: Development/Tools License: GPLv2+ URL: https://github.com/distcc/distcc Source0: https://github.com/distcc/distcc/archive/v%{version}/%{name}-%{version}.tar.gz @@ -19,7 +24,7 @@ BuildRequires: libtool BuildRequires: popt-devel BuildRequires: libgnomeui-devel BuildRequires: pango-devel -BuildRequires: python2-devel +BuildRequires: python-devel BuildRequires: desktop-file-utils BuildRequires: avahi-devel BuildRequires: krb5-devel @@ -41,8 +46,11 @@ This package contains the Gnome frontend of the distcc monitoring tool. %package server Summary: Server for distributed C/C++ compilation +Group: Development/Tools License: GPLv2+ +#Requires(post): /sbin/chkconfig +#Requires(preun): /sbin/chkconfig Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units @@ -66,6 +74,7 @@ make %{?_smp_mflags} %install +rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # Move desktop file to right directory @@ -79,6 +88,9 @@ 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 distccd init file +#install -Dm 0755 %%{SOURCE2} $RPM_BUILD_ROOT%%{_sysconfdir}/init.d/distccd + # Install distcdd unit file mkdir -p $RPM_BUILD_ROOT%{_unitdir} install -Dm 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/distccd.service @@ -107,6 +119,25 @@ if [ $1 -ge 1 ] ; then /bin/systemctl try-restart distccd.service >/dev/null 2>&1 || : fi + +%postun +update-desktop-database &> /dev/null ||: + +%triggerun -- distcc-server < 3.1-5 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply distccd +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save distccd >/dev/null 2>&1 ||: + +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del distccd >/dev/null 2>&1 || : +/bin/systemctl try-restart distccd.service >/dev/null 2>&1 || : + + +%clean +rm -rf $RPM_BUILD_ROOT + + %files %doc AUTHORS doc/* NEWS README.pump TODO %doc COPYING INSTALL README survey.txt @@ -130,13 +161,18 @@ fi %files server +%defattr(-,root,root,-) %doc COPYING README %{_bindir}/distccd +#%%{_sysconfdir}/init.d/* %{_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 * Thu Feb 21 2019 Gwyn Ciesla - 3.2rc1-22