%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) %{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} %{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}} %define pecl_name LZF Name: php-pecl-lzf Version: 1.5.2 Release: 3%{?dist} Summary: Extension to handle LZF de/compression Group: Development/Languages License: PHP URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: php-devel php-pear >= 1:1.4.0 Requires(post): %{__pecl} Requires(postun): %{__pecl} Provides: php-pecl(lzf) = %{version} %if %{?php_zend_api}0 Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} %else Requires: php-api = %{php_apiver} %endif %description This extension provides LZF compression and decompression using the liblzf library LZF is a very fast compression algorithm, ideal for saving space with a slight speed cost. %prep %setup -c -q [ -f package2.xml ] || %{__mv} package.xml package2.xml %{__mv} package2.xml %{pecl_name}-%{version}/%{pecl_name}.xml %build cd %{pecl_name}-%{version} phpize %configure %{__make} %{?_smp_mflags} %install cd %{pecl_name}-%{version} %{__rm} -rf %{buildroot} %{__make} install INSTALL_ROOT=%{buildroot} INSTALL="install -p" %{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d %{__cat} > %{buildroot}%{_sysconfdir}/php.d/lzf.ini << 'EOF' ; Enable %{pecl_name} extension module extension=lzf.so EOF %{__mkdir_p} %{buildroot}%{pecl_xmldir} %{__install} -p -m 644 %{pecl_name}.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %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 %{pecl_name}-%{version}/CREDITS %config(noreplace) %{_sysconfdir}/php.d/lzf.ini %{php_extdir}/lzf.so %{pecl_xmldir}/%{name}.xml %changelog * Mon Jun 22 2009 Andrew Colin Kissa - 1.5.2-3 - Consistent use of macros * Mon Jun 22 2009 Andrew Colin Kissa - 1.5.2-2 - Fixes to the install to retain timestamps and other fixes raised in review * Sun Jun 14 2009 Andrew Colin Kissa - 1.5.2-1 - Initial RPM package