%define php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) %{!?php_extdir: %{expand: %%define php_extdir %(php-config --extension-dir)}} Summary: PHP extension for interfacing with MessagePack Name: php-msgpack Version: 0.3.0 Release: 1%{?dist} Source: php-msgpack-%{version}.tar.gz License: New BSD License Group: Development/Libraries Packager: advect Provides: php-pecl-msgpack BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: php-devel Requires: msgpack %if 0%{?php_zend_api} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} %else Requires: php-api = %{php_apiver} %endif %description PHP extension for interfacing with MessagePack. %prep %setup -q -n php-msgpack %build phpize %configure %{__make} %install %makeinstall INSTALL_ROOT=%{buildroot} %{__install} -d %{buildroot}%{_sysconfdir}/php.d %{__cat} > %{buildroot}%{_sysconfdir}/php.d/msgpack.ini <