From: Jean-Marc Pigeon (Delson) Date: Mon, 16 Jun 2025 18:01:52 +0000 (-0400) Subject: Trying to improve mailleur spec file X-Git-Tag: tag-0.9~164 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=aabea65ae23691e220829e7f452f1a309cff8faa;p=jmp%2Fmailleur Trying to improve mailleur spec file --- diff --git a/Makefile b/Makefile index 8f98f0b..eac7a62 100644 --- 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 index 0000000..f9612fc --- /dev/null +++ b/linux/osukiss/sorter @@ -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 + + + diff --git a/mailleur.spec.in b/mailleur.spec.in index 795a69e..597bd9e 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -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