[php-pear-Image-GraphViz] update to 1.3.0

Remi Collet remi at fedoraproject.org
Sun Oct 24 06:15:08 UTC 2010


commit 22b18c1585255458b44454a492d8c919e48d25d9
Author: remi <fedora at famillecollet.com>
Date:   Sun Oct 24 08:15:01 2010 +0200

    update to 1.3.0

 .gitignore                   |    3 +-
 php-pear-Image-GraphViz.spec |   56 ++++++++++++++++++++++++++++++-----------
 sources                      |    2 +-
 xml2changelog                |   40 ++++++++++++++++++++++++++++++
 4 files changed, 84 insertions(+), 17 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2fc1c1d..b314004 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-Image_GraphViz-1.2.1.tgz
+package.xml
+/Image_GraphViz-1.3.0.tgz
diff --git a/php-pear-Image-GraphViz.spec b/php-pear-Image-GraphViz.spec
index a60544e..da5fbc9 100644
--- a/php-pear-Image-GraphViz.spec
+++ b/php-pear-Image-GraphViz.spec
@@ -1,24 +1,25 @@
 %{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
-%global ClassName Image_GraphViz
+%global pear_name Image_GraphViz
 
 Name:           php-pear-Image-GraphViz
-Version:        1.2.1
-Release:        7%{?dist}
+Version:        1.3.0
+Release:        1%{?dist}
 Summary:        Interface to AT&T's GraphViz tools
 
 Group:          Development/Libraries
 License:        PHP
 URL:            http://pear.php.net/package/Image_GraphViz
-Source0:        http://pear.php.net/get/%{ClassName}-%{version}.tgz
+Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
+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(PEAR) >= 1.6.2
+
 Requires:       php-pear(PEAR) graphviz
 Requires(post): %{__pear}
 Requires(postun): %{__pear}
-Provides:       php-pear(%{ClassName}) = %{version}
+Provides:       php-pear(%{pear_name}) = %{version}
 
 %description
 The GraphViz class allows for the creation of and the work with directed and
@@ -27,20 +28,26 @@ undirected graphs and their visualization with AT&T's GraphViz tools.
 
 %prep
 %setup -qc
-[ -f package2.xml ] || mv package.xml package2.xml
-mv package2.xml %{ClassName}-%{version}/%{name}.xml
-cd %{ClassName}-%{version}
+%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 5
+
+# 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
-cd %{ClassName}-%{version}
+cd %{pear_name}-%{version}
 # Empty build section, most likely nothing required.
 
 
 %install
-cd %{ClassName}-%{version}
+cd %{pear_name}-%{version}
 rm -rf $RPM_BUILD_ROOT docdir
-%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
+PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
 
 # Clean up unnecessary files
 rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
@@ -54,6 +61,18 @@ install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
 rm -rf $RPM_BUILD_ROOT
 
 
+%check
+lst=$(find %{buildroot}%{pear_phpdir} -exec grep -q %{buildroot} {} \; -print)
+[ ! -z "$lst" ] && echo "Reference to BUILDROOT in $lst" && exit 1;
+
+cd %{pear_name}-%{version}
+PHPRC=../php.ini %{__pear} \
+   run-tests \
+   -i "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \
+   tests | tee ../testslog
+grep -q "18 PASSED TESTS" ../testslog
+
+
 %post
 %{__pear} install --nodeps --soft --force --register-only \
     %{pear_xmldir}/%{name}.xml >/dev/null ||:
@@ -61,18 +80,25 @@ rm -rf $RPM_BUILD_ROOT
 %postun
 if [ "$1" -eq "0" ]; then
     %{__pear} uninstall --nodeps --ignore-errors --register-only \
-        %{ClassName} >/dev/null ||:
+        %{pear_name} >/dev/null ||:
 fi
 
 
 %files
 %defattr(-,root,root,-)
+%doc CHANGELOG
 %{pear_xmldir}/%{name}.xml
 %{pear_phpdir}/Image
-%{pear_phpdir}/Image/GraphViz.php
+%{pear_testdir}/%{pear_name}
 
 
 %changelog
+* Sun Oct 24 2010 Remi Collet <Fedora at FamilleCollet.com> - 1.3.0-1
+- Version 1.3.0 (stable) - API 1.3.0 (stable)
+- add generated Changelog in %%doc
+- define timezone during build
+- run tests in %%check
+
 * Sun Aug 15 2010 Remi Collet <Fedora at FamilleCollet.com> - 1.2.1-7
 - clean spec
 
diff --git a/sources b/sources
index d024eb1..873f60f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-8828e58960e0d93820cb3bdcce85e705  Image_GraphViz-1.2.1.tgz
+b6ed7a04682818c36aab775f8392005f  Image_GraphViz-1.3.0.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