[php-pear-Net-URL-Mapper/el6/master] update to 0.9.1 - QA release

Remi Collet remi at fedoraproject.org
Wed Oct 27 18:07:50 UTC 2010


commit e4d40f667c16b623d56d4a3781c356a4d829a8ae
Author: remi <fedora at famillecollet.com>
Date:   Wed Oct 27 20:01:03 2010 +0200

    update to 0.9.1 - QA release

 .gitignore                   |    1 +
 Net_URL_Mapper-tests.patch   |  102 ------------------------------------------
 php-pear-Net-URL-Mapper.spec |   38 +++++++++++-----
 sources                      |    2 +-
 xml2changelog                |   40 ++++++++++++++++
 5 files changed, 68 insertions(+), 115 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index fe6ac75..9046547 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 Net_URL_Mapper-0.9.0.tgz
 package.xml
+/Net_URL_Mapper-0.9.1.tgz
diff --git a/php-pear-Net-URL-Mapper.spec b/php-pear-Net-URL-Mapper.spec
index 3817ea9..eaa8b9c 100644
--- a/php-pear-Net-URL-Mapper.spec
+++ b/php-pear-Net-URL-Mapper.spec
@@ -2,27 +2,30 @@
 %global pear_name Net_URL_Mapper
 
 Name:           php-pear-Net-URL-Mapper
-Version:        0.9.0
-Release:        5%{?dist}
+Version:        0.9.1
+Release:        1%{?dist}
 Summary:        Simple and flexible way to build nice URLs for web applications
 
 Group:          Development/Languages
 License:        BSD
 URL:            http://pear.php.net/package/Net_URL_Mapper
 Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Patch0:         Net_URL_Mapper-tests.patch
+Source2:        xml2changelog
 
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 BuildRequires:  php-pear >= 1:1.4.9-1.2
-BuildRequires:  php-pear-PHPUnit
+# for tests
+BuildRequires:  php-pear(pear.phpunit.de/PHPUnit)
+BuildRequires:  php-pear(Net_URL) >= 1.0.14
+
 Requires:       php-pear(PEAR)
 Requires:       php-pear(Net_URL) >= 1.0.14
 Requires(post): %{__pear}
 Requires(postun): %{__pear}
 Provides:       php-pear(%{pear_name}) = %{version}
 
+
 %description
 Net_URL_Mapper provides a simple and flexible way to build nice URLs for your
 web applications.
@@ -35,7 +38,7 @@ frameworks and therefore can be used with your own router.
 
 %prep
 %setup -qc
-%patch0 -p1
+%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 10
 
 # Create a "localized" php.ini to avoid build warning
 cp /etc/php.ini .
@@ -81,20 +84,31 @@ fi
 
 
 %check
-# check does not work under mock (and requires old PHPUnit)
-# cd /usr/share/pear/test/Net_URL_Mapper/tests
-# sh run
+cd %{pear_name}-%{version}
+phpunit \
+   -d date.timezone=UTC \
+   -d include_path=%{pear_phpdir}:$RPM_BUILD_ROOT%{pear_phpdir} \
+   tests
 
 
 %files
 %defattr(-,root,root,-)
+%doc CHANGELOG
 %{pear_xmldir}/%{name}.xml
 %{pear_testdir}/%{pear_name}
-%dir %{pear_phpdir}/Net/URL
-%{pear_phpdir}/Net/URL/Mapper*
+%{pear_datadir}/%{pear_name}
+# Net_URL own Net but not Net/URL
+%{pear_phpdir}/Net/URL
+# Packaging stuff
+%exclude %{_bindir}/*php
 
 
 %changelog
+* Wed Oct 27 2010 Remi Collet <Fedora at FamilleCollet.com> - 0.9.1-1
+- Version 0.9.1 (beta) - API 1.0.0 (stable)
+- add generated Changelog
+- run tests in %%check
+
 * Wed Aug 18 2010 Remi Collet <Fedora at FamilleCollet.com> - 0.9.0-5
 - rename Net_URL_Mapper.xml to php-pear-Net-URL-Mapper.xml
 - set date.timezone during build
diff --git a/sources b/sources
index d75febc..ab2c71b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-11a4d002f881ac5d957cdbb6b46139f7  Net_URL_Mapper-0.9.0.tgz
+0d27b8d5a6a3e38b310807f2fcee996f  Net_URL_Mapper-0.9.1.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