Blame 0031-Make-install_systemd-and-install_sysvinit-separate-t.patch

c0e5984
From 4c13f6d393db0aa5ff5b327cb5e842ee21522236 Mon Sep 17 00:00:00 2001
c0e5984
From: Peter Jones <pjones@redhat.com>
c0e5984
Date: Thu, 18 Oct 2012 13:09:58 -0400
11a11c6
Subject: [PATCH 31/42] Make "install_systemd" and "install_sysvinit" separate
c0e5984
 targets
c0e5984
c0e5984
Signed-off-by: Peter Jones <pjones@redhat.com>
c0e5984
---
c0e5984
 Makefile            |  6 ++++
c0e5984
 src/Makefile        | 16 +++++++----
c0e5984
 src/pesign.sysvinit | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++
c0e5984
 3 files changed, 99 insertions(+), 5 deletions(-)
c0e5984
 create mode 100644 src/pesign.sysvinit
c0e5984
c0e5984
diff --git a/Makefile b/Makefile
c0e5984
index 5e9bd31..12e0dbb 100644
c0e5984
--- a/Makefile
c0e5984
+++ b/Makefile
c0e5984
@@ -19,6 +19,12 @@ install :
c0e5984
 	$(INSTALL) -d -m 755 $(INSTALLROOT)$(PREFIX)$(DOCDIR)/pesign-$(VERSION)/
c0e5984
 	$(INSTALL) -m 644 COPYING $(INSTALLROOT)$(PREFIX)$(DOCDIR)/pesign-$(VERSION)/
c0e5984
 
c0e5984
+install_systemd:
c0e5984
+	@for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done
c0e5984
+
c0e5984
+install_sysvinit:
c0e5984
+	@for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done
c0e5984
+
c0e5984
 .PHONY: $(SUBDIRS) clean install
c0e5984
 
c0e5984
 include $(TOPDIR)/Make.rules
c0e5984
diff --git a/src/Makefile b/src/Makefile
c0e5984
index cb74c12..7e611c8 100644
c0e5984
--- a/src/Makefile
c0e5984
+++ b/src/Makefile
c0e5984
@@ -42,7 +42,7 @@ client : $(client_OBJECTS) $(STATIC_LIBS)
c0e5984
 fuzzsocket_SOURCES = fuzzsocket.c
c0e5984
 fuzzsocket_OBJECTS = $(foreach source,$(fuzzsocket_SOURCES),$(patsubst %.c,%,$(source)).o)
c0e5984
 fuzzsocket_DEPS = $(foreach source,$(fuzzsocket_SOURCES),.$(patsubst %.c,%,$(source)).P)
c0e5984
-fuzzsocket : $(fuzzsocket_OBJECTS)
c0e5984
+fuzzsocket : $(fuzzsocket_OBJECTS) -lrt
c0e5984
 
c0e5984
 DEPS = $(generic_DEPS)$(authvar_DEPS) $(pesign_DEPS) $(client_DEPS) \
c0e5984
 	$(peverify_DEPS)
c0e5984
@@ -57,6 +57,16 @@ depclean :
c0e5984
 clean : depclean
c0e5984
 	@rm -rfv *.o *.a *.so $(TARGETS)
c0e5984
 
c0e5984
+install_systemd:
c0e5984
+	$(INSTALL) -d -m 755 $(INSTALLROOT)/usr/lib/tmpfiles.d/
c0e5984
+	$(INSTALL) -m 644 tmpfiles.conf $(INSTALLROOT)/usr/lib/tmpfiles.d/pesign.conf
c0e5984
+	$(INSTALL) -d -m 755 $(INSTALLROOT)/usr/lib/systemd/system/
c0e5984
+	$(INSTALL) -m 644 pesign.service $(INSTALLROOT)/usr/lib/systemd/system/
c0e5984
+
c0e5984
+install_sysvinit:
c0e5984
+	$(INSTALL) -d -m 755 $(INSTALLROOT)/etc/rc.d/init.d/
c0e5984
+	$(INSTALL) -m 755 pesign.sysvinit $(INSTALLROOT)/etc/rc.d/init.d/pesign
c0e5984
+
c0e5984
 install :
c0e5984
 	$(INSTALL) -d -m 700 $(INSTALLROOT)/etc/pki/pesign/
c0e5984
 	$(INSTALL) -d -m 770 $(INSTALLROOT)/var/run/pesign/
