summaryrefslogtreecommitdiff
path: root/packaging/icecream.spec
blob: 3eb41a2ae43b1919ef0b02b77a34cbe5fbec320a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# spec file for package icecream
#
# Copyright (c) 2011 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/
#

# norootforbuild
# icecream 0


Name:           icecream
BuildRequires:  gcc-c++
License:        GPLv2+ ; LGPLv2.1+
Group:          Development/Tools/Building
Summary:        For Distributed Compile in the Network
Requires:       /bin/tar /usr/bin/bzip2
%if 0%{?suse_version}
PreReq:         %fillup_prereq
PreReq:         %insserv_prereq
%endif
Requires(pre):  shadow-utils
Requires:       gcc-c++
Version:        0.9.7
Release:        1
Source:        ftp://ftp.suse.com/pub/projects/icecream/icecc-%{version}.tar.bz2

%description
icecream is the next generation distcc.

%package -n libicecream-devel
License:        GPLv2+ ; LGPLv2.1+
Summary:        For Distributed Compile in the Network
Group:          Development/Tools/Building
Summary:        For Distributed Compile in the Network
Requires:       libstdc++-devel

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

%prep
%setup -q -n icecc-%{version}

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
%configure
make %{?jobs:-j %jobs}

%install
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/opt/icecream/bin
for i in g++ gcc cc c++ clang clang++; do
  ln -s /usr/bin/icecc $RPM_BUILD_ROOT/opt/icecream/bin/$i
  rm -f $RPM_BUILD_ROOT/usr/bin/$i
done
%ifarch armv7l
ln -s /usr/bin/icecc $RPM_BUILD_ROOT/opt/icecream/bin/armv7l-tizen-linux-gnueabi-gcc
%endif
%ifarch aarch64
ln -s /usr/bin/icecc $RPM_BUILD_ROOT/opt/icecream/bin/aarch64-tizen-linux-gnueabi-gcc
%endif

#
# Install icecream init script
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
install -m 755 suse/init.icecream $RPM_BUILD_ROOT/etc/init.d/icecream
ln -sf /etc/init.d/icecream $RPM_BUILD_ROOT%{_sbindir}/rcicecream
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 suse/sysconfig.icecream $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.icecream
mkdir -p $RPM_BUILD_ROOT/var/cache/icecream
mkdir -p $RPM_BUILD_ROOT%_mandir/man{1,7}
for i in mans/*.1 mans/*.7; do
	install -m 644 $i $RPM_BUILD_ROOT%_mandir/man`echo $i | sed -e 's,.*\(.\)$,\1,'`/`basename $i`
done
install -m 644 -D suse/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/icecream
%if 0%{?suse_version} > 1020
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
install -m 644 suse/SuSEfirewall.iceccd $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/iceccd
install -m 644 suse/SuSEfirewall.scheduler $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/icecream-scheduler
%endif

%preun
%stop_on_removal icecream

%pre
/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 || :
%if 0%{?suse_version}

%post
%{fillup_and_insserv -n icecream icecream}
%endif

%postun
%restart_on_update icecream
%{insserv_cleanup}

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root)
%config /etc/logrotate.d/icecream
%config /etc/init.d/icecream
%_bindir/icecc
%_bindir/icerun
%_sbindir/scheduler
%_libdir/icecc
%_sbindir/iceccd
%_sbindir/rcicecream
%_mandir/man*/*
/opt/icecream
%if 0%{?suse_version} > 1020
/etc/sysconfig/SuSEfirewall2.d/services/*
%endif
/var/adm/fillup-templates/sysconfig.icecream
%attr(-,icecream,icecream) /var/cache/icecream

%files -n libicecream-devel
%defattr(-,root,root)
%_includedir/icecc
%_libdir/libicecc.*
%_libdir/pkgconfig/icecc.pc

%changelog