]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Able to generate RPM for postgres and mysql
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 23 Jun 2025 20:00:59 +0000 (16:00 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 23 Jun 2025 20:00:59 +0000 (16:00 -0400)
Makefile.dist
mailleur.spec.in

index 54b92af4ed3b17280418872fb3d45ef92654a353..8f39b49b2a7c8977d39c9af62c8e709675d66257 100644 (file)
@@ -2,16 +2,23 @@
 #Makefile with all necessary to build distribution RPM
 APPN   =       mailleur
 #====================================================================
-binary : rpm
-         @ echo "'$(APLV)' RPM binary file, building"
-         @ rpmbuild                                            \
+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
-         @ echo "'$(APLV)' RPM binary file, ready"
+          @ echo "'$(APLV)' RPM binary file, ready"
 
 rpm    : cleanrpm tarfile spec
          @ echo "'$(APLV)' RPM source file, building"
index 4c41ce41e9cea5aad0d116b61c04c65c08cf9703..86542b233e74b38631d4e9635b660442048ec2a9 100644 (file)
@@ -1,5 +1,9 @@
 #-----------------------------------------------------------------------------
 %{?!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
 #-----------------------------------------------------------------------------
@@ -190,7 +194,6 @@ if [ "$1" = 1 ]; then
 #=============================================================================
 %prep
 %setup -q
-
 #-----------------------------------------------------------------------------
 #building application
 %build
@@ -198,9 +201,9 @@ if [ "$1" = 1 ]; then
 #to set the database add DB=x to Make
 #DB=1  ->Postgresql
 #DB=2  ->MYSQL
-#default is DB=1 (Postgresql)
-%{__make}
-
+echo JMPDBG %{db}
+%{__make}                                              \
+       %{db}
 
 #-----------------------------------------------------------------------------
 %clean