%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)}} %global pecl_name xdiff %global sources %{pecl_name}-%{version} %global ini_name 40-%{pecl_name}.ini Name: php-pecl-xdiff Version: 2.1.1 Release: %{autorelease} Summary: File differences/patches. License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: php-devel BuildRequires: php-pear BuildRequires: libxdiff0-devel Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} Provides: php-xdiff = %{version} Provides: php-xdiff%{_isa} = %{version} Provides: php-pecl(xdiff) = %{version} Provides: php-pecl(xdiff)%{?_isa} = %{version} %description This extension creates and applies patches to both text and binary files. %prep %autosetup -c cat >%{ini_name} << 'EOF' ; Enable xdiff extension module extension=%{pecl_name}.so EOF %build cd %{sources} %{__phpize} sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global %configure \ --with-libdir=%{_lib} \ --with-php-config=%{__phpconfig} %make_build %install install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} cd %{sources} %make_install %check cd %{sources} %{__make} NO_INTERACTION=1 test %files %license %{sources}/LICENSE %doc %{sources}/README.API %{pecl_xmldir}/%{name}.xml %{php_extdir}/%{pecl_name}.so %config(noreplace) %{php_inidir}/%{ini_name} %changelog %{autochangelog}