From: Jean-Marc Pigeon (Delson) Date: Thu, 19 Jun 2025 13:31:41 +0000 (-0400) Subject: Improving default database definition (postgresql) X-Git-Tag: tag-0.9~87 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=1ca194147d9447b6afa8e64f94ee1832206c24fb;p=jmp%2Fmailleur Improving default database definition (postgresql) --- diff --git a/Makefile b/Makefile index c5ea567..d24bc79 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ #==================================================================== +#Makefile to build the package +#default make +default : clean debug +#-------------------------------------------------------------------- #test area Makefile include Makefile.dbg #distribution area Makefile include Makefile.dist - -#Makefile to build the package -#-------------------------------------------------------------------- -#default make -default : clean prod #-------------------------------------------------------------------- #Executable generation area #-------------------------------------------------------------------- @@ -16,7 +15,7 @@ debug \ : @ for i in $(SUBDIR) ; \ do \ - $(MAKE) -s -C $$i $@ ; \ + $(MAKE) DB=$(DB) -s -C $$i $@ ; \ done clean : cleanrpm @@ -87,13 +86,13 @@ valfeed : debug #valgring of emlrcvr #testing TLS connection tlsrcvr : @ clear - @ openssl s_client \ + openssl s_client \ -crlf \ -CAfile certs/root-safe_CA.pem \ -cert certs/localhost-cert.pem \ -key certs/localhost-key.pem \ -starttls smtp \ - -connect $(TESTIP):$(TESTPORT) + -connect mailpostg.example.com:25 go465 : @ clear @@ -112,6 +111,7 @@ go465 : # -debug # -showcerts # -tls1_2 +# -connect mailpostg.example.com:25 # -connect mailprod1.safe.ca:25 # -connect $(TESTSRV):$(TESTPORT) # -connect smtp.google.com:25 @@ -206,6 +206,11 @@ SUBDIR = \ #definitions globale APPNAME = mailleur #-------------------------------------------------------------------- +#to set the compiled default library +ifeq ($(strip $(DB)),) +DB=1 +endif +#-------------------------------------------------------------------- #Managing testarea LIBDIR = /usr/lib DATADIR = /usr/share diff --git a/Makefile.dbg b/Makefile.dbg index f629d1e..73aeb74 100644 --- a/Makefile.dbg +++ b/Makefile.dbg @@ -33,7 +33,7 @@ onercvr : clean debug newtest $(EMLPAR)$(TESTITER) # # -i 127.63.31.15 -onefeed : debug +onefeed : @ bin/feeder \ -f \ -d 2 \ @@ -42,7 +42,7 @@ onefeed : debug $(TESTPORT) \ ./$(DATATST)/$(ONEFEED) -onesendr: debug +onesendr: @ \ ./bin/sender \ -f \ diff --git a/Makefile.dist b/Makefile.dist index a7ffff0..d8a62e6 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -5,12 +5,12 @@ APPN = mailleur binary : rpm @ echo "'$(APLV)' RPM binary file, building" @ rpmbuild \ - --noclean \ --quiet \ + --noclean \ --rebuild \ --define "_topdir $(RPMDIR)" \ --target `uname -m` \ - $(SRPM)/$(APPN)-$(VERSION).$(RELEASE)-*.src.rpm > /dev/null + $(SRPM)/$(APPN)-$(VERSION).$(RELEASE)-*.src.rpm @ echo "'$(APLV)' RPM binary file, ready" rpm : cleanrpm tarfile spec diff --git a/lib/Makefile b/lib/Makefile index 9f2c837..7593d0a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -2,7 +2,7 @@ #Executable generation area #-------------------------------------------------------------------- debug : toremake - $(MAKE) \ + @ $(MAKE) \ $(PAR) \ OPTIME="-g -DMODEDEBUG" \ objs diff --git a/lib/subrou.h b/lib/subrou.h index 22dea03..b5ec7fa 100644 --- a/lib/subrou.h +++ b/lib/subrou.h @@ -20,6 +20,7 @@ #define ITSOK 0 //to check errno against no error //defining database #define +#define USE_NODB 0 //No data base to be linked #define USE_POSTGRESQL 1 #define USE_MYSQL 2 diff --git a/mailleur.spec.in b/mailleur.spec.in index de4ae72..ffff266 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -17,6 +17,8 @@ Source0 : %{name}-@@VERSION@@.tar.gz BuildRequires : postgresql Requires : bash +Requires : openssl +Requires : sed #----------------------------------------------------------------------------- %description @@ -188,11 +190,11 @@ if [ "$1" = 1 ]; then #building application %build +#to set the database add DB=x to Make #DB=1 ->Postgresql #DB=2 ->MYSQL -%{__make} \ - DB=1 \ - debug +#default is DB=1 (Postgresql) +%{__make} #-----------------------------------------------------------------------------