File icecream.spec of Package icecream

# spec file for package icecream
# 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
# icecream 0

Name:           icecream
BuildRequires:  gcc-c++
%if 0%{?suse_version} > 1110
BuildRequires:  libcap-ng-devel
BuildRequires:  automake
BuildRequires:  lzo-devel
Summary:        For Distributed Compile in the Network
License:        GPL-2.0+ and LGPL-2.1+
Group:          Development/Tools/Building
Requires:       /bin/tar
Requires:       /usr/bin/bzip2
%if 0%{?suse_version}
PreReq:         %fillup_prereq
PreReq:         %insserv_prereq
PreReq:         /usr/sbin/useradd
PreReq:         /usr/sbin/groupadd
Requires:       gcc-c++
Requires:       logrotate
Version:        1.0.1
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# PATCH-FIX-UPSTREAM 0db4080dccd62209002c3a51cbdd350a2951ad82
Patch1:         0001-handle-HOME-not-being-set.patch
Patch2:         0002-icecc-fix_s390_build.patch
# PATCH-FIX-UPSTREAM 69981a3f4acae1da5342c7402e68a5ce55900008
Patch3:         0003-force_local_job_for_charset.patch
# PATCH-FIX-UPSTREAM fix for CVE-2014-4607
Patch4:         0004-remove-broken-minilzo.patch

icecream is the next generation distcc.

%package -n libicecream-devel
Summary:        For Distributed Compile in the Network
Group:          Development/Tools/Building
Requires:       libstdc++-devel
%if 0%{?suse_version} > 1110
Requires:       libcap-ng-devel

%description -n libicecream-devel
icecream is the next generation distcc.

%package -n icecream-clang-wrappers
Summary:        Distributed Compile Wrappers for Clang
Group:          Development/Tools/Building
Requires:       clang
Requires:       icecream
Supplements:    packageand(icecream:clang)

%description -n icecream-clang-wrappers
Wrapper symlinks for clang/clang++ for icecream distributed building.

%setup -q -n icecc-%{version}
# DO NOT ADD PATCHES without github reference
%patch1 -p1
%patch3 -p1
%patch4 -p1

%configure \
%if 0%{?suse_version} >= 1230
    --enable-clang-rewrite-includes \
    --enable-clang-wrappers \
    --libexecdir %_libexecdir
make %{?jobs:-j %jobs}


# Create symlinks in /opt/icecream/bin on openSUSE <= 1220
%if 0%{?suse_version} <= 1220
  mkdir -p $RPM_BUILD_ROOT/opt/icecream/bin
  for i in g++ gcc cc c++ clang++ clang; do
    ln -sf %_bindir/icecc $RPM_BUILD_ROOT/opt/icecream/bin/$i

%stop_on_removal icecream

/usr/sbin/groupadd -r icecream 2> /dev/null || :
/usr/sbin/useradd -r -g icecream -s /bin/false -c "Icecream Daemon" -d /var/cache/icecream icecream 2> /dev/null || :

# older icecream versions may have left some files owned by root:root in the cache
rm -rf -- %_localstatedir/cache/icecream/*
%if 0%{?suse_version}
%{fillup_and_insserv -n icecream icecream}

%restart_on_update icecream

%config %_sysconfdir/logrotate.d/icecream
%config %_sysconfdir/init.d/icecream
%exclude %_libexecdir/icecc/bin/clang
%exclude %_libexecdir/icecc/bin/clang++
%if 0%{?suse_version}
%if 0%{?suse_version} <= 1220
%exclude /opt/icecream/bin/clang
%exclude /opt/icecream/bin/clang++
%attr(-,icecream,icecream) %_localstatedir/cache/icecream
%attr(-,icecream,icecream) %_localstatedir/log/icecream

%files -n libicecream-devel

%files -n icecream-clang-wrappers
%if 0%{?suse_version} <= 1220

openSUSE Build Service is sponsored by