packages: php-packagexml2cl/php-packagexml2cl.spec (NEW), php-packagexml2cl...
glen
glen at pld-linux.org
Thu Mar 25 11:17:19 CET 2010
Author: glen Date: Thu Mar 25 10:17:19 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- xml2changelog from fedora repository,
I have no better ideas how to name the script and package,
I did my best to make it logical.
---- Files affected:
packages/php-packagexml2cl:
php-packagexml2cl.spec (NONE -> 1.1) (NEW), xml2changelog (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/php-packagexml2cl/php-packagexml2cl.spec
diff -u /dev/null packages/php-packagexml2cl/php-packagexml2cl.spec:1.1
--- /dev/null Thu Mar 25 11:17:19 2010
+++ packages/php-packagexml2cl/php-packagexml2cl.spec Thu Mar 25 11:17:14 2010
@@ -0,0 +1,44 @@
+# $Revision$, $Date$
+%include /usr/lib/rpm/macros.php
+%define php_min_version 5.0.0
+%define pkgname packagexml2cl
+Summary: Program to convert PEAR package.xml to ChangeLog format
+Name: php-%{pkgname}
+Version: 0.1
+Release: 0.1
+License: GPL v2
+Group: Development/Languages/PHP
+Source0: xml2changelog
+BuildRequires: rpm-php-pearprov >= 4.4.2-11
+BuildRequires: rpmbuild(macros) >= 1.461
+Requires: php-common >= 4:%{php_min_version}
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Program to convert PEAR package.xml to ChangeLog format.
+
+%prep
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_bindir}
+install -p %{SOURCE0} $RPM_BUILD_ROOT%{_bindir}/%{pkgname}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{pkgname}
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2010/03/25 10:17:14 glen
+- xml2changelog from fedora repository,
+ I have no better ideas how to name the script and package,
+ I did my best to make it logical.
================================================================
Index: packages/php-packagexml2cl/xml2changelog
diff -u /dev/null packages/php-packagexml2cl/xml2changelog:1.1
--- /dev/null Thu Mar 25 11:17:19 2010
+++ packages/php-packagexml2cl/xml2changelog Thu Mar 25 11:17:14 2010
@@ -0,0 +1,34 @@
+<?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))
+ foreach($xml->changelog->release as $rel) {
+ $old=$rel->version->release;
+ if ("$old" != "$new") {
+ 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 pld-cvs-commit
mailing list