gunnar: server/php-kolab/Kolab_Filter Kolab_Filter.spec, 1.21, 1.22 Makefile, 1.10, 1.11

cvs at kolab.org cvs at kolab.org
Sun Apr 26 12:33:23 CEST 2009


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter
In directory doto:/tmp/cvs-serv2502

Modified Files:
	Kolab_Filter.spec Makefile 
Log Message:
Update Makefile. Fix dependencies.

Index: Kolab_Filter.spec
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Kolab_Filter.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- Kolab_Filter.spec	17 Mar 2009 11:49:41 -0000	1.21
+++ Kolab_Filter.spec	26 Apr 2009 10:33:21 -0000	1.22
@@ -2,6 +2,7 @@
 %define         V_package Kolab_Filter
 %define         V_version 0.1.5
 %define         V_release 20090317
+%define         V_sourceurl http://pear.horde.org/get
 
 # Package Information
 Name:	   %{V_package}
@@ -15,7 +16,7 @@
 Distribution:	OpenPKG
 
 # List of Sources
-Source0:    http://pear.horde.org/get/%{V_package}-%{V_version}.tgz
+Source0:    %{V_sourceurl}/%{V_package}-%{V_version}.tgz
 
 # List of patches
 Patch0:    dovecotlda-quoting.patch
@@ -30,9 +31,9 @@
 BuildPreReq:  PEAR-Horde-Channel
 PreReq:       OpenPKG, openpkg >= 20070603
 PreReq:       php, php::with_pear = yes
-PreReq:       Kolab_Format
-PreReq:       Kolab_Server
-PreReq:       Kolab_Storage
+PreReq:       Kolab_Format >= 1.0.1
+PreReq:       Kolab_Server >= 0.5.0
+PreReq:       Kolab_Storage >= 0.4.0
 PreReq:       PEAR-HTTP_Request
 PreReq:       PEAR-Net_LMTP
 PreReq:       PEAR-Net_SMTP

Index: Makefile
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile	6 Mar 2009 21:10:49 -0000	1.10
+++ Makefile	26 Apr 2009 10:33:21 -0000	1.11
@@ -1,52 +1,111 @@
-PACKAGE = $(shell grep "%define[ ]*V_package" *.spec | sed -e "s/.*V_package \([A-Za-z\-\_]*\).*/\1/")
-VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([0-9.]*\).*/\1/")
-RELEASE = $(shell grep "%define[ ]*V_release" *.spec | sed -e "s/.*V_release\s*\([0-9]*\).*/\1/")
-PATCHES = $(shell ls *.patch)
+# If home is unset this Makefile assumes the Kolab server installation
+# resides in /kolab. If this is not the case this Makefile must be
+# called using
+#
+# HOME="/mykolabroot" make TARGET
+#
+ifeq "x$(HOME)" "x"
+  HOME = /kolab
+endif
+
+# If HOME is set to /root it is likely that somebody is calling this
+# Makefile as root user. In this case this Makefile assumes that the
+# Kolab server installation resides in /kolab.
+#
+# In the (hopefully) unlikely event that somebody really installed the
+# Kolab server in /root this Makefile will fail.
+ifeq "x$(HOME)" "x/root"
+  HOME = /kolab
+endif
 
+# Set the location of the rpm binary
 ifeq "x$(RPM)" "x"
   RPM = $(HOME)/bin/openpkg rpm
 endif
+
+# Set the location for rpm source package installations
 ifeq "x$(KOLABRPMSRC)" "x"
   KOLABRPMSRC = $(HOME)/RPM/SRC
 endif
+
+# Set the location for rpm packages
 ifeq "x$(KOLABRPMPKG)" "x"
   KOLABRPMPKG = $(HOME)/RPM/PKG
 endif
+
+# Set the location for the rpm temporary directory
 ifeq "x$(KOLABRPMTMP)" "x"
   KOLABRPMTMP = $(HOME)/RPM/TMP
 endif
 
+# Determine the suffix for binary packages on this system
 ifeq "x$(PLATTAG)" "x"
 	PLATTAG = $(shell $(RPM) -q --qf="%{ARCH}-%{OS}" openpkg)-$(HOME:/%=%)
 endif
 
-SOURCE_URL=http://pear.horde.org/get
+# Determine the staging area for collecting new source rpms
+ifeq "x$(STAGING)" "x"
+  STAGING = ../../stage
+endif
+
+# Determine the package name from the *.spec file
+PACKAGE = $(shell grep "%define[ ]*V_package" *.spec | sed -e "s/.*V_package \([A-Za-z\-\_]*\).*/\1/")
+
+# Determine the package version from the *.spec file
+VERSION = $(shell grep "%define[ ]*V_version" *.spec | sed -e "s/.*V_version\s*\([0-9.]*\).*/\1/")
+
+# Determine the release number from the *.spec file
+RELEASE = $(shell grep "%define[ ]*V_release" *.spec | sed -e "s/.*V_release\s*\([0-9]*\).*/\1/")
+
+# Determine the download url for the PEAR package from the *.spec file
+SOURCE_URL=$(shell grep "%define[ ]*V_sourceurl" *.spec | sed -e "s/.*V_sourceurl\s*\(.*\)/\1/")
+
+# Get the list of patches if there are any in this directory
+PATCHES = $(shell ls *.patch 2> /dev/null)
+
+# Generate the full package name
 SOURCE_0=$(PACKAGE)-$(VERSION).tgz
+
+# Generate a list of extra files for the package
 EXTRA=ChangeLog $(PATCHES)
 
+
+# Default target to generate the source rpm package
 .PHONY: all
 all: $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
 
+# Target for placing the source rpm in the staging area
 .PHONY: dist
 dist: all
-	cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm ../../stage/
+	test -d $(STAGING) || mkdir $(STAGING)
+	cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm $(STAGING)
 
-.PHONY: clean
-clean:
-	rm -rf /kolab/RPM/TMP/$(PACKAGE)*
-	rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
-	rm -rf *~
+# Target for installing the binary rpm package in our current Kolab
+# server installation
+.PHONY: install
+install: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
+	$(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
 
-$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0):
+# Target for retrieving the source package
+$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0): 
 	test -d $(KOLABRPMSRC)/$(PACKAGE) || mkdir $(KOLABRPMSRC)/$(PACKAGE)
 	cd $(KOLABRPMSRC)/$(PACKAGE) && wget -c "$(SOURCE_URL)/$(SOURCE_0)"
 
-$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: Makefile $(PACKAGE).spec ChangeLog $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0)
+# Target for preparing the source area and building the package
+$(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm: Makefile $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0)
 	cp $(PACKAGE).spec $(EXTRA) $(KOLABRPMSRC)/$(PACKAGE)
 	cd $(KOLABRPMSRC)/$(PACKAGE) && $(RPM) -ba $(PACKAGE).spec
 
+# Target for fetching the source rpm into the current directory
+$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
 	cp -p $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm .
 
-.PHONY: install
-install: $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
-	$(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
+# Target for cleaning up the files that can be generated with this Makefile
+.PHONY: clean
+clean:
+	rm -rf $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
+	rm -rf $(KOLABRPMSRC)/$(PACKAGE)
+	rm -rf $(KOLABRPMTMP)/$(PACKAGE)*
+	rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
+	rm -rf *~
+





More information about the commits mailing list