]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding shell script to RPM
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 18:27:03 +0000 (14:27 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 18:27:03 +0000 (14:27 -0400)
Makefile
Makefile.dist
mailleur.spec.in
shell/getsysop.sh [new file with mode: 0644]

index 02f2642cf29eac20a3b8bb2e42a323c7962e60d4..f634279d376174368073db23a986d965a0096c43 100644 (file)
--- 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)
index c6bdbedfe52b379bb7b0d9cce0012cc24946723a..42b76f625ea5229a4a0051f445e561be7a27c5ec 100644 (file)
@@ -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)
index d8a383680990951f734cee72c5da1c3aaca1f56b..0968395e71a009b98e010016ed8f02d550ee1f50 100644 (file)
@@ -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 (file)
index 0000000..17c9f2a
--- /dev/null
@@ -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