[php-pear-HTML-QuickForm/f14/master] update to 3.2.12 - bugfix

Remi Collet remi at fedoraproject.org
Sun Oct 17 08:57:53 UTC 2010


commit 09ea03f4306731cb0b07a6a13276e58961161f13
Author: remi <fedora at famillecollet.com>
Date:   Sun Oct 17 10:57:44 2010 +0200

    update to 3.2.12 - bugfix

 .gitignore                   |    2 +
 php-pear-HTML-QuickForm.spec |   49 +++++++++++++++++++++++++++--------------
 sources                      |    2 +-
 xml2changelog                |   40 ++++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 18 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3e39f4e..94e685d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
 HTML_QuickForm-3.2.11.tgz
+package.xml
+/HTML_QuickForm-3.2.12.tgz
diff --git a/php-pear-HTML-QuickForm.spec b/php-pear-HTML-QuickForm.spec
index 6037fa4..54ece18 100644
--- a/php-pear-HTML-QuickForm.spec
+++ b/php-pear-HTML-QuickForm.spec
@@ -1,8 +1,8 @@
 %{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
-%define pear_name HTML_QuickForm
+%global pear_name HTML_QuickForm
 
 Name:           php-pear-HTML-QuickForm
-Version:        3.2.11
+Version:        3.2.12
 Release:        1%{?dist}
 Summary:        Class for creating, validating, processing HTML forms
 
@@ -10,12 +10,14 @@ Group:          Development/Libraries
 License:        PHP
 URL:            http://pear.php.net/package/HTML_QuickForm
 Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
-Source1:        PHP-LICENSE-3.01
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source2:        xml2changelog
 
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 BuildRequires:  php-pear >= 1:1.4.9-1.2
-Requires:       php-pear(PEAR) php-pear(HTML_Common) >= 1.2.1
+
+Requires:       php-pear(PEAR) 
+Requires:       php-pear(HTML_Common) >= 1.2.1
 Requires(post): %{__pear}
 Requires(postun): %{__pear}
 Provides:       php-pear(%{pear_name}) = %{version}
@@ -29,7 +31,7 @@ Features:
 * XHTML compliant generated code.
 * Numerous mixable and extendable validation rules.
 * Automatic server-side validation and filtering.
-* On request javascript code generation for client-side validation.
+* On request JavaScript code generation for client-side validation.
 * File uploads support.
 * Total customization of form rendering.
 * Support for external template engines (ITX, Sigma, Flexy, Smarty).
@@ -38,10 +40,15 @@ Features:
 
 %prep
 %setup -qc
-[ -f package2.xml ] || mv package.xml package2.xml
-mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml
-install -pm 644 -c %{SOURCE1} LICENSE
+%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 10
+
+# Create a "localized" php.ini to avoid build warning
+cp /etc/php.ini .
+echo "date.timezone=UTC" >>php.ini
+
 cd %{pear_name}-%{version}
+# package.xml is V2
+mv ../package.xml %{name}.xml
 
 
 %build
@@ -50,22 +57,22 @@ cd %{pear_name}-%{version}
 
 
 %install
+rm -rf $RPM_BUILD_ROOT docs
 cd %{pear_name}-%{version}
-rm -rf $RPM_BUILD_ROOT docdir
-%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{pear_name}.xml
+PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
 
 # Move documentation
 mkdir -p docdir
-mv $RPM_BUILD_ROOT%{pear_docdir}/* docdir
+mv $RPM_BUILD_ROOT%{pear_docdir}/%{pear_name}/docs ../docs
 # fix line endings
-find docdir/HTML_QuickForm/docs -type f -exec sed -i 's/\r//' {} \;
+find ../docs -type f -exec sed -i 's/\r//' {} \;
 
 # Clean up unnecessary files
 rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
 
 # Install XML package description
 install -d $RPM_BUILD_ROOT%{pear_xmldir}
-install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
+install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
 
 
 %clean
@@ -74,7 +81,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 %{__pear} install --nodeps --soft --force --register-only \
-    %{pear_xmldir}/%{pear_name}.xml >/dev/null || :
+    %{pear_xmldir}/%{name}.xml >/dev/null || :
 
 %postun
 if [ $1 -eq 0 ] ; then
@@ -85,12 +92,20 @@ fi
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE %{pear_name}-%{version}/docdir/%{pear_name}/docs
-%{pear_xmldir}/%{pear_name}.xml
+%doc CHANGELOG docs
+%{pear_xmldir}/%{name}.xml
 %{pear_phpdir}/HTML/QuickForm*
 
 
 %changelog
+* Sun Oct 17 2010 Remi Collet <Fedora at FamilleCollet.com> - 3.2.12-1
+- Version 3.2.12 (stable) - API 3.2.6 (stable)
+- add generated Changelog
+- clean define
+- remove LICENSE (not provided by upstream)
+- rename HTML_QuickForm.xml to php-pear-HTML-QuickForm.xml
+- set date.timezone during build
+
 * Sat Sep 05 2009 Christopher Stone <chris.stone at gmail.com> 3.2.11-1
 - Upstream sync
 - Fix line endings in docs
diff --git a/sources b/sources
index 7394125..0622c77 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-2320341c734fec60549a3e5145fbe8e7  HTML_QuickForm-3.2.11.tgz
+5742a1e1a7400120bf48ffcd4acaf1d8  HTML_QuickForm-3.2.12.tgz
diff --git a/xml2changelog b/xml2changelog
new file mode 100644
index 0000000..eb6bd31
--- /dev/null
+++ b/xml2changelog
@@ -0,0 +1,40 @@
+<?php
+$prog=array_shift($_SERVER['argv']);
+if ($_SERVER['argc']<2) die ("usage : " . $prog . " path_to_package.xml [ --debug ]\n");
+$file=array_shift($_SERVER['argv']);
+
+($xml=simplexml_load_file($file)) || die ($file . " not found !\n");
+if (in_array("--debug", $_SERVER['argv'])) print_r($xml);
+
+if ($xml['version'] >= "2"){ // Package.xml V 2.0
+	printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
+		$xml->version->release, $xml->stability->release, 
+		$xml->version->api, $xml->stability->api, 
+		$xml->date, $xml->notes);
+	$new=$xml->version->release;
+
+	if (isset($xml->changelog->release) && count($xml->changelog->release)) {
+		$tab = array();
+		foreach($xml->changelog->release as $rel) {
+			$old=$rel->version->release;
+			if ("$old" != "$new") {
+				$tab[''.$rel->date] = $rel;
+			}
+		}	
+		krsort($tab);
+		foreach($tab as $rel) {
+			printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
+				$rel->version->release, $rel->stability->release, 
+				$rel->version->api, $rel->stability->api, 
+				$rel->date, $rel->notes);
+	    	}
+	}
+} else { // Package.xml V 1.0
+	printf("* Version %s (%s) - %s\n\n%s\n\n",
+		$xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes);
+
+	foreach($xml->changelog->release as $rel)
+		printf("* Version %s (%s) - %s\n\n%s\n\n",
+			$rel->version, $rel->state, $rel->date, $rel->notes);
+}
+?>


More information about the scm-commits mailing list