From 200534cd532626d49ba68b7bb8804a788f36e283 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Mon, 23 Jun 2025 16:00:59 -0400 Subject: [PATCH] Able to generate RPM for postgres and mysql --- Makefile.dist | 15 +++++++++++---- mailleur.spec.in | 11 +++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile.dist b/Makefile.dist index 54b92af..8f39b49 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -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" diff --git a/mailleur.spec.in b/mailleur.spec.in index 4c41ce4..86542b2 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -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 -- 2.47.3