[Fusionforge-commits] r11594 - in trunk: . 3rd-party 3rd-party/php-pear-HTTP_WebDAV_Server src tests/scripts

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Sun Nov 21 20:57:20 CET 2010


Author: aljeux
Date: 2010-11-21 20:57:19 +0100 (Sun, 21 Nov 2010)
New Revision: 11594

Added:
   trunk/3rd-party/Makefile.rh
   trunk/3rd-party/php-pear-HTTP_WebDAV_Server/
   trunk/3rd-party/php-pear-HTTP_WebDAV_Server/php-pear-HTTP_WebDAV_Server.spec
Modified:
   trunk/Makefile.rh
   trunk/src/fusionforge-install-1-deps.php
   trunk/src/fusionforge.spec
   trunk/tests/scripts/fusionforge-build-and-test-rpm.sh
Log:
New RPM for pear HTTP_WEBDAV module.
Makefile for 3rd party relocated to 3rd-party.
Add -e to build script to stop on errors.

Added: trunk/3rd-party/Makefile.rh
===================================================================
--- trunk/3rd-party/Makefile.rh	                        (rev 0)
+++ trunk/3rd-party/Makefile.rh	2010-11-21 19:57:19 UTC (rev 11594)
@@ -0,0 +1,53 @@
+#! /usr/bin/make -f
+#
+# Build 3rd party rpms like htmlpurifier, jpgraph.
+#
+# Once built, packages are in $RPM_TMP
+
+RPM_TMP=~/rpmbuild
+DEPOT=~/depot
+BUILDRESULT=~/fusionforge_repo
+
+HTMLPURIFIER_VERSION=4.2.0
+WEBDAV_SERVER_VERSION=1.0.0RC5
+
+all: htmlpurifier php-jpgraph php-pear-HTTP_WebDAV_Server dist
+
+rpmprep:
+	-rm -Rf $(RPM_TMP)/*
+	-rm -Rf ~/.rpmmacros
+	sh ../tools/rpmdev-setuptree
+	echo '%_tmppath %{_topdir}/TMP' >> ~/.rpmmacros
+	echo '%_buildroot %{_tmppath}/%{name}-root' >> ~/.rpmmacros
+	echo '%_sysconfdir /etc' >> ~/.rpmmacros
+	mkdir $(RPM_TMP)/TMP
+
+dist:
+	-mkdir -p $(BUILDRESULT)
+	cp $(RPM_TMP)/RPMS/noarch/*.rpm $(BUILDRESULT)
+	createrepo $(BUILDRESULT)
+
+#
+# Building RPM for external components
+#
+htmlpurifier: rpmprep $(DEPOT)/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
+	cp $(DEPOT)/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz $(RPM_TMP)/SOURCES/
+	rpmbuild --quiet --clean -ba htmlpurifier/htmlpurifier.spec
+
+php-jpgraph: rpmprep
+	cp php-jpgraph/libphp-jpgraph_1.5.2.orig.tar.gz $(RPM_TMP)/SOURCES/jpgraph-1.5.2.tar.gz
+	zcat php-jpgraph/libphp-jpgraph_1.5.2-12.diff.gz > $(RPM_TMP)/SOURCES/libphp-jpgraph_1.5.2-12.diff
+	cp php-jpgraph/*.patch $(RPM_TMP)/SOURCES/
+	rpmbuild --quiet --clean -ba php-jpgraph/php-jpgraph.spec
+
+php-pear-HTTP_WebDAV_Server: rpmprep $(DEPOT)/HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz
+	cp $(DEPOT)/HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz $(RPM_TMP)/SOURCES/
+	rpmbuild --quiet --clean -ba php-pear-HTTP_WebDAV_Server/php-pear-HTTP_WebDAV_Server.spec
+
+$(DEPOT)/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz: rpmprep
+	mkdir -p $(DEPOT)
+	cd $(DEPOT); wget -q -N http://htmlpurifier.org/releases/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
+
+$(DEPOT)/HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz: rpmprep
+	mkdir -p $(DEPOT)
+	cd $(DEPOT); wget -q -N http://download.pear.php.net/package/HTTP_WebDAV_Server-$(WEBDAV_SERVER_VERSION).tgz

Added: trunk/3rd-party/php-pear-HTTP_WebDAV_Server/php-pear-HTTP_WebDAV_Server.spec
===================================================================
--- trunk/3rd-party/php-pear-HTTP_WebDAV_Server/php-pear-HTTP_WebDAV_Server.spec	                        (rev 0)
+++ trunk/3rd-party/php-pear-HTTP_WebDAV_Server/php-pear-HTTP_WebDAV_Server.spec	2010-11-21 19:57:19 UTC (rev 11594)
@@ -0,0 +1,76 @@
+%define peardir /usr/share/pear
+%define xmldir  /var/lib/pear
+
+Summary: PEAR: WebDAV Server Baseclass
+Name: php-pear-HTTP_WebDAV_Server
+Version: 1.0.0RC5
+Release: 1
+License: New BSD License
+Group: Development/Libraries
+Source0: http://pear.php.net/get/HTTP_WebDAV_Server-%{version}.tgz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+URL: http://pear.php.net/package/HTTP_WebDAV_Server
+#BuildRequires: PEAR::PEAR >= 1.4.7
+
+BuildArch: noarch
+
+Requires: php-pear
+
+%description
+RFC2518 compliant helper class for WebDAV server implementation.
+
+%prep
+%setup -c -T
+pear -q -c pearrc \
+        -d php_dir=%{peardir} \
+        -d doc_dir=/docs \
+        -d bin_dir=%{_bindir} \
+        -d data_dir=%{peardir}/data \
+        -d test_dir=%{peardir}/tests \
+        -d ext_dir=%{_libdir} \
+        -s
+
+%build
+
+%install
+rm -rf %{buildroot}
+pear channel-update pear.php.net
+pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0}
+
+# Clean up unnecessary files
+rm pearrc
+rm %{buildroot}/%{peardir}/.filemap
+rm %{buildroot}/%{peardir}/.lock
+rm -rf %{buildroot}/%{peardir}/.registry
+rm -rf %{buildroot}%{peardir}/.channels
+rm %{buildroot}%{peardir}/.depdb
+rm %{buildroot}%{peardir}/.depdblock
+
+mv %{buildroot}/docs .
+
+
+# Install XML package description
+mkdir -p %{buildroot}%{xmldir}
+tar -xzf %{SOURCE0} package.xml
+cp -p package.xml %{buildroot}%{xmldir}/HTTP_WebDAV_Server.xml
+
+%clean
+rm -rf %{buildroot}
+
+%post
+pear install --nodeps --soft --force --register-only %{xmldir}/HTTP_WebDAV_Server.xml 2>&1 >/dev/null
+
+%postun
+if [ "$1" -eq "0" ]; then
+    pear uninstall --nodeps --ignore-errors --register-only pear.php.net/HTTP_WebDAV_Server 2>&1 >/dev/null
+fi
+
+%files
+%defattr(-,root,root)
+%doc docs/HTTP_WebDAV_Server/*
+%{peardir}/*
+%{xmldir}/HTTP_WebDAV_Server.xml
+
+%changelog
+* Sat Nov 20 2010 Alain Peyrat <aljeux at free.fr>  - 1.0.0RC5
+- Initial packaging

Modified: trunk/Makefile.rh
===================================================================
--- trunk/Makefile.rh	2010-11-21 19:49:38 UTC (rev 11593)
+++ trunk/Makefile.rh	2010-11-21 19:57:19 UTC (rev 11594)
@@ -7,8 +7,6 @@
 RPM_TMP=~/rpmbuild
 BUILDRESULT=~/fusionforge_repo
 
-HTMLPURIFIER_VERSION=4.2.0
-
 VER=$(shell LANG=C grep '>software_version' src/common/include/FusionForge.class.php | cut -d\' -f2)
 in_svn_repo:= $(wildcard .svn/)
 ifeq ($(strip $(in_svn_repo)),)
@@ -33,10 +31,8 @@
 	@echo ======================================================================================
 	@cat Makefile.rh | grep '^.*:.*#$$' | sed 's/^\(.*:\).*#\(.*\)#$$/\1		\2/'
 
-all: fusionforge externals dist
+all: 3rd-party fusionforge dist
 
-externals : htmlpurifier php-jpgraph
-
 rpmprep:
 	-rm -Rf $(RPM_TMP)/*
 	-rm -Rf ~/.rpmmacros
@@ -48,8 +44,7 @@
 
 dist:
 	-mkdir -p $(BUILDRESULT)
-	cp $(RPM_TMP)/SRPMS/*.rpm $(BUILDRESULT)
-	cp $(RPM_TMP)/RPMS/noarch/*.rpm  $(BUILDRESULT)
+	cp $(RPM_TMP)/RPMS/noarch/*.rpm $(BUILDRESULT)
 	createrepo $(BUILDRESULT)
 
 clean:		# Clean files of fusionforge build                         #
@@ -64,19 +59,7 @@
 	sed -e 's/@@VERSION@@/$(version)/g' < src/fusionforge.spec > $(RPM_TMP)/TMP/fusionforge.spec
 	rpmbuild -bb $(RPM_TMP)/TMP/fusionforge.spec
 
-#
-# Building RPM for external components
-#
-htmlpurifier: rpmprep depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
-	cp depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz $(RPM_TMP)/SOURCES/
-	rpmbuild --quiet --clean -ba 3rd-party/htmlpurifier/htmlpurifier.spec
+3rd-party:
+	cd 3rd-party; $(MAKE) -f Makefile.rh all
 
-php-jpgraph: rpmprep
-	cp 3rd-party/php-jpgraph/libphp-jpgraph_1.5.2.orig.tar.gz $(RPM_TMP)/SOURCES/jpgraph-1.5.2.tar.gz
-	zcat 3rd-party/php-jpgraph/libphp-jpgraph_1.5.2-12.diff.gz > $(RPM_TMP)/SOURCES/libphp-jpgraph_1.5.2-12.diff
-	cp 3rd-party/php-jpgraph/*.patch $(RPM_TMP)/SOURCES/
-	rpmbuild --quiet --clean -ba 3rd-party/php-jpgraph/php-jpgraph.spec
-
-depot/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz: rpmprep
-	mkdir -p depot
-	cd depot; wget -q -N http://htmlpurifier.org/releases/htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
+.PHONY : 3rd-party

Modified: trunk/src/fusionforge-install-1-deps.php
===================================================================
--- trunk/src/fusionforge-install-1-deps.php	2010-11-21 19:49:38 UTC (rev 11593)
+++ trunk/src/fusionforge-install-1-deps.php	2010-11-21 19:57:19 UTC (rev 11594)
@@ -49,7 +49,7 @@
 	addFusionForgeYumRepo();
 	addDagRPMForgeYumRepo();
 	INFO("Installing packages: Executing YUM. Please wait...\n\n\n");
-	passthru("yum -y install httpd php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh which liberation-fonts htmlpurifier php-mbstring php-jpgraph-1.5.2 poppler-utils php-pecl-zip antiword");
+	passthru("yum -y install httpd php mailman cvs postgresql postgresql-libs postgresql-server postgresql-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh which liberation-fonts htmlpurifier php-mbstring php-jpgraph-1.5.2 poppler-utils php-pecl-zip php-pear-HTTP_WebDAV_Server antiword");
 }
 
 function installDebian() {

Modified: trunk/src/fusionforge.spec
===================================================================
--- trunk/src/fusionforge.spec	2010-11-21 19:49:38 UTC (rev 11593)
+++ trunk/src/fusionforge.spec	2010-11-21 19:57:19 UTC (rev 11594)
@@ -63,6 +63,7 @@
 Requires: sed
 Requires: coreutils
 Requires: /usr/bin/newaliases
+Requires: php-pear-HTTP_WebDAV_Server
  
 # BuildRequires: sed, perl
 

Modified: trunk/tests/scripts/fusionforge-build-and-test-rpm.sh
===================================================================
--- trunk/tests/scripts/fusionforge-build-and-test-rpm.sh	2010-11-21 19:49:38 UTC (rev 11593)
+++ trunk/tests/scripts/fusionforge-build-and-test-rpm.sh	2010-11-21 19:57:19 UTC (rev 11594)
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh -xe
 
 export CURDIR=`pwd`
 export WORKSPACE=${WORKSPACE:-$CURDIR}




More information about the Fusionforge-commits mailing list