gunnar: server/pear/Horde_Browser .cvsignore, 1.1, 1.2 Horde_Browser.spec, 1.5, 1.6 Makefile, 1.3, 1.4

cvs at kolab.org cvs at kolab.org
Mon May 18 18:12:30 CEST 2009


Author: gunnar

Update of /kolabrepository/server/pear/Horde_Browser
In directory doto:/tmp/cvs-serv4343/Horde_Browser

Modified Files:
	.cvsignore Horde_Browser.spec Makefile 
Log Message:
Started centralizing the PEAR package Makefile. This reduces the amount of Makefile code and should streamline the way we generate RPMs from PEAR packages. At the same time it should allow to deal with PEAR packages derived from CVS/git as we still need to cope with the bad package management Horde 3 provides.

Index: .cvsignore
===================================================================
RCS file: /kolabrepository/server/pear/Horde_Browser/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- .cvsignore	10 Sep 2008 10:04:49 -0000	1.1
+++ .cvsignore	18 May 2009 16:12:28 -0000	1.2
@@ -1 +1,3 @@
 *.src.rpm
+*.tgz
+package.patch

Index: Horde_Browser.spec
===================================================================
RCS file: /kolabrepository/server/pear/Horde_Browser/Horde_Browser.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Horde_Browser.spec	11 May 2009 19:38:46 -0000	1.5
+++ Horde_Browser.spec	18 May 2009 16:12:28 -0000	1.6
@@ -2,8 +2,14 @@
 %define         V_horde_pkgdir Browser
 %define         V_horde_package Horde_Browser
 %define         V_package Horde_Browser
+%define         V_package_origin VC-CVS
+%define         V_repo_commit HORDE_3_3_4
+%define         V_repo_release 20090501
 %define         V_version 0.0.2dev20090501
-%define         V_release 1
+%define         V_release 20090518
+%define         V_sourceurl http://pear.horde.org/get
+%define         V_php_lib_loc php
+%define         V_www_loc client
 
 # Package Information
 Name:	   %{V_package}
@@ -17,7 +23,10 @@
 Distribution:	OpenPKG
 
 # List of Sources
-Source:    http://pear.horde.org/get/%{V_horde_package}-%{V_version}.tgz
+Source:    %{V_sourceurl}/%{V_package}-%{V_version}.tgz
+
+# List of patches
+Patch0:    package.patch
 
 # Build Info
 Prefix:	   %{l_prefix}
@@ -25,15 +34,18 @@
 
 #Pre requisites
 BuildPreReq:  OpenPKG, openpkg >= 20070603
-BuildPreReq:  php, php::with_pear = yes
+BuildPreReq:  php >= 5.2.8, php::with_pear = yes
 BuildPreReq:  PEAR-Horde-Channel
 PreReq:       OpenPKG, openpkg >= 20070603
-PreReq:       php, php::with_pear = yes
+PreReq:       php >= 5.2.8, php::with_pear = yes
 PreReq:       Horde_Util
 
 Provides:     horde-framework-kolab = 3.2_rc3-20081209
 Obsoletes:    horde-framework-kolab < 3.2_rc3-20081209
 
+# Package options
+%option       with_chroot              no
+
 %description 
 The Horde_Browser:: class provides an API for getting information
 about the current users browser and its capabilities.
@@ -41,13 +53,28 @@
 %prep
 	%setup -n %{V_horde_package}-%{V_version}
 
+        if [ -n "`cat %{PATCH0}`" ]; then
+	    %patch -p0 -P 0
+	fi
+
+	cat ../package.xml | sed -e 's/md5sum="[^"]*"//' > package.xml
+
 %build
 
 %install
         env PHP_PEAR_PHP_BIN="%{l_prefix}/bin/php -d safe_mode=off -d memory_limit=40M"   \
             PHP_PEAR_CACHE_DIR="/tmp/pear/cache" \
-	    %{l_prefix}/bin/pear install --offline --force --nodeps -P $RPM_BUILD_ROOT $RPM_SOURCE_DIR/%{V_horde_package}-%{V_version}.tgz
-	rm -rf $RPM_BUILD_ROOT/%{l_prefix}/lib/php/{.filemap,.lock,.channels,.depdb,.depdblock}
+	    %{l_prefix}/bin/pear -d www_dir="%{l_prefix}/var/kolab/www/%{V_www_loc}"   \
+	                         -d php_dir="%{l_prefix}/lib/%{V_php_lib_loc}"         \
+                                 install --offline --force --nodeps -P $RPM_BUILD_ROOT \
+	                         $RPM_SOURCE_DIR/%{V_horde_package}-%{V_version}.tgz
+	rm -rf $RPM_BUILD_ROOT/%{l_prefix}/lib/%{V_php_lib_loc}/{.filemap,.lock,.channels,.depdb,.depdblock}
+
+        # With chroot
+        %if "%{with_chroot}" == "yes"
+                %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/kolab/www/%{l_prefix}/lib
+                cp -a $RPM_BUILD_ROOT/%{l_prefix}/lib/%{V_php_lib_loc} $RPM_BUILD_ROOT%{l_prefix}/var/kolab/www/%{l_prefix}/lib/
+        %endif
 
         %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 
 

