[Fedora-packaging] Including a CHANGELOG in php-pear extension package.

Remi Collet Fedora at FamilleCollet.com
Wed Sep 13 16:59:52 UTC 2006


Do you thinks it's a good idea ?

I wrote a little script to extract the CHANGELOG from the package.xml 
provided by the upstream package.

Only have to add to the spec :

Source2:        xml2changelog

In %prep :
  %setup -q -c
  [ -f package2.xml ] || mv package.xml package2.xml
+ %{_bindir}/php -n %{SOURCE2} package2.xml >CHANGELOG
  mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml

and, of course
%doc CHANGELOG

Here is my script :

<?php
$prog=array_shift($_SERVER['argv']);
if ($_SERVER['argc']<2) die ("usage : " . $prog . " path_to_package.xml\n");
$file=array_shift($_SERVER['argv']);

($xml=simplexml_load_file($file)) || die ($file . " not found !\n");
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 Fedora-packaging mailing list