]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Trying to improve mailleur spec file
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 18:01:52 +0000 (14:01 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 18:01:52 +0000 (14:01 -0400)
Makefile
linux/osukiss/sorter [new file with mode: 0644]
mailleur.spec.in

index 8f98f0b1ae836c2f6e94360d13e0ed66e000966f..eac7a6292c4739d25afdaca6a4b020e08635e9bc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -173,10 +173,14 @@ deltest   :
 install        :
           @ # Creating all needed system directory
           @ install -d $(DESTDIR)/$(SBINDIR)/
+          @ install -d $(DESTDIR)/$(DATADIR)/$(APPN)
           @ install -d $(DESTDIR)/$(ETCDIR)/$(APPN)/
           @ cp -a                                      \
                bin/*                                   \
                $(DESTDIR)/$(SBINDIR)/
+          @ cp -a                                      \
+               linux
+               $(DESTDIR)/$(DATADIR)/$(APPN)
           @ cp -a                                      \
                conf/$(APPN).conf                       \
                $(DESTDIR)/$(ETCDIR)/$(APPN)
@@ -191,8 +195,9 @@ SUBDIR      =                                               \
 APPNAME        =  mailleur
 #--------------------------------------------------------------------
 #Managing testarea
-SBINDIR = usr/sbin
-ETCDIR = etc
+DATDIR = usr/share
+SBINDIR = /usr/sbin
+ETCDIR = /etc
 CURDIR  = $(shell pwd)
 #--------------------------------------------------------------------
 .PHONY:   clean cleanrpm
diff --git a/linux/osukiss/sorter b/linux/osukiss/sorter
new file mode 100644 (file)
index 0000000..f9612fc
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh
+#=================================================================
+# Begin sorter
+#
+# Description : Start mailleur sorter daemon
+# chkconfig: 2345 91 17
+#
+#=================================================================
+
+### BEGIN INIT INFO
+# Provides:            $sorter
+# Required-Start:      $
+# Should-Start:
+# Required-Stop:       sendsignals
+# Should-Stop:
+# Default-Start:       3 4 5
+# Default-Stop:        0 1 2 6
+# Short-Description:   Starts sorter daemon.
+# Description:         Starts sorter daemon.
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+APPNAME=mailleur
+DAEMON=sorter
+DAEMON_PID=/run/${DAEMON}.pid
+
+# Some functions to make the below more readable
+
+#loading load configuration file
+if [ -f  /etc/sysconfig/$APPNAME ] ; then
+  . /etc/sysconfig/$APPNAME
+fi
+
+#--------------------------------------------------------------
+#to start clement daemon
+#--------------------------------------------------------------
+mng_daemon ()
+
+{
+case "$1" in
+  start)
+    /usr/lib/$APPNAME/support/starting.sh osukiss
+    if [ $? != 0 ] ; then
+      exit 1;
+      fi
+    log_info_msg "Starting ${DAEMON} Server..."
+    start_daemon -f /usr/sbin/${DAEMON} $OPTIONS
+    evaluate_retval
+    ;;
+
+  stop)
+    log_info_msg "Stopping ${DAEMON} Server..."
+    killproc -p ${DAEMON_PID} /usr/sbin/${DAEMON}
+    evaluate_retval
+    rm -fr ${DAEMON_PID}
+    ;;
+
+ esac
+}
+
+case "$1" in
+      start    \
+    | stop     \
+    )
+       mng_daemon $1
+        ;;
+
+    reload)
+        log_info_msg "Reloading ${DAEMON} Server..."
+        pid=`cat ${DAEMON_PID} 2>/dev/null`
+
+        if [ -n "${pid}" ]; then
+           kill -HUP "${pid}"
+        else
+           (exit 1)
+        fi
+
+        evaluate_retval
+        ;;
+
+    restart)
+        $0 stop
+        sleep 1
+        $0 start
+        ;;
+
+    condrestart)
+        pid=`cat ${DAEMON_PID} 2>/dev/null`
+        if [ -n "${pid}"  -a -d /proc/$pid ]; then
+         $0 restart
+         fi
+        ;;
+
+
+    *)
+        echo "Usage: $0 {start|stop|reload|restart|status}"
+        exit 1
+        ;;
+esac
+
+
+
index 795a69e5d55262b89b069eda815d138187597cd1..597bd9e3bbbbda48eda23d3d82e45a1fdd3dafcb 100644 (file)
@@ -24,6 +24,8 @@ search about email exchange within time and transaction context.
 %files                 
 %defattr(-,root,root,-)
 %attr(0644,%{name},mail) %config(noreplace) %{_sysconfdir}/%{name}/*
+%attr(0755,root,root) %{_datadir}/%{name}/linux/osukiss/%{name}
+%attr(0755,root,root) %{_datadir}/%{name}/linux/sysv/%{name}
 %{_sbindir}/chkspf
 %{_sbindir}/receiver
 %{_sbindir}/sender