Index: Makefile
===================================================================
RCS file: /kolabrepository/server/pear/Horde_Browser/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile	11 May 2009 19:38:46 -0000	1.3
+++ Makefile	18 May 2009 16:12:28 -0000	1.4
@@ -1,155 +1 @@
-# 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
-
-# Determine the staging area for collecting new source rpms
-ifeq "x$(STAGING)" "x"
-  STAGING = ../../stage
-endif
-
-# Determine the horde package name from the *.spec file
-HORDE_PKGDIR = $(shell grep "%define[ ]*V_horde_pkgdir" *.spec | sed -e "s/.*V_horde_pkgdir \([A-Za-z\-\_]*\).*/\1/")
-
-# Determine the horde package name from the *.spec file
-HORDE_PACKAGE = $(shell grep "%define[ ]*V_horde_package" *.spec | sed -e "s/.*V_horde_package \([A-Za-z\-\_]*\).*/\1/")
-
-# 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.a-z]*\).*/\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=$(HORDE_PACKAGE)-$(VERSION).tgz
-
-# Generate a list of extra files for the package
-EXTRA=ChangeLog $(PATCHES)
-
-# CVS information
-UPSTREAM=../upstream/cvs
-REPO=framework
-REPO_URL=:pserver:cvsread at anoncvs.horde.org:/repository
-REPO_UP_CMD=cvs update
-REPO_CO_CMD=cvs -d $(REPO_URL) co
-REPO_SC_CMD=cvs update -r
-COMMIT=HORDE_3_3_4
-RELTAG=20090501
-DATE=$(shell date +%Y-%m-%d)
-PEAR=$(HOME)/bin/pear
-
-# 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
-	test -d $(STAGING) || mkdir $(STAGING)
-	cp $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm $(STAGING)
-
-# 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
-
-# Target location for the CVS checkout
-$(UPSTREAM):
-	mkdir -p $(UPSTREAM)
-
-# Target for generating the CVS checkout
-.PHONY: $(UPSTREAM)/$(REPO)
-$(UPSTREAM)/$(REPO):
-	if [ -e $(UPSTREAM)/$(REPO) ]; then                     \
-	  cd $(UPSTREAM)/$(REPO) && $(REPO_SC_CMD) "$(COMMIT)"; \
-	else                                                    \
-	  @echo The password is 'horde';                        \
-	  cvs -d $(REPO_URL) login;                             \
-	  cd $(UPSTREAM) && $(REPO_CO_CMD) $(REPO);             \
-	  cd $(UPSTREAM)/$(REPO) && $(REPO_SC_CMD) "$(COMMIT)"; \
-	fi;
-
-# Generate the source pacakge fron the CVS checkout
-.PHONY: $(SOURCE_0)
-$(SOURCE_0): $(UPSTREAM) $(UPSTREAM)/$(REPO)
-	rm -rf tmp
-	mkdir tmp
-	cp -r $(UPSTREAM)/$(REPO)/$(HORDE_PKGDIR) tmp/$(PACKAGE)
-	sed -i -e "/version/,+1 s#<release>\(.*\)</release>#<release>\1dev$(RELTAG)</release>#" tmp/$(PACKAGE)/package.xml
-	sed -i -e "/lead/,+1 s#<date>.*</date>#<date>$(DATE)</date>#" tmp/$(PACKAGE)/package.xml
-	$(PEAR) package tmp/$(PACKAGE)/package.xml
-	rm -rf tmp
-
-# Target for retrieving the source package
-$(KOLABRPMSRC)/$(PACKAGE)/$(SOURCE_0): $(SOURCE_0)
-	test -d $(KOLABRPMSRC)/$(PACKAGE) || mkdir $(KOLABRPMSRC)/$(PACKAGE)
-	cp $(SOURCE_0) $(KOLABRPMSRC)/$(PACKAGE)/
-
-# 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 .
-
-# 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 *~
-
+include ../Horde.mk





More information about the commits mailing list