From ae98aa03aa9ccbed8d09ec0b34859e3f5a36d327 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Tue, 24 Jun 2025 15:18:01 -0400 Subject: [PATCH] Resolved the msql,postgresql spec file ambiguity --- Makefile.dist | 9 ++------- app/Makefile | 2 +- mailleur.spec.in | 47 ++++++++++++++++++++++++++++++++++------------- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/Makefile.dist b/Makefile.dist index 8f39b49..e937c4b 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -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) diff --git a/app/Makefile b/app/Makefile index e66b888..c4c05d4 100644 --- a/app/Makefile +++ b/app/Makefile @@ -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 : diff --git a/mailleur.spec.in b/mailleur.spec.in index c3c1b9d..8dc5449 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -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} -- 2.47.3