]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Working to build RPM sources and binary
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 12:52:48 +0000 (08:52 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 12:52:48 +0000 (08:52 -0400)
Makefile
Makefile.dist
mailleur.spec.in [new file with mode: 0644]

index 29a8986a2b1e99847b3a5a9c82b76148870c6e17..15e5d9391414f3b444e54a5622ab410a17b44cc4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,9 @@
-#--------------------------------------------------------------------
+#====================================================================
+#test area Makefile
+include        Makefile.dbg
+#distribution area Makefile
+include        Makefile.dist
+
 #Makefile to build the package
 #--------------------------------------------------------------------
 #default make
@@ -14,19 +19,13 @@ debug                                                       \
               $(MAKE) -s -C $$i $@ ;                   \
               done
 
-clean  :
+clean  :  cleanrpm
           @ for i in $(SUBDIR) ;                       \
               do                                       \
               $(MAKE) -s -C $$i $@ ;                   \
               done
           @ - rm -fr $(APPNAME)-*
 
-#====================================================================
-#test area Makefile
-include        Makefile.dbg
-#distribution area Makefile
-include        Makefile.dist
-
 #====================================================================
 FEEDPAR        =                                               \
                $(TESTIP)                               \
@@ -186,4 +185,6 @@ APPNAME     =  mailleur
 #Managing testarea
 SBINDIR = usr/sbin
 CURDIR  = $(shell pwd)
+#--------------------------------------------------------------------
+.PHONY:   clean cleanrpm
 #===================================================================
index 6adcbb89d17d3223cd2dcc27fbd0e20d7dd7de4f..b8ec50ce0561edbe9ff2af79eea306bb8225b66c 100644 (file)
@@ -1,25 +1,58 @@
+#====================================================================
 #Makefile with all necessary to build distribution RPM
+APPN   =       mailleur
+#====================================================================
+binary : rpm
+         @ rpmbuild                                            \
+               --define "_topdir $(RPMDIR)"                    \
+               --rebuild                                       \
+               --target `uname -m`                             \
+               $(RPMDIR)/SRPMS/$(APPN)-$(VERSION).$(RELEASE)-dvl.src.rpm
 
+rpm    : cleanrpm tarfile spec
+         @ echo "Making '$(APLV)' RPM source file"
+         @ mkdir -p $(RPMDIR)/SOURCES;
+          rpmbuild -bs                                 \
+               --quiet                                         \
+               --define "_topdir $(RPMDIR)"                    \
+               --define "_source_filedigest_algorithm md5"     \
+               --define "_binary_filedigest_algorithm md5"     \
+               spec
+         @ echo "'$(APLV)' RPM source file ready"
 
 tarfile        : clean
+         @ mkdir -p $(RPMDIR)/SOURCES;
          @ echo "Making '$(APLV)' tar file"
-         @ mkdir -p                                    \
-               $(APLV)/app                             \
-               $(APLV)/lib                             \
+         @ mkdir -p                                            \
+               $(APLV)/app                                     \
+               $(APLV)/lib                                     \
                $(APLV)
          @ date > $(APLV)/$(APLV).build_date
          @ cp -a Makefile*     $(APLV)/
          @ cp -a app/Makefile  $(APLV)/app/Makefile
          @ cp -a lib/Makefile  $(APLV)/lib/Makefile
-         @ tar zcf $(APLV).tar.gz $(APLV)
+         @ tar zcf $(RPMDIR)/SOURCES/$(APLV).tar.gz $(APLV)
          @ echo "'$(APLV)' tar file ready"
          
+spec   : $(APPN).spec.in
+         @ sed                                                 \
+               -e 's/@@DIST@@/dvl/g'                           \
+               -e 's/@@APPN@@/$(APPN)/g'                       \
+               -e 's/@@VERSION@@/$(VERSION).$(RELEASE)/g'      \
+               -e 's/@@RELEASE@@//g'                           \
+               < $< > $@
 
 
+               
+cleanrpm:
+         @ rm -fr $(RPMDIR)/* spec
+
 #====================================================================
-VERSION        =       `grep VERSION lib/numver.h | cut -d'"' -f2`
-RELEASE        =       `grep RELEASE lib/numver.h | cut -d'"' -f2`
-APPN   =       mailleur
+#rpm definitions
+RPMDIR  =       $(CURDIR)/rpmbuild
+#====================================================================
+VERSION        =       $(shell echo `grep VERSION lib/numver.h | cut -d '"' -f2`)
+RELEASE        =       $(shell echo `grep RELEASE lib/numver.h | cut -d '"' -f2`)
 APPV   =       $(VERSION).$(RELEASE)
 APLV   =       $(APPN)-$(APPV)
 #====================================================================
diff --git a/mailleur.spec.in b/mailleur.spec.in
new file mode 100644 (file)
index 0000000..76ee076
--- /dev/null
@@ -0,0 +1,44 @@
+#-----------------------------------------------------------------------------
+%{?!dist:       %define dist    @@DIST@@}
+#-----------------------------------------------------------------------------
+Name           :       @@APPN@@
+Version                :       @@VERSION@@
+Release                :       @@RELEASE@@%{?dist}
+Summary                :       Application to filter and manage E-mail traffic
+Group          :       System Environment/Libraries
+
+Vendor         :       SAFE Inc.
+License                :       GPLv2
+URL            :       http://mailleur.safe.ca/
+
+Source0                :       %{name}-@@VERSION@@.tar.gz
+#-----------------------------------------------------------------------------
+%description
+'%{name}' is an email firewall. Its purpose is to filter all email,
+rejecting viruses and unwelcome messages at the SMTP protocol level
+(and avoids bouncing to forged originators).
+It also provide extended audit logs, allowing effective mean to
+search about email exchange within time and transaction context.
+
+#-----------------------------------------------------------------------------
+%files                 
+%defattr(-,root,root,-)
+
+#=============================================================================
+%prep
+%setup -q
+
+#-----------------------------------------------------------------------------
+#building application
+%build
+
+#-----------------------------------------------------------------------------
+%clean
+%{__rm} -rf %{buildroot}
+
+#-----------------------------------------------------------------------------
+#installing program
+%install
+
+#=============================================================================
+%changelog