%define modname phar %define soname %{modname}.so %define inifile A63_%{modname}.ini Summary: Allows running of complete applications out of .phar files Name: php-%{modname} Version: 1.2.1 Release: %mkrel 1 Group: Development/PHP License: PHP License URL: http://pecl.php.net/package/syck Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz Requires: php-bz2 Requires: php-hash BuildRequires: php-devel >= 3:5.2.0 BuildRequires: file BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot %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 avaiable then SHA-256 and SHA-512 signatures are supported as well. %prep %setup -q -n %{modname}-%{version} [ "../package*.xml" != "/" ] && mv ../package*.xml . # fix permissions find . -type f | xargs chmod 644 # strip away annoying ^M find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//' find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//' # lib64 fix perl -pi -e "s|/lib\b|/%{_lib}|g" config.m4 %build %serverbuild phpize %configure2_5x --with-libdir=%{_lib} \ --with-%{modname}=shared,%{_prefix} %make %install rm -rf %{buildroot} install -d %{buildroot}%{_sysconfdir}/php.d install -d %{buildroot}%{_libdir}/php/extensions install -m0755 modules/%{soname} %{buildroot}%{_libdir}/php/extensions/ cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF extension = %{soname} [phar] ;phar.extract_list= phar.readonly=Off phar.require_hash=Off EOF %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc CREDITS LICENSE TODO package*.xml %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile} %attr(0755,root,root) %{_libdir}/php/extensions/%{soname} %changelog * Tue Sep 04 2007 Oden Eriksson <oeriksson@mandriva.com> 1.2.1-1mdv2008.0 + Revision: 79349 - Import php-phar * Tue Sep 04 2007 Oden Eriksson <oeriksson@mandriva.com> 1.2.1-1mdv2008.0 - initial Mandriva package