%bcond_without fedora %global pkglibexecdir %_libexecdir/%name %global logfile %_var/log/distccd.log %global username distcc %global uid 17 %global handled_progs gcc g++ cc c++ gcc296 g++296 gcc32 c++32 g++32 gcc34 c++34 g++34 %global handled_pkgs gcc, gcc-c++, compat-gcc, compat-gcc-c++, compat-gcc-32, compat-gcc-32-c++, gcc34, gcc34-c++ %{!?release_func:%global release_func() %1%{?dist}} Name: distcc Version: 2.18.3 Release: %release_func 6 Summary: A free distributed C/C++ compiler system Group: Development/Tools License: GPL URL: http://distcc.samba.org/ Source0: http://distcc.samba.org/ftp/distcc/%name-%version.tar.bz2 Source1: http://distcc.samba.org/ftp/distcc/%name-%version.tar.bz2.asc Source10: distcc.sh Patch0: distcc-2.18.3-icon.patch BuildRoot: %_tmppath/%name-%version-%release-root BuildRequires: python popt Requires(triggerin): coreutils Requires(triggerpostun): coreutils Requires(preun): coreutils %package gnome Summary: Gnome tools for distcc Group: Applications/System Requires: %name = %version-%release BuildRequires: libgnomeui-devel BuildRequires: desktop-file-utils Requires(post): gtk2 Requires: gnome-icon-theme %package server Summary: The distcc daemon Group: System Environment/Daemons ## Do not require an init-method for now; 'initng' provides already a ## distcc initscript but not the required 'init(%name)'. Invocation by ## ssh works out-of-the box and adding an empty -server-ssh subpackage ## would cause too much discussion probably. # Requires: init(%name) ## The base package is not required but prevent version mix Conflicts: %name < %version-%release Conflicts: %name > %version-%release BuildRequires: fedora-usermgmt-devel Provides: user(%username) = %uid Provides: group(%username) = %uid Requires(pre): /etc/logrotate.d Requires(postun): /etc/logrotate.d Requires(missingok): logrotate %{?FE_USERADD_REQ} %package server-sysv Summary: SysV initscripts for the distcc daemon Group: System Environment/Base Source20: distccd.sysv Source21: distccd.sysconfig Provides: init(%name) = sysv Requires: initscripts Requires: %name-server = %version-%release Requires(post): %name-server Requires(post): initscripts Requires(preun): initscripts Requires(pre): %_initrddir group(%username) Requires(postun): %_initrddir %package server-xinetd Summary: The xinetd initscripts for the distcc daemon Group: System Environment/Base Provides: init(%name) = xinetd Requires: xinetd Requires: %name-server = %version-%release %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. %description gnome 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. This package contains a GNOME2 frontend to monitor the distcc tasks. %description server 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. This package contains the 'distccd' daemon %description server-sysv 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. This package contains SysV compliant initscripts for 'distccd'. %description server-xinetd 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. This package contains xinetd scripts for 'distccd'. %prep %setup -q %patch0 -p1 -b .icon touch -r contrib/redhat/xinetd .stamp.xinetd # removal of '"' is the main reason for the patch, not the %logfile... sed -i -e 's!"/var/log/distccd.log"!%logfile!g' \ contrib/redhat/xinetd touch -r .stamp.xinetd contrib/redhat/xinetd %build %configure --with-gnome --enable-rfc2553 make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT _doc make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%_sysconfdir/{sysconfig,profile.d,logrotate.d,xinetd.d} \ $RPM_BUILD_ROOT%_var/{log,run/distccd} \ $RPM_BUILD_ROOT{%_initrddir,%pkglibexecdir/bin} \ $RPM_BUILD_ROOT%_datadir/icons/hicolor/48x48/apps d=$RPM_BUILD_ROOT%_sysconfdir/profile.d/distcc.sh sed -e 's!/usr/lib!%_libdir!g; s!/usr/libexec/distcc!%pkglibexecdir!g; s!/usr/bin!%_bindir!g' %SOURCE10 > "$d" chmod 0644 "$d" touch -r %SOURCE10 "$d" touch $RPM_BUILD_ROOT%logfile mv $RPM_BUILD_ROOT%_datadir/doc/%name _doc rm -rf _doc/example ## The gnome stuff desktop-file-install --vendor fedora --mode 644 --delete-original \ --remove-category=Application \ --add-category=Network \ --dir $RPM_BUILD_ROOT%_datadir/applications \ $RPM_BUILD_ROOT%_datadir/%name/distccmon-gnome.desktop mv $RPM_BUILD_ROOT%_datadir/distcc/*.png \ $RPM_BUILD_ROOT%_datadir/icons/hicolor/48x48/apps/ ## The SysV stuff install -p -m0555 %SOURCE20 $RPM_BUILD_ROOT%_initrddir/distccd install -p -m0644 %SOURCE21 $RPM_BUILD_ROOT%_sysconfdir/sysconfig/distccd ## The xinetd stuff install -p -m0644 contrib/redhat/xinetd $RPM_BUILD_ROOT%_sysconfdir/xinetd.d/distccd ## The logrotate stuff install -p -m0644 contrib/redhat/logrotate $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/distccd %global prog_loop\ for name in %handled_progs; do \ for c in $name %_target_cpu-%_target_vendor-%_target_os-$name ; do ## Create symlinks which will be marked as %ghost %prog_loop ln -sf %_bindir/distcc $RPM_BUILD_ROOT%pkglibexecdir/bin/$c done; done %triggerin -- %handled_pkgs %prog_loop [ ! -x %_bindir/$c ] || ln -sf %_bindir/distcc %pkglibexecdir/bin/$c done; done %triggerpostun -- %handled_pkgs %prog_loop [ -x %_bindir/$c ] || rm -f %pkglibexecdir/bin/$c done; done %post gnome touch --no-create %_datadir/icons/hicolor || : %_bindir/gtk-update-icon-cache --quiet %_datadir/icons/hicolor || : %postun gnome touch --no-create %_datadir/icons/hicolor || : %_bindir/gtk-update-icon-cache --quiet %_datadir/icons/hicolor || : %pre server %__fe_groupadd %uid -r %username &>/dev/null || : %__fe_useradd %uid -r -s /sbin/nologin -M -d %pkglibexecdir \ -c 'distcc user' -g %username %username &>/dev/null || : %postun server %__fe_userdel %username &>/dev/null || : %__fe_groupdel %username &>/dev/null || : %post server-sysv /sbin/chkconfig --add distccd %preun server-sysv test "$1" != 0 || { %_initrddir/distccd stop &>/dev/null || : /sbin/chkconfig --del distccd } %postun server-sysv test "$1" = 0 || %_initrddir/distccd condrestart &>/dev/null %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc _doc/* %config %_sysconfdir/profile.d/* %_bindir/distcc %_bindir/distccmon-text %_mandir/man1/distcc.* %_mandir/man1/distccmon-text.* %dir %pkglibexecdir %dir %pkglibexecdir/bin %ghost %pkglibexecdir/bin/* %files gnome %defattr(-,root,root,-) %_bindir/distccmon-gnome %_datadir/applications/*.desktop %_datadir/icons/hicolor/48x48/apps/*gnome*.png %files server %defattr(-,root,root,-) %_bindir/distccd %_mandir/man1/distccd.* %config(noreplace) %_sysconfdir/logrotate.d/distccd %config %ghost %logfile %files server-sysv %defattr(-,root,root,-) %_initrddir/distccd %config(noreplace) %_sysconfdir/sysconfig/distccd %dir %attr(0775,root,%username) %_var/run/distccd %files server-xinetd %defattr(-,root,root,-) %config(noreplace) %_sysconfdir/xinetd.d/distccd %changelog * Sat Aug 25 2007 Enrico Scholz - 2.18.3-6 - fixed profile script by appending a missing ':' * Sat Mar 31 2007 Enrico Scholz - 2.18.3-5 - require main package by -gnome - use %%_bindir macro instead of /usr/bin to create links to the compilers * Sun Mar 18 2007 Enrico Scholz - 2.18.3-5 - moved symlinks from /usr/share/distcc/bin to /usr/libexec/distcc/bin - handle symlinks with %%ghost instead of removing them manually - use CCACHE_PREFIX in the profile script - followed nonsense^Wrule-of-the-day and removed %%config from init-scripts, added big 'DO NOT MODIFY' banners to it and made it 0555 - ship the icon only in the them directory and apply patch to use gtk_window_set_icon_name() instead of gtk_window_set_icon_from_file() * Sat Mar 17 2007 Enrico Scholz - 2.18.3-4 - workaround bug #232761 in desktop-file-utils by using long '--mode' instead of '-m' - moved away from -lsb initstyle and use proprietary RH sysv initstyle instead of - cleaned up categories of the desktop file * Mon Jan 29 2007 Enrico Scholz - 2.18.3-2 - cleanups - updated icon-cache scriptlets - removed empty (ssh), unavailable (minit) and conflicting (initng) initscripts * Wed Aug 16 2006 Enrico Scholz - 2.18.3-1.8 - simplified LSB initscripts and support only one $DISTCC_OPTS variable - ship sample sysconfig file for LSB - use rpm macros to create the platform tuple instead of hardcoding 'i386-redhat-linux' - added '%%bcond_without fedora' * Wed Aug 9 2006 Enrico Scholz - 2.18.3-1.6 - bound a %%postun script to -gnome subpackage - use %%bcond* macros * Sun Jul 9 2006 Enrico Scholz - 2.18.3-1.5 - updated to new fedora-usermgmt code - updated to new ccache path - added distccmon-gnome-icon.png to the pkgdatadir * Mon Mar 6 2006 Enrico Scholz - 2.18.3-1.3 - added 'desktop-file-utils' BR - moved the gnome icon the a common place - added -server-xinetd subpackage - added -server-ssh subpackage for ssh-setup - added logrotate support * Sat Nov 26 2005 Enrico Scholz - 2.18.3-0.6 - initial built