From: Jean-Marc Pigeon (Delson) Date: Mon, 16 Jun 2025 18:27:03 +0000 (-0400) Subject: Adding shell script to RPM X-Git-Tag: tag-0.9~162 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=f62d7ebd84103866ee5577c6af1ce4d2d509a8cd;p=jmp%2Fmailleur Adding shell script to RPM --- diff --git a/Makefile b/Makefile index 02f2642..f634279 100644 --- a/Makefile +++ b/Makefile @@ -172,9 +172,10 @@ deltest : #-------------------------------------------------------------------- install : @ # Creating all needed system directory - @ install -d $(DESTDIR)/$(SBINDIR)/ @ install -d $(DESTDIR)/$(DATADIR)/$(APPN)/ @ install -d $(DESTDIR)/$(ETCDIR)/$(APPN)/ + @ install -d $(DESTDIR)/$(LIBDIR)/$(APPN)/ + @ install -d $(DESTDIR)/$(SBINDIR)/ @ cp -a \ bin/* \ $(DESTDIR)/$(SBINDIR)/ @@ -184,6 +185,9 @@ install : @ cp -a \ linux \ $(DESTDIR)/$(DATADIR)/$(APPN)/ + @ cp -a \ + shell \ + $(DESTDIR)/$(LIBDIR)/$(APPN)/ #-------------------------------------------------------------------- SUBDIR = \ @@ -195,7 +199,8 @@ SUBDIR = \ APPNAME = mailleur #-------------------------------------------------------------------- #Managing testarea -DATADIR = usr/share +LIBDIR = /usr/lib +DATADIR = /usr/share SBINDIR = /usr/sbin ETCDIR = /etc CURDIR = $(shell pwd) diff --git a/Makefile.dist b/Makefile.dist index c6bdbed..42b76f6 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -33,6 +33,7 @@ tarfile : clean $(APLV)/bin \ $(APLV)/lib \ $(APLV)/linux \ + $(APLV)/shell \ $(APLV) @ date > $(APLV)/$(APLV).build_date @ cp -a Makefile* $(APLV)/ @@ -40,6 +41,9 @@ tarfile : clean @ cp -a conf/*.conf $(APLV)/conf/ @ cp -a lib/{*.c,*.h} $(APLV)/lib/ @ cp -a linux/* $(APLV)/linux/ + @ cp -a \ + shell/getsysop.sh \ + $(APLV)/shell/ @ cp -a app/Makefile $(APLV)/app/Makefile @ cp -a lib/Makefile $(APLV)/lib/Makefile @ tar zcf $(SRC)/$(APLV).tar.gz $(APLV) diff --git a/mailleur.spec.in b/mailleur.spec.in index d8a3836..0968395 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -12,6 +12,11 @@ License : GPLv2 URL : http://mailleur.safe.ca/ Source0 : %{name}-@@VERSION@@.tar.gz +#----------------------------------------------------------------------------- +BuildRequires : postgresql + +Requires : bash + #----------------------------------------------------------------------------- %description '%{name}' is an email firewall. Its purpose is to filter all email, @@ -29,6 +34,7 @@ search about email exchange within time and transaction context. %{_sbindir}/receiver %{_sbindir}/sender %{_sbindir}/sorter +%{_libdir}/%{name}/shell/*.sh #----------------------------------------------------------------------------- @@ -113,8 +119,6 @@ case "$OS" in Summary : mailleur using postgresql as Data-base #----------------------------------------------------------------------------- -BuildRequires : postgresql - Requires : postgresql-server #----------------------------------------------------------------------------- diff --git a/shell/getsysop.sh b/shell/getsysop.sh new file mode 100644 index 0000000..17c9f2a --- /dev/null +++ b/shell/getsysop.sh @@ -0,0 +1,25 @@ +#! /usr/bin/bash +#--------------------------------------------------- +#shell script to get the OS used to run clement + +DIST=` \ + cat /etc/os-release | \ + grep "^ID=" | \ + sed -e 's:"::g' | \ + cut -d '=' -f2 | \ + tr '[:upper:]' '[:lower:]' \ + ` + +case "$DIST" in + "osukiss" ) #Osukiss distribution + OS="osukiss" + ;; + "rocky" | \ + "fedora" ) + OS="systemd" #systemd distribution + ;; + * ) #all other are system V + OS="sysv" + ;; + esac +echo $OS