#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"
#-----------------------------------------------------------------------------
%{?!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
#-----------------------------------------------------------------------------
#=============================================================================
%prep
%setup -q
-
#-----------------------------------------------------------------------------
#building application
%build
#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