%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} %{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}} %global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) %define oname xdiff Summary: Extension to create and apply patches to text and binary files Name: php-pecl-xdiff Version: 1.4 Release: 1%{?dist} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{oname} Source: http://pecl.php.net/get/%{oname}-%{version}.tgz # Patch from wikidot: # http://www.wikidot.org/local--files/download/xdiff-1.4-wikidot.tgz Patch: xdiff-1.4.wikidot.patch BuildRequires: php-devel php-pear libxdiff-devel Requires(post): %{__pecl} Requires(postun): %{__pecl} Provides: php-pecl(%{oname}) = %{version}-%{release} Requires: php-api = %{php_apiver} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description Extension to create and apply patches to text and binary files %prep %setup -q -c %patch -p0 %build pushd %{oname}-%{version} phpize %configure %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} pushd %{oname}-%{version} %{__make} install INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration %{__install} -d %{buildroot}%{_sysconfdir}/php.d %{__cat} > %{buildroot}%{_sysconfdir}/php.d/%{oname}.ini << EOF ; Enable xdiff extension module extension = xdiff.so EOF %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, -) %doc %{oname}-%{version}/{CREDITS,README.API} %{php_extdir}/%{oname}.so %config(noreplace) %{_sysconfdir}/php.d/%{oname}.ini %changelog * Sun Jun 8 2008 Terje Rosten - 1.4-1 - initial package