distcc/distcc.spec

200 lines
6.1 KiB
RPMSpec

#
# spec file for package distcc
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: distcc
Version: 3.2rc1
Release: 0
Summary: A fast, free distributed C/C++ compiler
License: GPL-2.0
Group: Development/Tools/Building
Url: https://code.google.com/p/distcc/
Source0: http://distcc.googlecode.com/files/%{name}-%{version}.tar.bz2
Source1: distccd.sysconfig
Source2: distccd.service
Source3: distccd.firewall
Patch0: distcc-3.0-fix-fortify.patch
Patch1: distcc-3.0-xinetd.patch
Patch2: distcc-3.2_rc1-freedesktop.patch
Patch3: distcc-3.2_rc1-gssapi.patch
Patch4: distcc-3.2_rc1-python.patch
Patch5: distcc-minilzo-2.08.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: make
BuildRequires: python
BuildRequires: systemd
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(avahi-client)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(libgnome-2.0)
BuildRequires: pkgconfig(libgnomeui-2.0)
BuildRequires: pkgconfig(libgssglue)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(python)
Recommends: %{name}-server = %{version}
Suggests: %{name}-gui = %{version}
%description
distcc is a program to distribute builds of C, C++, Objective C or Objective
C++ code across several machines on a network. distcc should always generate
the same results as a local build, is simple to install and use, and is
usually much faster than a local compile.
%package gui
Summary: GUI monitor for distcc server/client
Group: Development/Tools/Building
%description gui
distcc is a program to distribute builds of C, C++, Objective C or Objective
C++ code across several machines on a network. distcc should always generate
the same results as a local build, is simple to install and use, and is
usually much faster than a local compile.
%package server
Summary: Server for distributed C/C++ compilation
Group: Development/Tools/Building
Requires: %{name} = %{version}
%{?systemd_requires}
%description server
This package contains the compilation server needed to use %{name}.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# do not use date/time in the c files
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
sed -i \
-e "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" \
src/daemon.c src/help.c lzo/minilzo.c
autoreconf -fvi
%build
%configure \
--with-docdir=%{_docdir}/%{name} \
--disable-Werror \
--enable-rfc2553 \
--with-gtk \
--with-avahi \
--with-gnome \
--with-auth
# For some reason CC is not propagated to makefile and we get empty string
sed -i \
-e 's:CC = :CC = cc:' \
Makefile
make %{?_smp_mflags}
%install
%make_install
# service
mkdir -p %{buildroot}/%{_sbindir}
ln -sf service %{buildroot}/%{_sbindir}/rc%{name}d
install -D -m 0644 %{SOURCE2} %{buildroot}/%{_unitdir}/%{name}d.service
# sysconfig
install -Dm 644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}d
# firewall
install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}d
# compat links for env override
install -d %{buildroot}%{_libexecdir}/%{name}/bin
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/cc
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/gcc
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/g++
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/c++
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/cpp
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/clang
ln -sf %{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}/bin/clang++
# pointless installed file
rm -rf %{buildroot}%{_docdir}/distcc/INSTALL
# cleanups
%suse_update_desktop_file -r distccmon-gnome Development Building
%fdupes ${buildroot}
%pre server
%service_add_pre disccd.service
%post server
%fillup_only -n distccd
%service_add_post distccd.service
%preun server
%service_del_preun distccd.service
%postun server
%service_del_postun distccd.service
%post gui
%desktop_database_post
%postun gui
%desktop_database_postun
%files
%defattr(-,root,root)
%doc AUTHORS doc/* NEWS README.pump TODO
%doc COPYING README survey.txt
%dir %{_libexecdir}/distcc
%dir %{_libexecdir}/distcc/bin
%{_libexecdir}/distcc/bin/c++
%{_libexecdir}/distcc/bin/cc
%{_libexecdir}/distcc/bin/cpp
%{_libexecdir}/distcc/bin/g++
%{_libexecdir}/distcc/bin/gcc
%{_bindir}/distcc
%{_bindir}/distccmon-text
%{_bindir}/lsdistcc
%{_bindir}/pump
%{_mandir}/man1/distcc.1.*
%{_mandir}/man1/pump*
%{_mandir}/man1/distccmon-text.1.*
%dir %{_sysconfdir}/distcc
%config(noreplace) %{_sysconfdir}/%{name}/hosts
%files server
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/distccd
%{_unitdir}/distccd.service
%{_sbindir}/rcdistccd
%{_sysconfdir}/default/distcc
%{_sysconfdir}/distcc/*allow*
%{_mandir}/man1/distccd*
%{_mandir}/man1/include_server*
%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/distccd
%{_localstatedir}/adm/fillup-templates/*
%{python_sitearch}/include_server*
%files gui
%defattr(-,root,root)
%{_bindir}/distccmon-gnome
%{_datadir}/applications/distccmon-gnome.desktop
%{_datadir}/pixmaps/distccmon-gnome-icon.png