[icecream] upstream release 1.0.1

Michal Schmidt michich at fedoraproject.org
Mon Aug 26 15:30:43 UTC 2013


commit ca199d112f5aa6bfd01043d04714a77df73e49c5
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Mon Aug 26 15:31:45 2013 +0200

    upstream release 1.0.1
    
    - Rebase to current upstream release. (#888183, #914087, #925572, #992557)
    - Build with librsync and libcap-ng support.
    - Build manpages from included DocBook sources.
    - Disable the SELinux module, it's out of date.
    - Enable PIE. (#955456)
    - Modernize spec file. (#850154)

 ...-dist-hook-work-also-with-srcdir-builddir.patch |   22 ++++
 0002-handle-HOME-not-being-set.patch               |   48 ++++++++
 ...Ubuntu-uses-docbook2x-man-instead-of-docb.patch |   39 ++++++
 ...has-docbook2man-instead-of-docbook-to-man.patch |   31 +++++
 ...-chmod-chown-envs-dir-when-preparing-this.patch |   66 +++++++++++
 icecc-scheduler.service                            |    2 +-
 iceccd.service                                     |    5 +-
 icecream-cleanup-conffile.patch                    |   18 ++--
 icecream-rename-scheduler.patch                    |  107 -----------------
 icecream.csh.in                                    |    6 +-
 icecream.sh.in                                     |    6 +-
 icecream.spec                                      |  122 ++++++++------------
 12 files changed, 270 insertions(+), 202 deletions(-)
---
diff --git a/0001-make-dist-hook-work-also-with-srcdir-builddir.patch b/0001-make-dist-hook-work-also-with-srcdir-builddir.patch
new file mode 100644
index 0000000..94d5d95
--- /dev/null
+++ b/0001-make-dist-hook-work-also-with-srcdir-builddir.patch
@@ -0,0 +1,22 @@
+From 5abe21688caea8dcfbe1d747102e52830fa352d8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak at suse.cz>
+Date: Thu, 11 Jul 2013 15:40:13 +0200
+Subject: [PATCH 1/4] make dist-hook work also with srcdir != builddir
+
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 8109f65..2e2ae6b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,4 +12,4 @@ SUBDIRS = \
+ 	compilerwrapper
+ 
+ dist-hook:
+-	git log --date=short --pretty="format:@%cd  %an  <%ae>  [%H]%n%n%s%n%n%e%b" | sed -e "s|^\([^@]\)|\t\1|" -e "s|^@||" >$(distdir)/ChangeLog
++	( cd $(top_srcdir) && git log --date=short --pretty="format:@%cd  %an  <%ae>  [%H]%n%n%s%n%n%e%b" | sed -e "s|^\([^@]\)|\t\1|" -e "s|^@||" ) >$(distdir)/ChangeLog
+-- 
+1.8.3.1
+
diff --git a/0002-handle-HOME-not-being-set.patch b/0002-handle-HOME-not-being-set.patch
new file mode 100644
index 0000000..8d93985
--- /dev/null
+++ b/0002-handle-HOME-not-being-set.patch
@@ -0,0 +1,48 @@
+From 6f79da339b3fd946b46932d61f30a117918de7b7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak at suse.cz>
+Date: Tue, 16 Jul 2013 15:46:06 +0200
+Subject: [PATCH 2/4] handle $HOME not being set
+
+---
+ client/main.cpp |  2 +-
+ daemon/main.cpp | 11 ++++++++---
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/client/main.cpp b/client/main.cpp
+index d72ce9d..638dbda 100644
+--- a/client/main.cpp
++++ b/client/main.cpp
+@@ -335,7 +335,7 @@ int main(int argc, char **argv)
+     if (!local_daemon)
+         local_daemon = Service::createChannel( "/var/run/iceccd.socket" );
+ 
+-    if (!local_daemon) {
++    if (!local_daemon && getenv("HOME")) {
+         string path = getenv("HOME");
+         path += "/.iceccd.socket";
+         local_daemon = Service::createChannel( path );
+diff --git a/daemon/main.cpp b/daemon/main.cpp
+index 28ec158..5d7e430 100644
+--- a/daemon/main.cpp
++++ b/daemon/main.cpp
+@@ -553,9 +553,14 @@ bool Daemon::setup_listen_fds()
+         unlink(myaddr.sun_path);
+         old_umask = umask(0);
+     } else { // Started by user.
+-        strncpy(myaddr.sun_path, getenv("HOME"), sizeof(myaddr.sun_path)-1);
+-        strncat(myaddr.sun_path, "/.iceccd.socket", sizeof(myaddr.sun_path)-1-strlen(myaddr.sun_path));
+-        unlink(myaddr.sun_path);
++        if( getenv( "HOME" )) {
++            strncpy(myaddr.sun_path, getenv("HOME"), sizeof(myaddr.sun_path)-1);
++            strncat(myaddr.sun_path, "/.iceccd.socket", sizeof(myaddr.sun_path)-1-strlen(myaddr.sun_path));
++            unlink(myaddr.sun_path);
++        } else {
++            log_error() << "launched by user, but $HOME not set" << endl;
++            return false;
++        }
+     }
+ 
+     if (bind(unix_listen_fd, (struct sockaddr*)&myaddr, sizeof(myaddr)) < 0) {
+-- 
+1.8.3.1
+
diff --git a/0003-Debian-and-Ubuntu-uses-docbook2x-man-instead-of-docb.patch b/0003-Debian-and-Ubuntu-uses-docbook2x-man-instead-of-docb.patch
new file mode 100644
index 0000000..df08bbf
--- /dev/null
+++ b/0003-Debian-and-Ubuntu-uses-docbook2x-man-instead-of-docb.patch
@@ -0,0 +1,39 @@
+From 059b0aaa9b54ab4a8866cdaf40eb4200a2797feb Mon Sep 17 00:00:00 2001
+From: Rodrigo Belem <rodrigo.belem at gmail.com>
+Date: Mon, 8 Apr 2013 15:55:49 -0400
+Subject: [PATCH 3/4] Debian and Ubuntu uses docbook2x-man instead of
+ docbook-to-man
+
+Signed-off-by: Rodrigo Belem <rodrigo.belem at gmail.com>
+(cherry picked from commit df212c10336b6369ab244d9c888263774c9087dc)
+---
+ configure.ac | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2a35390..3750c49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,12 +71,15 @@ AC_ARG_WITH(man,
+ )
+ AS_IF([test "x$with_man" != "xno"], [
+     build_man=yes
+-    AC_PATH_PROG(DOCBOOK2X,[docbook-to-man])
++    AC_PATH_PROG(DOCBOOK2X,[docbook2x-man])
+     AS_IF([test -z "$DOCBOOK2X"], [
+-        AC_PATH_PROG(DOCBOOK2X,[docbook2man.pl])
++        AC_PATH_PROG(DOCBOOK2X,[docbook-to-man])
+         AS_IF([test -z "$DOCBOOK2X"], [
+-            AC_MSG_WARN([docbook-to-man is missing. Install docbook2X package.])
+-            DOCBOOK2X='echo docbook-to-man is missing. Install docbook2X package.'
++            AC_PATH_PROG(DOCBOOK2X,[docbook2man.pl])
++            AS_IF([test -z "$DOCBOOK2X"], [
++                AC_MSG_WARN([docbook2x is missing. Install docbook2x package.])
++                DOCBOOK2X='echo docbook2x is missing. Install docbook2x package.'
++            ])
+         ])
+     ])
+ ], [build_man=no])
+-- 
+1.8.3.1
+
diff --git a/0004-Mac-brew-has-docbook2man-instead-of-docbook-to-man.patch b/0004-Mac-brew-has-docbook2man-instead-of-docbook-to-man.patch
new file mode 100644
index 0000000..fbe69fb
--- /dev/null
+++ b/0004-Mac-brew-has-docbook2man-instead-of-docbook-to-man.patch
@@ -0,0 +1,31 @@
+From 50e25516be288526f6251502900c7cc887b40294 Mon Sep 17 00:00:00 2001
+From: Eike Ziller <github at eikeziller.de>
+Date: Tue, 18 Jun 2013 22:55:36 +0200
+Subject: [PATCH 4/4] Mac/brew has docbook2man instead of docbook-to-man
+
+(cherry picked from commit a40bae096bd51f328d6ff299077c5530729b0580)
+---
+ configure.ac | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3750c49..e77e864 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -77,8 +77,11 @@ AS_IF([test "x$with_man" != "xno"], [
+         AS_IF([test -z "$DOCBOOK2X"], [
+             AC_PATH_PROG(DOCBOOK2X,[docbook2man.pl])
+             AS_IF([test -z "$DOCBOOK2X"], [
+-                AC_MSG_WARN([docbook2x is missing. Install docbook2x package.])
+-                DOCBOOK2X='echo docbook2x is missing. Install docbook2x package.'
++                AC_PATH_PROG(DOCBOOK2X,[docbook2man])
++                AS_IF([test -z "$DOCBOOK2X"], [
++                    AC_MSG_WARN([docbook2x is missing. Install docbook2x package.])
++                    DOCBOOK2X='echo docbook2x is missing. Install docbook2x package.'
++                ])
+             ])
+         ])
+     ])
+-- 
+1.8.3.1
+
diff --git a/0005-Revert-chmod-chown-envs-dir-when-preparing-this.patch b/0005-Revert-chmod-chown-envs-dir-when-preparing-this.patch
new file mode 100644
index 0000000..63e9344
--- /dev/null
+++ b/0005-Revert-chmod-chown-envs-dir-when-preparing-this.patch
@@ -0,0 +1,66 @@
+From bade4de1155e41809205ede25ffb99211c72547c Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Mon, 26 Aug 2013 17:08:52 +0200
+Subject: [PATCH 5/5] Revert "chmod/chown envs dir when preparing this"
+
+This reverts commit 137e683760707c690df496516432d72d8f7a81d3.
+---
+ daemon/environment.cpp | 7 +------
+ daemon/environment.h   | 2 +-
+ daemon/main.cpp        | 2 +-
+ 3 files changed, 3 insertions(+), 8 deletions(-)
+
+diff --git a/daemon/environment.cpp b/daemon/environment.cpp
+index 87a78a7..4a4ac94 100644
+--- a/daemon/environment.cpp
++++ b/daemon/environment.cpp
+@@ -165,7 +165,7 @@ static bool cleanup_directory( const string& directory )
+     return true;
+ }
+ 
+-bool cleanup_cache( const string &basedir, uid_t user_uid, gid_t user_gid )
++bool cleanup_cache( const string &basedir )
+ {
+     flush_debug();
+ 
+@@ -181,11 +181,6 @@ bool cleanup_cache( const string &basedir, uid_t user_uid, gid_t user_gid )
+             log_perror( "mkdir in cleanup_cache() failed" );
+         return false;
+     }
+-    if ( chown( basedir.c_str(), user_uid, user_gid ) ||
+-         chmod( basedir.c_str(), 0775 ) ) {
+-        log_perror( "chown/chmod in cleanup_cache() failed" );
+-        return false;
+-    }
+ 
+     return true;
+ }
+diff --git a/daemon/environment.h b/daemon/environment.h
+index 8e9361f..ecea781 100644
+--- a/daemon/environment.h
++++ b/daemon/environment.h
+@@ -27,7 +27,7 @@
+ #include <unistd.h>
+ 
+ class MsgChannel;
+-extern bool cleanup_cache( const std::string &basedir, uid_t user_uid, gid_t user_gid );
++extern bool cleanup_cache( const std::string &basedir );
+ extern size_t setup_env_cache(const std::string &basedir, std::string &native_environment,
+                     uid_t user_uid, gid_t user_gid,
+                     const std::string &compiler, const std::list<std::string> &extrafiles);
+diff --git a/daemon/main.cpp b/daemon/main.cpp
+index 5d7e430..e08b1e1 100644
+--- a/daemon/main.cpp
++++ b/daemon/main.cpp
+@@ -1872,7 +1872,7 @@ int main( int argc, char ** argv )
+     pidFile << dcc_master_pid << endl;
+     pidFile.close();
+ 
+-    if ( !cleanup_cache( d.envbasedir, d.user_uid, d.user_gid ) )
++    if ( !cleanup_cache( d.envbasedir ) )
+         return 1;
+ 
+     list<string> nl = get_netnames (200);
+-- 
+1.8.3.1
+
diff --git a/icecc-scheduler.service b/icecc-scheduler.service
index fc66bb3..6f85c92 100644
--- a/icecc-scheduler.service
+++ b/icecc-scheduler.service
@@ -3,7 +3,7 @@ Description=Icecream distributed compiler scheduler
 
 [Service]
 Type=forking
-ExecStart=/usr/lib/icecream/icecc-scheduler-wrapper /var/log/icecc-scheduler
+ExecStart=/usr/libexec/icecc/icecc-scheduler-wrapper /var/log/icecc/scheduler.log
 
 [Install]
 WantedBy=multi-user.target
diff --git a/iceccd.service b/iceccd.service
index bf4049d..6a61dda 100644
--- a/iceccd.service
+++ b/iceccd.service
@@ -3,9 +3,8 @@ Description=Icecream Distributed Compiler
 After=network.target nss-lookup.target
 
 [Service]
-Type=forking
-PIDFile=/var/run/iceccd.pid
-ExecStart=/usr/lib/icecream/iceccd-wrapper -d -u icecream -b /var/cache/icecream -l /var/log/iceccd
+Type=simple
+ExecStart=/usr/libexec/icecc/iceccd-wrapper -u icecream -b /var/cache/icecream -l /var/log/icecc/iceccd.log
 Nice=5
 
 [Install]
diff --git a/icecream-cleanup-conffile.patch b/icecream-cleanup-conffile.patch
index 7aacedd..ddde0ff 100644
--- a/icecream-cleanup-conffile.patch
+++ b/icecream-cleanup-conffile.patch
@@ -17,16 +17,16 @@ Index: suse/sysconfig.icecream
 -#
 -## Type: string
 -## Path: Applications/icecream
--## Defaut: /var/log/iceccd
+-## Default: /var/log/icecream/iceccd
 -#
 -# icecream daemon log file
 -#
--ICECREAM_LOG_FILE="/var/log/iceccd"
+-ICECREAM_LOG_FILE="/var/log/icecream/iceccd"
 -
 -#
 -## Type: string
 -## Path: Applications/icecream
--## Defaut: no
+-## Default: no
 -#
 -# Start also the scheduler?
 -#
@@ -35,16 +35,16 @@ Index: suse/sysconfig.icecream
 -#
 -## Type: string
 -## Path: Applications/icecream
--## Defaut: /var/log/icecc_scheduler
+-## Default: /var/log/icecream/scheduler
 -#
 -# icecream scheduler log file
 -#
--ICECREAM_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
+-ICECREAM_SCHEDULER_LOG_FILE="/var/log/icecream/scheduler"
 -
 -#
 -## Type: string
 -## Path: Applications/icecream
--## Defaut: ""
+-## Default: ""
 -#
 -# Identification for the network the scheduler and daemon run on. 
 +# Identification for the network the scheduler and daemon run on.
@@ -56,7 +56,7 @@ Index: suse/sysconfig.icecream
  #
 -## Type: string
 -## Path: Applications/icecream
--## Defaut: ""
+-## Default: ""
 -#
 -# If the daemon can't find the scheduler by broadcast (e.g. because 
 +# If the daemon can't find the scheduler by broadcast (e.g. because
@@ -67,7 +67,7 @@ Index: suse/sysconfig.icecream
  #
 -## Type: integer
 -## Path: Applications/icecream
--## Defaut: ""
+-## Default: ""
 -# 
  # You can overwrite here the number of jobs to run in parallel. Per
 -# default this depends on the number of (virtual) CPUs installed. 
@@ -81,7 +81,7 @@ Index: suse/sysconfig.icecream
  #
 -## Type: yesno
 -## Path: Applications/icecream
--## Defaut: "yes"
+-## Default: "yes"
 -# 
  # Specifies whether jobs submitted by other nodes are allowed to run on
  # this one.
diff --git a/icecream.csh.in b/icecream.csh.in
index e861e92..c142b80 100644
--- a/icecream.csh.in
+++ b/icecream.csh.in
@@ -2,9 +2,9 @@
 # If ccache is there, adds icecc _after_ it.
 # Otherwise adds icecc to the beginning.
 
-if ( "$path" !~ *@LIBDIR@/icecc/bin* ) then
+if ( "$path" !~ *@LIBEXECDIR@/icecc/bin* ) then
 	if ( "$path" !~ *@LIBDIR@/ccache* ) then
-		set path = ( @LIBDIR@/icecc/bin $path )
+		set path = ( @LIBEXECDIR@/icecc/bin $path )
 	else
 		@ pos = 0
 		foreach item ( $path )
@@ -12,7 +12,7 @@ if ( "$path" !~ *@LIBDIR@/icecc/bin* ) then
 			if ( $item == @LIBDIR@/ccache ) break
 		end
 		@ next_pos = $pos + 1
-		set path = ( $path[1-$pos] @LIBDIR@/icecc/bin \
+		set path = ( $path[1-$pos] @LIBEXECDIR@/icecc/bin \
 			$path[$next_pos-])
 		unset next_pos
 		unset pos
diff --git a/icecream.sh.in b/icecream.sh.in
index d637a6a..10a78ca 100644
--- a/icecream.sh.in
+++ b/icecream.sh.in
@@ -3,7 +3,7 @@
 # Otherwise adds icecc to the beginning.
 
 PATH=`echo $PATH | /bin/sed -e \
-	'\%@LIBDIR@/icecc/bin% b
-	s%@LIBDIR@/ccache%&:@LIBDIR@/icecc/bin%
+	'\%@LIBEXECDIR@/icecc/bin% b
+	s%@LIBDIR@/ccache%&:@LIBEXECDIR@/icecc/bin%
 	t
-	s%^%@LIBDIR@/icecc/bin:%'`
+	s%^%@LIBEXECDIR@/icecc/bin:%'`
diff --git a/icecream.spec b/icecream.spec
index 879d6ad..124fba8 100644
--- a/icecream.spec
+++ b/icecream.spec
@@ -1,13 +1,11 @@
-%if 0%{?el5}
-# I'd need to modify the policy a bit to make it work on RHEL 5.
+%global _hardened_build 1
+
+# TODO: Reenable SELinux by default. It needs updating first.
 %bcond_with	selinux
-%else
-%bcond_without	selinux
-%endif
 
 Name:		icecream
-Version:	0.9.7
-Release:	6%{?dist}
+Version:	1.0.1
+Release:	1%{?dist}
 Summary:	Distributed compiler
 
 Group:		Development/Tools
@@ -21,21 +19,27 @@ Source4:	icecream.te
 Source5:	icecream.if
 Source6:	iceccd.service
 Source7:	icecc-scheduler.service
-# tarball extracted from http://download.opensuse.org/repositories/home:/coolo/openSUSE_Factory/src/icecream-0.9.5-3.1.src.rpm:
-Source8:	%{name}-manpages.tar.bz2
 Source9:	iceccd-wrapper
 Source10:	icecc-scheduler-wrapper
-Patch0:		%{name}-rename-scheduler.patch
-Patch1:		%{name}-cleanup-conffile.patch
 
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch0001:	0001-make-dist-hook-work-also-with-srcdir-builddir.patch
+Patch0002:	0002-handle-HOME-not-being-set.patch
+Patch0003:	0003-Debian-and-Ubuntu-uses-docbook2x-man-instead-of-docb.patch
+Patch0004:	0004-Mac-brew-has-docbook2man-instead-of-docbook-to-man.patch
+PAtch0005:	0005-Revert-chmod-chown-envs-dir-when-preparing-this.patch
+
+Patch10000:	%{name}-cleanup-conffile.patch
 
-BuildRequires:	symlinks systemd-units
+BuildRequires:	systemd
+BuildRequires:	libcap-ng-devel
+BuildRequires:	librsync-devel
+BuildRequires:	docbook-utils
+BuildRequires:	autoconf automake libtool
 
 Requires(pre):		shadow-utils
-Requires(post):		systemd-units systemd-sysv
-Requires(preun):	systemd-units
-Requires(postun):	systemd-units
+Requires(post):		systemd
+Requires(preun):	systemd
+Requires(postun):	systemd
 
 %if %{with selinux}
 # For SELinux protection:
@@ -71,17 +75,22 @@ Requires:	%{name} = %{version}-%{release}
 This package contains development files for %{name}.
 
 %prep
-%setup -q -a 8 -n icecc-%{version}
-%patch0 -p1
-%patch1 -p0
-sed -e 's|@LIBDIR@|%{_libdir}|g' %{SOURCE1} > icecream.sh
-sed -e 's|@LIBDIR@|%{_libdir}|g' %{SOURCE2} > icecream.csh
+%setup -q -n icecc-%{version}
+%patch0001 -p1
+%patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
+%patch0005 -p1
+%patch10000 -p0
+sed -e 's|@LIBDIR@|%{_libdir}|g;s|@LIBEXECDIR@|%{_libexecdir}|g' %{SOURCE1} > icecream.sh
+sed -e 's|@LIBDIR@|%{_libdir}|g;s|@LIBEXECDIR@|%{_libexecdir}|g' %{SOURCE2} > icecream.csh
 mkdir SELinux
 cp -p %{SOURCE3} %{SOURCE4} %{SOURCE5} SELinux
 mkdir fedora
 cp -p %{SOURCE6} %{SOURCE7} %{SOURCE9} %{SOURCE10} fedora
 
 %build
+autoreconf -fi
 %configure --disable-static --enable-shared
 # Remove rpath from local libtool copy
 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
@@ -100,33 +109,14 @@ popd
 %endif
 
 %install
-rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 rm -f %{buildroot}/%{_libdir}/libicecc.la
 
-# move the symlinks elsewhere
-mkdir -p %{buildroot}/%{_libdir}/icecc/bin
-for i in cc gcc c++ g++; do
-	ln -s %{buildroot}/%{_bindir}/icecc %{buildroot}/%{_libdir}/icecc/bin/$i
-	rm -f %{buildroot}/%{_bindir}/$i
-done
-
-# relativize the symlinks
-symlinks -cs %{buildroot}/%{_libdir}/icecc/bin
-
-# install manpages
-mkdir -p %{buildroot}/%{_mandir}/man{1,7,8}
-mv mans/scheduler.1 mans/icecc-scheduler.1
-for i in mans/*.1 mans/*.7; do
-	install -m 644 $i %{buildroot}/%{_mandir}/man${i##*.}
-done
-
 # install config file and initscripts
 install -D -m 644 suse/sysconfig.icecream  %{buildroot}/%{_sysconfdir}/sysconfig/icecream
 install -d -m 755 %{buildroot}/%{_unitdir}
 install -p -m 644 fedora/*.service         %{buildroot}/%{_unitdir}
-install -d -m 755 %{buildroot}/%{_prefix}/lib/icecream
-install -p -m 755 fedora/*-wrapper         %{buildroot}/%{_prefix}/lib/icecream
+install -p -m 755 fedora/*-wrapper         %{buildroot}/%{_libexecdir}/icecc
 install -d -m 755 %{buildroot}/%{_sysconfdir}/profile.d
 install -p -m 644 icecream.sh icecream.csh %{buildroot}/%{_sysconfdir}/profile.d
 
@@ -177,7 +167,6 @@ exit 0
 
 %post
 /sbin/ldconfig
-# if [ "$1" -le 1 ]; then # First install
 %if %{with selinux}
 for selinuxvariant in %{selinux_variants}; do
 	semodule -s ${selinuxvariant} -i \
@@ -192,20 +181,14 @@ done
 restorecon -R %{_localstatedir}/cache/icecream 2>/dev/null ||:
 restorecon %{_localstatedir}/log/iceccd 2>/dev/null ||:
 %endif
-# fi
 
-if [ $1 -eq 1 ] ; then # Initial installation
-	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post iceccd.service icecc-scheduler.service
 exit 0
 
 %preun
-if [ $1 -eq 0 ]; then # Final removal
-	/bin/systemctl --no-reload disable iceccd.service icecc-scheduler.service > /dev/null 2>&1 || :
-	/bin/systemctl stop iceccd.service icecc-scheduler.service > /dev/null 2>&1 || :
-#	rm -rf %{_localstatedir}/cache/icecream
-
+%systemd_preun iceccd.service icecc-scheduler.service
 %if %{with selinux}
+if [ $1 -eq 0 ]; then # Final removal
 	for selinuxvariant in %{selinux_variants}; do
 		%saveFileContext ${selinuxvariant}
 		semanage port -d -S ${selinuxvariant} -t iceccd_port_t -p tcp 10245 2>/dev/null ||:
@@ -213,17 +196,13 @@ if [ $1 -eq 0 ]; then # Final removal
 		semanage port -d -S ${selinuxvariant} -t icecc_scheduler_port_t -p tcp 8766 2>/dev/null ||:
 		semanage port -d -S ${selinuxvariant} -t icecc_scheduler_port_t -p udp 8765 2>/dev/null ||:
 	done
-%endif
-
 fi
+%endif
 exit 0
 
 %postun
 /sbin/ldconfig
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ]; then # Upgrade
-	/bin/systemctl try-restart iceccd.service icecc-scheduler.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart iceccd.service icecc-scheduler.service
 %if %{with selinux}
 if [ $1 -eq 0 ]; then # Final removal
 	for selinuxvariant in %{selinux_variants}; do
@@ -234,36 +213,19 @@ fi
 %endif
 exit 0
 
-%triggerun -- icecream < 0.9.7-2
-/usr/bin/systemd-sysv-convert --save iceccd >/dev/null 2>&1 ||:
-/usr/bin/systemd-sysv-convert --save icecc-scheduler >/dev/null 2>&1 ||:
-/sbin/chkconfig --del iceccd >/dev/null 2>&1 || :
-/sbin/chkconfig --del icecc-scheduler >/dev/null 2>&1 || :
-/bin/systemctl try-restart iceccd.service icecc-scheduler.service >/dev/null 2>&1 || :
-
-%clean
-rm -rf %{buildroot}
-
 %files
 %defattr(-,root,root,-)
 %doc COPYING README NEWS TODO
 %{_bindir}/icecc
 %{_bindir}/icerun
-%dir %{_libdir}/icecc/
-%dir %{_libdir}/icecc/bin/
-%{_libdir}/icecc/bin/cc
-%{_libdir}/icecc/bin/gcc
-%{_libdir}/icecc/bin/c++
-%{_libdir}/icecc/bin/g++
-%{_libdir}/icecc/icecc-create-env
+%{_libexecdir}/icecc/
 %{_libdir}/libicecc.so.*
 %{_sbindir}/iceccd
 %{_sbindir}/icecc-scheduler
 %config(noreplace) %{_sysconfdir}/sysconfig/icecream
 %config(noreplace) %{_sysconfdir}/profile.d/icecream.*sh
 %{_unitdir}/icecc*.service
-%{_prefix}/lib/icecream
-%{_localstatedir}/cache/icecream
+%attr(0775, root, icecream) %{_localstatedir}/cache/icecream
 %{_mandir}/man*/*
 %{?with_selinux:%{_datadir}/selinux/*/icecream.pp}
 
@@ -275,6 +237,14 @@ rm -rf %{buildroot}
 %{_libdir}/pkgconfig/icecc.pc
 
 %changelog
+* Mon Aug 26 2013 Michal Schmidt <mschmidt at redhat.com> - 1.0.1-1
+- Rebase to current upstream release. (#888183, #914087, #925572, #992557)
+- Build with librsync and libcap-ng support.
+- Build manpages from included DocBook sources.
+- Disable the SELinux module, it's out of date.
+- Enable PIE. (#955456)
+- Modernize spec file. (#850154)
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.9.7-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list