rpms/php-pear-File-Find/devel php-pear-File-Find.spec, NONE, 1.1 xml2changelog, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Remi Collet (remi) fedora-extras-commits at redhat.com
Sat Apr 5 17:30:05 UTC 2008


Author: remi

Update of /cvs/extras/rpms/php-pear-File-Find/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29800

Modified Files:
	.cvsignore sources 
Added Files:
	php-pear-File-Find.spec xml2changelog 
Log Message:
new package


--- NEW FILE php-pear-File-Find.spec ---
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%define pear_name File_Find

Summary:        Class which facilitates the search of filesystems
Summary(fr):    Classe facilitant la recherche dans le système de fichiers
Name:           php-pear-File-Find
Version:        1.3.0
Release:        1%{?dist}
License:        PHP
Group:          Development/Libraries
Source:         http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source2:        xml2changelog

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL:            http://pear.php.net/package/File_Find

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}


%description
File_Find, created as a replacement for its Perl counterpart, also named
File_Find, is a directory searcher, which handles, globbing, recursive
directory searching, as well as a slew of other cool features.


%description -l fr
File_Find, créé comme un équivalent à son homologue perl, aussi nommé
Find_File, est un outil de recherche de répertoire qui gère les motifs,
les recherches récursives aussi bien que beaucoup d'autres fonctionnalités
sympathiques.


%prep
%setup -c -q
# still a 1.0 package.xml
%{__pear} convert package.xml package2.xml

%{_bindir}/php -n %{SOURCE2} package2.xml >CHANGELOG
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml


%build
# Empty build section


%install
rm -rf %{buildroot} docdir

pushd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{pear_name}.xml

# Clean up unnecessary files
rm -rf %{buildroot}%{pear_phpdir}/.??*

# Install XML package description
%{__mkdir_p} %{buildroot}%{pear_xmldir}
%{__install} -pm 644 %{pear_name}.xml %{buildroot}%{pear_xmldir}

popd
# Sort out documentation
#mv %{buildroot}%{pear_docdir}/%{pear_name}/docs docdir
#mv %{buildroot}%{pear_docdir}/%{pear_name}/examples docdir/examples


%clean
rm -rf %{buildroot}


%check
lst=$(find %{buildroot}%{pear_phpdir} -exec grep -q %{buildroot} {} \; -print)
[ ! -z "$lst" ] && echo "Reference to BUILDROOT in $lst" && exit 1;

# For documentation purpose only
# After install, as root :
# pear run-tests -p File_Find
# Actually all tests "could" failed because of return order... :(


%post
%{__pear} install --nodeps --soft --force --register-only %{pear_xmldir}/%{pear_name}.xml >/dev/null || :


%postun
if [ "$1" -eq "0" ]; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only %{pear_name} >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc CHANGELOG
%dir %{pear_phpdir}/File
%{pear_phpdir}/File/Find.php
%{pear_testdir}/%{pear_name}
%{pear_xmldir}/%{pear_name}.xml


%changelog
* Fri Apr 04 2008 Remi Collet <Fedora at FamilleCollet.com> 1.3.0-1
- initial RPM



--- NEW FILE xml2changelog ---
<?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);
}
?>


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/php-pear-File-Find/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	5 Apr 2008 16:51:18 -0000	1.1
+++ .cvsignore	5 Apr 2008 17:29:25 -0000	1.2
@@ -0,0 +1 @@
+File_Find-1.3.0.tgz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/php-pear-File-Find/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	5 Apr 2008 16:51:18 -0000	1.1
+++ sources	5 Apr 2008 17:29:25 -0000	1.2
@@ -0,0 +1 @@
+f3745971cd0d7442160a050255d5e17f  File_Find-1.3.0.tgz




More information about the fedora-extras-commits mailing list