c0e5984
@@ -72,10 +82,6 @@ install :
c0e5984
 	#$(INSTALL) -m 644 peverify.1 $(INSTALLROOT)/usr/share/man/man1/
c0e5984
 	$(INSTALL) -d -m 755 $(INSTALLROOT)/etc/rpm/
c0e5984
 	$(INSTALL) -m 644 macros.pesign $(INSTALLROOT)/etc/rpm/
c0e5984
-	$(INSTALL) -d -m 755 $(INSTALLROOT)/usr/lib/tmpfiles.d/
c0e5984
-	$(INSTALL) -m 644 tmpfiles.conf $(INSTALLROOT)/usr/lib/tmpfiles.d/pesign.conf
c0e5984
-	$(INSTALL) -d -m 755 $(INSTALLROOT)/usr/lib/systemd/system/
c0e5984
-	$(INSTALL) -m 644 pesign.service $(INSTALLROOT)/usr/lib/systemd/system/
c0e5984
 
c0e5984
 .PHONY: all deps clean install
c0e5984
 
c0e5984
diff --git a/src/pesign.sysvinit b/src/pesign.sysvinit
c0e5984
new file mode 100644
c0e5984
index 0000000..f955e01
c0e5984
--- /dev/null
c0e5984
+++ b/src/pesign.sysvinit
c0e5984
@@ -0,0 +1,82 @@
c0e5984
+#! /bin/sh
c0e5984
+#
c0e5984
+# pesign	This starts the pesign PE signing daemon
c0e5984
+#
c0e5984
+# chkconfig: - 50 50
c0e5984
+# processname: /usr/bin/pesign
c0e5984
+# pidfile: /var/run/pesign.pid
c0e5984
+### BEGIN INIT INFO 
c0e5984
+# Provides: pesign
c0e5984
+# Default-Start:
c0e5984
+# Default-Stop:
c0e5984
+# Short-Description: The pesign PE signing daemon
c0e5984
+# Description: The pesign PE signing daemon
c0e5984
+### END INIT INFO
c0e5984
+
c0e5984
+. /etc/init.d/functions
c0e5984
+[ -f /usr/bin/pesign ] || exit 1
c0e5984
+
c0e5984
+RETVAL=0
c0e5984
+
c0e5984
+start(){
c0e5984
+    echo -n "Starting pesign: "
c0e5984
+    daemon /usr/bin/pesign --daemonize
c0e5984
+    RETVAL=$?
c0e5984
+    echo
c0e5984
+    touch /var/lock/subsys/pesign
c0e5984
+}
c0e5984
+
c0e5984
+stop(){
c0e5984
+    echo -n "Stopping pesign: "
c0e5984
+    killproc -p /var/run/pesign.pid pesignd
c0e5984
+    RETVAL=$?
c0e5984
+    echo
c0e5984
+    rm -f /var/lock/subsys/pesign
c0e5984
+}
c0e5984
+
c0e5984
+restart(){
c0e5984
+    stop
c0e5984
+    start
c0e5984
+}
c0e5984
+
c0e5984
+reload(){
c0e5984
+    stop
c0e5984
+    start
c0e5984
+}
c0e5984
+
c0e5984
+condrestart(){
c0e5984
+    [ -e /var/lock/subsys/pesign ] && restart
c0e5984
+}
c0e5984
+
c0e5984
+# See how we were called.
c0e5984
+case "$1" in
c0e5984
+    start)
c0e5984
+	start
c0e5984
+	;;
c0e5984
+    stop)
c0e5984
+	stop
c0e5984
+	;;
c0e5984
+    status)
c0e5984
+	status /usr/bin/pesign
c0e5984
+	;;
c0e5984
+    restart)
c0e5984
+	restart
c0e5984
+	;;
c0e5984
+    reload)
c0e5984
+	reload
c0e5984
+	;;
c0e5984
+    force-reload)
c0e5984
+	reload
c0e5984
+	;;
c0e5984
+    condrestart)
c0e5984
+	condrestart
c0e5984
+	;;
c0e5984
+    try-restart)
c0e5984
+	condrestart
c0e5984
+	;;
c0e5984
+    *)
c0e5984
+	echo "Usage: pesign {start|stop|status|restart|condrestart|reload}"
c0e5984
+	RETVAL=1
c0e5984
+esac
c0e5984
+
c0e5984
+exit $RETVAL
c0e5984
-- 
c0e5984
1.7.12.1
c0e5984