From b0ff03a0e28442cd8666130ee3a86d4021406fc7 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 23:48:48 +0100 Subject: [PATCH] provide required directory /var/log/icecream [release 1.0.1-3mamba;Tue Apr 29 2014] --- README.md | 2 + icecc-0.9.7-arm_platform_map.patch | 13 ++ icecc-0.9.7-x86_64-map-to-i686-for-now.patch | 11 ++ icecc-0.9.98.1-sysconfig-openmamba.patch | 12 ++ icecc-initscript | 120 ++++++++++++ icecc-profile | 7 + icecc.spec | 181 +++++++++++++++++++ icecream-logrotate | 15 ++ icecream-monitor | 14 ++ icecream-sysconfig | 92 ++++++++++ 10 files changed, 467 insertions(+) create mode 100644 icecc-0.9.7-arm_platform_map.patch create mode 100644 icecc-0.9.7-x86_64-map-to-i686-for-now.patch create mode 100644 icecc-0.9.98.1-sysconfig-openmamba.patch create mode 100644 icecc-initscript create mode 100644 icecc-profile create mode 100644 icecc.spec create mode 100644 icecream-logrotate create mode 100644 icecream-monitor create mode 100644 icecream-sysconfig diff --git a/README.md b/README.md index 6f2fda0..4e529b7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # icecc +Icecream was created by SUSE based on distcc. Like distcc, Icecream takes compile jobs from a (KDE) build and distributes it among remote machines allowing a parallel build. But unlike distcc, Icecream uses a central server that dynamically schedules the compile jobs to the fastest free server. This advantage pays off mostly for shared computers, if you're the only user on x machines, you have full control over them. + diff --git a/icecc-0.9.7-arm_platform_map.patch b/icecc-0.9.7-arm_platform_map.patch new file mode 100644 index 0000000..f72dba4 --- /dev/null +++ b/icecc-0.9.7-arm_platform_map.patch @@ -0,0 +1,13 @@ +diff -Nru icecc-0.9.7.orig/services/scheduler.cpp icecc-0.9.7/services/scheduler.cpp +--- icecc-0.9.7.orig/services/scheduler.cpp 2009-04-30 11:48:34.000000000 +0200 ++++ icecc-0.9.7/services/scheduler.cpp 2012-02-24 17:24:11.679948884 +0100 +@@ -597,6 +597,9 @@ + + platform_map.insert( make_pair( string( "ppc" ), string( "ppc64" ) ) ); + platform_map.insert( make_pair( string( "s390" ), string( "s390x" ) ) ); ++ ++ platform_map.insert( make_pair( string( "armv7l" ), string( "armv5tel" ) ) ); ++ platform_map.insert( make_pair( string( "armv5tel" ), string( "armv7l" ) ) ); + } + + multimap::const_iterator end = platform_map.upper_bound( target ); diff --git a/icecc-0.9.7-x86_64-map-to-i686-for-now.patch b/icecc-0.9.7-x86_64-map-to-i686-for-now.patch new file mode 100644 index 0000000..615436c --- /dev/null +++ b/icecc-0.9.7-x86_64-map-to-i686-for-now.patch @@ -0,0 +1,11 @@ +diff -Nru icecc-0.9.7.orig/services/scheduler.cpp icecc-0.9.7/services/scheduler.cpp +--- icecc-0.9.7.orig/services/scheduler.cpp 2012-04-07 17:05:04.946772933 +0200 ++++ icecc-0.9.7/services/scheduler.cpp 2012-04-07 19:07:42.569307085 +0200 +@@ -594,6 +594,7 @@ + platform_map.insert( make_pair( string( "i586" ), string( "x86_64" ) ) ); + + platform_map.insert( make_pair( string( "i686" ), string( "x86_64" ) ) ); ++ platform_map.insert( make_pair( string( "x86_64" ), string( "i686" ) ) ); + + platform_map.insert( make_pair( string( "ppc" ), string( "ppc64" ) ) ); + platform_map.insert( make_pair( string( "s390" ), string( "s390x" ) ) ); diff --git a/icecc-0.9.98.1-sysconfig-openmamba.patch b/icecc-0.9.98.1-sysconfig-openmamba.patch new file mode 100644 index 0000000..5ee86d4 --- /dev/null +++ b/icecc-0.9.98.1-sysconfig-openmamba.patch @@ -0,0 +1,12 @@ +diff -Nru icecc-0.9.98.1.orig/suse/sysconfig.icecream icecc-0.9.98.1/suse/sysconfig.icecream +--- icecc-0.9.98.1.orig/suse/sysconfig.icecream 2012-12-16 10:17:34.000000000 +0100 ++++ icecc-0.9.98.1/suse/sysconfig.icecream 2013-01-05 12:26:41.814252803 +0100 +@@ -45,7 +45,7 @@ + # You can have several distinct icecream networks in the same LAN + # for whatever reason. + # +-ICECREAM_NETNAME="" ++ICECREAM_NETNAME="openmamba" + + # + ## Type: string diff --git a/icecc-initscript b/icecc-initscript new file mode 100644 index 0000000..11abcda --- /dev/null +++ b/icecc-initscript @@ -0,0 +1,120 @@ +#! /bin/sh +# Copyright (c) 2003 SuSE Linux AG Nuernberg, Germany. +# +# Author: Stephan Kulow +# +# Modified for openmamba by Silvan Calarco +# +### BEGIN INIT INFO +# Provides: icecream +# Required-Start: $network $syslog $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 3 5 +# Default-Stop: +# Description: distributed compiler daemon +# Short-Description: icecc +### END INIT INFO +# +# chkconfig: 35 98 2 +# description: Distributed compiler daemon +# +# Determine the base and follow a runlevel link name. +base=${0##*/} +link=${base#*[SK][0-9][0-9]} + +# Force execution if not called by a runlevel directory. +test -x /usr/sbin/iceccd || exit 0 + +. /etc/init.d/functions +. /etc/sysconfig/icecream + +case "$1" in + start) + echo -n "Starting Distributed Compiler Daemon" + netname= + if test -n "$ICECREAM_NETNAME"; then + netname="-n $ICECREAM_NETNAME" + fi + if test "$ICECREAM_RUN_SCHEDULER" == "yes"; then + logfile="" + if test -z "$ICECREAM_SCHEDULER_LOG_FILE"; then + ICECREAM_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler" + fi + logfile="-l $ICECREAM_SCHEDULER_LOG_FILE" + : > $ICECREAM_SCHEDULER_LOG_FILE + chown icecc:icecc $ICECREAM_SCHEDULER_LOG_FILE + daemon --user icecc /usr/sbin/icecc-scheduler -d $logfile $netname + fi + logfile="" + if test -n "$ICECREAM_LOG_FILE"; then + touch $ICECREAM_LOG_FILE + chown icecc:icecc $ICECREAM_LOG_FILE + logfile="-l $ICECREAM_LOG_FILE" + else + touch /var/log/iceccd + chown icecc:icecc /var/log/iceccd + fi + nice= + if test -n "$ICECREAM_NICE_LEVEL"; then + nice="--nice $ICECREAM_NICE_LEVEL" + fi + scheduler= + if test -n "$ICECREAM_SCHEDULER_HOST"; then + scheduler="-s $ICECREAM_SCHEDULER_HOST" + fi + noremote= + if test "$ICECREAM_ALLOW_REMOTE" = "no" 2> /dev/null; then + noremote="--no-remote" + fi + maxjobs= + if test -n "$ICECREAM_MAX_JOBS"; then + if test "$ICECREAM_MAX_JOBS" -eq 0 2> /dev/null; then + maxjobs="-m 1" + noremote="--no-remote" + else + maxjobs="-m $ICECREAM_MAX_JOBS" + fi + fi + loadproc /usr/sbin/iceccd -d $logfile $nice $scheduler $netname -u icecc -b "$ICECREAM_BASEDIR/environments" $maxjobs $noremote + evaluate_retval; echo + ;; + stop) + echo -n "Shutting down Distributed Compiler Daemon" + killproc /usr/sbin/iceccd TERM + if test "$ICECREAM_RUN_SCHEDULER" == "yes"; then + killproc /usr/sbin/icecc-scheduler TERM + fi + evaluate_retval; echo + ;; + restart) + ## If first returns OK call the second, if first or + ## second command fails, set echo return value. + $0 stop; sleep 1 && $0 start + ;; + try-restart|condrestart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + fi + ;; + reload|force-reload) + if test "$ICECREAM_RUN_SCHEDULER" == "yes"; then + killproc -HUP /usr/sbin/scheduler + fi + killproc -HUP /usr/sbin/iceccd + ;; + status) + echo -n "Checking for Distributed Compiler Daemon: " + statusproc /usr/sbin/iceccd + ;; + *) + echo "Usage: $0 {start|stop|status|restart|try-restart|reload}" + exit 1 + ;; +esac diff --git a/icecc-profile b/icecc-profile new file mode 100644 index 0000000..5149ab9 --- /dev/null +++ b/icecc-profile @@ -0,0 +1,7 @@ +if [ -e /usr/libexec/icecc/bin/ ]; then + PATH=/usr/libexec/icecc/bin:$PATH + RPM_BUILD_NCPUS=`/usr/bin/getconf _NPROCESSORS_ONLN` + [ "$RPM_BUILD_NCPUS" ] || RPM_BUILD_NCPUS=1 + RPM_BUILD_NCPUS=`expr $RPM_BUILD_NCPUS \* 2 + 1` + export PATH RPM_BUILD_NCPUS +fi diff --git a/icecc.spec b/icecc.spec new file mode 100644 index 0000000..616e3f2 --- /dev/null +++ b/icecc.spec @@ -0,0 +1,181 @@ +### AUTOUPDATE-OFF: 1 + +%define userid 65425 +%define groupid 65425 + +Name: icecc +Version: 1.0.1 +Release: 3mamba +Summary: A distributed build system based on distcc +Group: Development/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://en.opensuse.org/Icecream +Source: ftp://ftp.suse.com/pub/projects/icecream/icecc-%{version}.tar.bz2 +#Source1: http://pkgs.fedoraproject.org/repo/pkgs/icecream/icecream-manpages.tar.bz2/a3829775870d5b2b60b750a88ee835b7/icecream-manpages.tar.bz2 +Source2: icecc-initscript +Source3: icecream-sysconfig +Source4: icecream-logrotate +Source5: icecc-profile +Source6: icecream-monitor +Patch0: %{name}-0.9.7-arm_platform_map.patch +Patch1: %{name}-0.9.7-x86_64-map-to-i686-for-now.patch +Patch2: icecc-0.9.98.1-sysconfig-openmamba.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libcap-ng-devel +BuildRequires: libgcc +BuildRequires: libstdc++6-devel +## AUTOBUILDREQ-END +BuildRequires: llvm-clang-devel +BuildRequires: pkg-config +Requires: gcc +Requires: gcc-c++ +Requires: gcc-cpp +Requires: /usr/bin/expect +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +Icecream was created by SUSE based on distcc. Like distcc, Icecream takes compile jobs from a (KDE) build and distributes it among remote machines allowing a parallel build. But unlike distcc, Icecream uses a central server that dynamically schedules the compile jobs to the fastest free server. This advantage pays off mostly for shared computers, if you're the only user on x machines, you have full control over them. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +%configure +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +# +# Install icecream init script +mkdir -p %{buildroot}%{_initrddir} +install -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/icecream +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +install -m 644 suse/sysconfig.icecream %{buildroot}%{_sysconfdir}/sysconfig/icecream +mkdir -p %{buildroot}/var/cache/icecream +#mkdir -p %{buildroot}%{_mandir}/man{1,7} +#for i in mans/*.1 mans/*.7; do +# install -m 644 $i %{buildroot}%{_mandir}/man`echo $i | sed -e 's,.*\(.\)$,\1,'`/`basename $i` +#done +install -m 644 -D %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/icecream +install -D -m0755 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/icecream.sh +install -D -m0755 %{SOURCE6} %{buildroot}%{_bindir}/icecream-monitor +install -d -m0755 %{buildroot}%{_localstatedir}/log/icecream + +for f in c++ cc g++ gcc; do +ln -s %{_bindir}/icecc %{buildroot}%{_libexecdir}/icecc/bin/%{_host}-$f +done + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%pre +if [ $1 -ge 1 ]; then + userdel icecream 2>/dev/null || : + groupdel icecream 2>/dev/null || : + /usr/sbin/groupadd -r -g %{groupid} icecc 2> /dev/null || : + /usr/sbin/useradd -r -g %{userid} -s /bin/false -c "Icecream Daemon" -d /var/cache/icecream icecc 2> /dev/null || : +fi + +%post +if [ $1 -eq 1 ]; then + service icecream start +fi +if [ $1 -ge 1 ]; then + chkconfig --add icecream +fi +: + +%preun +if [ $1 -eq 0 ]; then + service icecream stop + chkconfig --del icecream +fi +: + +%postun +if [ $1 -eq 0 ]; then + groupdel icecc 2>/dev/null || : + userdel icecc 2>/dev/null || : +fi +: + +%files +%defattr(-,root,root) +%{_sysconfdir}/profile.d/icecream.sh +%{_sysconfdir}/logrotate.d/icecream +%config(noreplace) %{_sysconfdir}/sysconfig/icecream +%{_initrddir}/icecream +%{_bindir}/icecc +%{_bindir}/icerun +%{_bindir}/icecream-monitor +%{_sbindir}/iceccd +%{_sbindir}/icecc-scheduler +%attr(0755,icecc,icecc) %dir /var/cache/icecream +%dir %{_includedir}/icecc +%{_includedir}/icecc/*.h +#%{_libdir}/icecc/icecc-create-env +%{_libdir}/libicecc.a +%{_libdir}/libicecc.la +%dir %{_libexecdir}/icecc +%dir %{_libexecdir}/icecc/bin +%{_libexecdir}/icecc/bin/c++ +%{_libexecdir}/icecc/bin/cc +%{_libexecdir}/icecc/bin/clang +%{_libexecdir}/icecc/bin/clang++ +%{_libexecdir}/icecc/bin/g++ +%{_libexecdir}/icecc/bin/gcc +%{_libexecdir}/icecc/bin/%{_host}-c++ +%{_libexecdir}/icecc/bin/%{_host}-cc +%{_libexecdir}/icecc/bin/%{_host}-g++ +%{_libexecdir}/icecc/bin/%{_host}-gcc +%{_libexecdir}/icecc/compilerwrapper +%{_libexecdir}/icecc/icecc-create-env +%attr(-,icecc,icecc) %dir %{_localstatedir}/log/icecream +%{_libdir}/pkgconfig/icecc.pc +%{_mandir}/man1/icecc.1* +%{_mandir}/man1/iceccd.1* +%{_mandir}/man1/icecc-scheduler.1* +%{_mandir}/man7/icecream.7* +%doc COPYING + +%changelog +* Tue Apr 29 2014 Silvan Calarco 1.0.1-3mamba +- provide required directory /var/log/icecream + +* Thu Jul 25 2013 Silvan Calarco 1.0.1-2mamba +- added llvm-clang-devel build requirement + +* Sun Jul 21 2013 Automatic Build System 1.0.1-1mamba +- automatic update by autodist + +* Sun May 19 2013 Automatic Build System 1.0.0-1mamba +- update to 1.0.0 + +* Sat Jan 05 2013 Automatic Build System 0.9.98.1-1mamba +- automatic version update by autodist + +* Tue Jul 31 2012 Silvan Calarco 0.9.7-5mamba +- added expect script icecream-monitor +- require gcc, gcc-c++ and /usr/bin/expect + +* Sat Apr 07 2012 Silvan Calarco 0.9.7-4mamba +- add a patch to map x86_64 as equivalent to i686 to allow exporting builds from x86_64 kernel + 32 bit o.s. machine + +* Fri Feb 24 2012 Silvan Calarco 0.9.7-3mamba +- added default sysconfig and logrotate files + +* Fri Feb 24 2012 Silvan Calarco 0.9.7-2mamba +- added iniscript, man pages, icecream user and group +- added symlinks to icecc for platform based gcc commands + +* Fri Feb 24 2012 Silvan Calarco 0.9.7-1mamba +- package created by autospec diff --git a/icecream-logrotate b/icecream-logrotate new file mode 100644 index 0000000..287da63 --- /dev/null +++ b/icecream-logrotate @@ -0,0 +1,15 @@ +/var/log/iceccd.log /var/log/icecc_scheduler.log { + compress + dateext + maxage 30 + rotate 99 + missingok + notifempty + size +4096k + create 644 icecream icecream + sharedscripts + postrotate + /etc/init.d/icecream reload + endscript +} + diff --git a/icecream-monitor b/icecream-monitor new file mode 100644 index 0000000..814855f --- /dev/null +++ b/icecream-monitor @@ -0,0 +1,14 @@ +#!/usr/bin/expect +# +# Icecream command line monitoring tool +# Copyright (c) 2012 by Silvan Calarco +# +set timeout 20 +set address [lrange $argv 0 0] +set command [lrange $argv 1 1] +spawn telnet $address 8766 + +expect "200 " +send "$command\n" +expect "200 done" +send "quit" diff --git a/icecream-sysconfig b/icecream-sysconfig new file mode 100644 index 0000000..208f187 --- /dev/null +++ b/icecream-sysconfig @@ -0,0 +1,92 @@ +# +## Type: integer(0:19) +## Path: Applications/icecream +## Description: Icecream settings +## ServiceRestart: icecream +## Default: 5 +# +# Nice level of running compilers +# +ICECREAM_NICE_LEVEL="5" + +# +## Type: string +## Path: Applications/icecream +## Defaut: /var/log/iceccd +# +# icecream daemon log file +# +ICECREAM_LOG_FILE="/var/log/iceccd.log" + +# +## Type: string +## Path: Applications/icecream +## Defaut: no +# +# Start also the scheduler? +# +ICECREAM_RUN_SCHEDULER="no" + +# +## Type: string +## Path: Applications/icecream +## Defaut: /var/log/icecc_scheduler +# +# icecream scheduler log file +# +ICECREAM_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler.log" + +# +## Type: string +## Path: Applications/icecream +## Defaut: "" +# +# Identification for the network the scheduler and daemon run on. +# You can have several distinct icecream networks in the same LAN +# for whatever reason. +# +ICECREAM_NETNAME="openmamba" + +# +## Type: string +## Path: Applications/icecream +## Defaut: "" +# +# If the daemon can't find the scheduler by broadcast (e.g. because +# of a firewall) you can specify it. +# +ICECREAM_SCHEDULER_HOST="" + +# +## Type: integer +## Path: Applications/icecream +## Defaut: "" +# +# You can overwrite here the number of jobs to run in parallel. Per +# default this depends on the number of (virtual) CPUs installed. +# +# Note: a value of "0" is actually interpreted as "1", however it +# also sets ICECREAM_ALLOW_REMOTE="no". +# +ICECREAM_MAX_JOBS="" + +# +## Type: yesno +## Path: Applications/icecream +## Defaut: "yes" +# +# Specifies whether jobs submitted by other nodes are allowed to run on +# this one. +# +ICECREAM_ALLOW_REMOTE="yes" + +# +## Type: string +## Path: Applications/icecream +## Default: "/var/cache/icecream" +# +# This is the directory where the icecream daemon stores the environments +# it compiles in. In a big network this can grow quite a bit, so use some +# path if your /tmp is small - but the user icecream has to write to it. +# +ICECREAM_BASEDIR="/var/cache/icecream"