rpms/php-pecl-phar/F-7 phar-make.patch, NONE, 1.1 php-pecl-phar.spec, NONE, 1.1 xml2changelog, NONE, 1.1 sources, 1.1, 1.2

Remi Collet (remi) fedora-extras-commits at redhat.com
Fri Aug 31 13:05:23 UTC 2007


Author: remi

Update of /cvs/extras/rpms/php-pecl-phar/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24078

Modified Files:
	sources 
Added Files:
	phar-make.patch php-pecl-phar.spec xml2changelog 
Log Message:
   new package for F-7

phar-make.patch:

--- NEW FILE phar-make.patch ---
--- Makefile.frag.makepatch	2007-08-30 05:34:34.000000000 +0200
+++ Makefile.frag	2007-08-31 14:45:52.000000000 +0200
@@ -2,12 +2,14 @@
 $(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re
 	$(RE2C) -b -o $(srcdir)/phar_path_check.c $(srcdir)/phar_path_check.re)
 
-pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
+pharcmd: $(all_targets) $(builddir)/phar.php $(builddir)/phar.phar
 
 $(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php
-	php $(srcdir)/build_precommand.php > $(builddir)/phar.php
+	php -n -q -d extension_dir=$(builddir)/modules -d extension=phar.so\
+		$(srcdir)/build_precommand.php > $(builddir)/phar.php
 
 $(builddir)/phar.phar: $(builddir)/phar.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php
-	php -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 $(srcdir)/phar/
+	php -n -q -d extension_dir=$(builddir)/modules -d extension=phar.so -d phar.readonly=0 \
+		$(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -s $(srcdir)/phar/phar.php -h sha1 $(srcdir)/phar/
 	@chmod +x $(builddir)/phar.phar
 


--- NEW FILE php-pecl-phar.spec ---
%{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}

%define pecl_name phar

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

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

Source2:      xml2changelog

Patch0:       phar-make.patch

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
cd %{pecl_name}-%{version}
%patch0 -p0 -b .makepatch

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

# Build the phar command (a phar application)
%{__make} pharcmd


%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}


%if 0%{?pecl_install:1}
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
%endif


%if 0%{?pecl_uninstall:1}
%postun
if [ $1 -eq 0 ] ; then
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%endif


%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
* Thu Aug 30 2007 Remi Collet <Fedora at FamilleCollet.com> 1.2.1-1
- update to 1.2.1
- use "make pharcmd" 
- add phar-make.patch (use phar.so from build tree)

* Tue Aug 21 2007 Remi Collet <Fedora at FamilleCollet.com> 1.2.0-2
- use new macros in scriplet
- fix license

* 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: sources
===================================================================
RCS file: /cvs/extras/rpms/php-pecl-phar/F-7/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	31 Aug 2007 13:04:49 -0000	1.2
@@ -0,0 +1 @@
+d057af8c7f12332370ac6af045bcd459  phar-1.2.1.tgz




More information about the fedora-extras-commits mailing list