rpms/php-pecl-phar/devel php-pecl-phar.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
Sun Jul 15 14:27:21 UTC 2007


Author: remi

Update of /cvs/extras/rpms/php-pecl-phar/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24190

Modified Files:
	.cvsignore sources 
Added Files:
	php-pecl-phar.spec xml2changelog 
Log Message:
New package


--- NEW FILE php-pecl-phar.spec ---
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%global php_apiver  %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
%global php_extdir  %(php-config --extension-dir 2>/dev/null || echo "undefined")

%define pecl_name phar

Summary:      Allows running of complete applications out of .phar files
Name:         php-pecl-phar
Version:      1.2.0
Release:      1%{?dist}
License:      PHP License
Group:        Development/Languages
URL:          http://pecl.php.net/package/%{pecl_name}

Source:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz

Source2:      xml2changelog

BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-devel >= 5.2.0, pcre-devel, php-pear
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires:     php-common >= 5.2.0, php-bz2, php-hash
Provides:     php-pecl(%{pecl_name}) = %{version}-%{release}
Requires:     php(zend-abi) = %{php_zend_api}
Requires:     php(api) = %{php_core_api}

%description
This is the extension version of PEAR's PHP_Archive package. Support for
zlib, bz2 and crc32 is achieved without any dependency other than the 
external zlib or bz2 extension.

.phar files can be read using the phar stream, or with the Phar class. 
If the SPL extension is available, a Phar object can be used as an array
to iterate over a phar's contents or to read files directly from the phar.

Phar archives can be created using the streams API or with the Phar class,
if the phar.readonly ini variable is set to false.

Full support for MD5 and SHA1 signatures is possible. Signatures can be 
required if the ini variable phar.require_hash is set to true. 
When PECL extension hash is available then SHA-256 and SHA-512 signatures
are supported as well.

%prep 
%setup -c -q
%{_bindir}/php -n %{SOURCE2} package.xml >CHANGELOG

%build
cd %{pecl_name}-%{version}
phpize
%configure
%{__make} %{?_smp_mflags}

# Build the phar command (a phar application)
php -n -d extension_dir=modules -d extension=phar.so \
    -d phar.readonly=0 \
    ./phar.php pack -f ../phar.phar -s phar/phar.php phar

%install
cd %{pecl_name}-%{version}
%{__rm} -rf %{buildroot}
%{__make} install INSTALL_ROOT=%{buildroot}

# Drop in the bit of configuration
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
%{__cat} > %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF'
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
; Options for the %{pecl_name} module
;phar.extract_list=
phar.readonly=Off
phar.require_hash=Off
EOF

# Install XML package description
# use %name rather than %pecl_name to avoid conflict with pear extensions
%{__mkdir_p} %{buildroot}%{pecl_xmldir}
%{__install} -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml

# Install the command
%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -m 755 ../phar.phar %{buildroot}%{_bindir}/phar.phar

%check
cd %{pecl_name}-%{version}
TEST_PHP_EXECUTABLE=$(which php) php run-tests.php \
    -n -q \
    -d extension_dir=modules -d extension=phar.so \
    -d phar.readonly=0


%clean
%{__rm} -rf %{buildroot}


%post
%{__pecl} install --nodeps --soft --force --register-only --nobuild \
    %{pecl_xmldir}/%{name}.xml >/dev/null || :


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


%files
%defattr(-, root, root, -)
%doc CHANGELOG %{pecl_name}-%{version}/LICENSE %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/TODO
%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini
%{php_extdir}/%{pecl_name}.so
%{pecl_xmldir}/%{name}.xml
%{_bindir}/phar.phar

%changelog
* Sun Jul 08 2007 Remi Collet <Fedora at FamilleCollet.com> 1.2.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);

	if (is_array($xml->changelog->release)) foreach($xml->changelog->release 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);
}
?>


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/php-pecl-phar/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	15 Jul 2007 04:14:10 -0000	1.1
+++ .cvsignore	15 Jul 2007 14:26:49 -0000	1.2
@@ -0,0 +1 @@
+phar-1.2.0.tgz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/php-pecl-phar/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	15 Jul 2007 04:14:10 -0000	1.1
+++ sources	15 Jul 2007 14:26:49 -0000	1.2
@@ -0,0 +1 @@
+bafae732137b0b8977e289910a36f438  phar-1.2.0.tgz




More information about the scm-commits mailing list