-#--------------------------------------------------------------------
+#====================================================================
+#test area Makefile
+include Makefile.dbg
+#distribution area Makefile
+include Makefile.dist
+
#Makefile to build the package
#--------------------------------------------------------------------
#default make
$(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) \
#Managing testarea
SBINDIR = usr/sbin
CURDIR = $(shell pwd)
+#--------------------------------------------------------------------
+.PHONY: clean cleanrpm
#===================================================================
+#====================================================================
#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)
#====================================================================
--- /dev/null
+#-----------------------------------------------------------------------------
+%{?!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