]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Resolved the msql,postgresql spec file ambiguity
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Tue, 24 Jun 2025 19:18:01 +0000 (15:18 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Tue, 24 Jun 2025 19:18:01 +0000 (15:18 -0400)
Makefile.dist
app/Makefile
mailleur.spec.in

index 8f39b49b2a7c8977d39c9af62c8e709675d66257..e937c4b39131e5408ff54c0a9ac790465ef9e828 100644 (file)
@@ -2,19 +2,12 @@
 #Makefile with all necessary to build distribution RPM
 APPN   =       mailleur
 #====================================================================
-postgres:
-          $(MAKE) DBVERS="DB=1" binary
-         
-mysql  :
-          $(MAKE) DBVERS="DB=2" binary
 binary :  rpm
           @ echo "'$(APLV)' RPM binary file, building"
           @ rpmbuild                                           \
                --quiet                                         \
                --noclean                                       \
                --rebuild                                       \
-               --define "db $(DBVERS)"                         \
                --define "_topdir $(RPMDIR)"                    \
                --target `uname -m`                             \
                $(SRPM)/$(APPN)-$(VERSION).$(RELEASE)-*.src.rpm
@@ -65,6 +58,8 @@ tarfile       : clean
                $(APLV)/support
          @ cp -a sysconfig/*                                   \
                $(APLV)/sysconfig
+         @ cp -a sql/                                          \
+               $(APLV)/
          @ cp -a app/Makefile  $(APLV)/app/Makefile
          @ cp -a lib/Makefile  $(APLV)/lib/Makefile
          @ tar zcf $(SRC)/$(APLV).tar.gz $(APLV)
index e66b888ea35c68f27490d67b993deefbe5ee2c1f..c4c05d456cc20dc924f96f557c8c76fdcc8d7388 100644 (file)
@@ -6,7 +6,7 @@ debug   :
            @ echo "application compiled in '$@' mode now ready"
 
 prod   :
-          @ $(MAKE) OPTIME="-O3" exe
+          @ $(MAKE) OPTIME="-g -O2" exe
           @ echo "application compiled in '$@' mode now ready"
 
 exe    :
index c3c1b9d0c9281355731f7242fad8c911297983f4..8dc5449df37e0def66636d65ecf2a8b8918f664f 100644 (file)
@@ -1,9 +1,5 @@
 #-----------------------------------------------------------------------------
 %{?!dist:       %define dist    @@DIST@@}
-#DB=1  ->Postgresql  (default)
-#DB=2  ->MYSQL
-%{?!db:        %define db      DB=1}
-#
 %define         spooldir        %{_localstatedir}/spool/
 %define                dovedir         %{_sysconfdir}/%{name}/dovecot
 #-----------------------------------------------------------------------------
@@ -46,8 +42,6 @@ search about email exchange within time and transaction context.
 %attr(0640,%{name},dovecot) %config(noreplace) %{dovedir}/passfile
 %{_sbindir}/chkspf
 %{_sbindir}/feeder
-%attr(0755,%{name},mail) %{_sbindir}/receiver
-%attr(0755,%{name},mail) %{_sbindir}/sender
 %attr(0755,%{name},mail) %{_sbindir}/sorter
 %attr(0754,root,root) %{_libdir}/%{name}/shell/*.sh
 %attr(0754,root,root) %{_libdir}/%{name}/support/addconfig.sh
@@ -159,6 +153,8 @@ Obsoletes   :       %{name}-mysql           <= %{version}-%{release}
 #-----------------------------------------------------------------------------
 %files                 postgresql
 %defattr(-,root,root,-)
+%attr(0755,%{name},mail) %{_sbindir}/rcvrpsql
+%attr(0755,%{name},mail) %{_sbindir}/sndrpsql
 
 %post                  postgresql
 if [ "$1" = 1 ]; then
@@ -168,6 +164,20 @@ if [ "$1" = 1 ]; then
        %{_sysconfdir}/%{name}/%{name}.conf
   fi
 
+#generating postgresql receiver and sender
+%{__ln_s} -nf                                  \
+       ./rcvrpsql                              \
+       %{_sbindir}/receiver
+%{__ln_s} -nf                                  \
+       ./sndrpsql                              \
+       %{_sbindir}/sender
+
+%postun                        postgresql
+if [ "$1" = 0 ]; then
+  rm -f %{_sbindir}/receiver
+  rm -f %{_sbindir}/sender
+  fi
+
 #=============================================================================
 %package               mysql
 Summary                :       mailleur using mysql/mariadb as Data-base
@@ -185,6 +195,8 @@ Obsoletes   :       %{name}-postgresql      <= %{version}-%{release}
 #-----------------------------------------------------------------------------
 %files                 mysql
 %defattr(-,root,root,-)
+%attr(0755,%{name},mail) %{_sbindir}/rcvrmsql
+%attr(0755,%{name},mail) %{_sbindir}/sndrmsql
 
 %post                  mysql
 if [ "$1" = 1 ]; then
@@ -193,6 +205,20 @@ if [ "$1" = 1 ]; then
        -e "s/^DB_PORT=.*$/DB_PORT=3306/"       \
        %{_sysconfdir}/%{name}/%{name}.conf
   fi
+#generating mysql receiver and sender
+%{__ln_s} -nf                                  \
+       ./rcvrmsql                              \
+       %{_sbindir}/receiver
+%{__ln_s} -nf                                  \
+       ./sndrmsql                              \
+       %{_sbindir}/sender
+
+%postun                        mysql
+if [ "$1" = 0 ]; then
+  rm -f %{_sbindir}/receiver
+  rm -f %{_sbindir}/sender
+  fi
+
 #=============================================================================
 %prep
 %setup -q
@@ -200,13 +226,8 @@ if [ "$1" = 1 ]; then
 #building application
 %build
 
-#to set the database add DB=x to Make
-#DB=1  ->Postgresql
-#DB=2  ->MYSQL
-echo JMPDBG %{db}
-%{__make}                                              \
-       %{db}
-
+%{__make}                                                      \
+       prod
 #-----------------------------------------------------------------------------
 %clean
 %{__rm} -rf %{buildroot}