%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} %{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}} %global pecl_name xattr Name: php-pecl-xattr Version: 1.2.0 Release: 1%{?dist} Summary: PHP extended file attributes manipulation Group: Development/Languages License: BSD URL: http://pecl.php.net/package/xattr Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: php-devel Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} BuildRequires: php-pear Requires(post): %{__pecl} Requires(postun): %{__pecl} Provides: php-pecl(%{pecl_name}) = %{version} BuildRequires: libattr-devel # RPM 4.8 %{?filter_provides_in: %filter_provides_in %{php_extdir}/.*\.so$} %{?filter_setup} # RPM 4.9 %global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_extdir}/.*\\.so$ %description This package allows to manipulate extended attributes on filesystems that support them. Requires libattr from Linux XFS project. %prep %setup -q -c %build cd %{pecl_name}-%{version} phpize %configure make %{?_smp_mflags} %install cd %{pecl_name}-%{version} rm -rf %{buildroot} make install INSTALL_ROOT=%{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/php.d cat > %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF' ; Enable %{pecl_name} extension module extension=%{pecl_name}.so EOF mkdir -p %{buildroot}%{pecl_xmldir} install -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %clean rm -rf %{buildroot} %post %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : %postun if [ $1 -eq 0 ]; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi %check cd %{pecl_name}-%{version} php -n \ -d extension_dir=modules \ -d extension=%{pecl_name}.so \ --modules | grep xattr %files %defattr(-,root,root,-) %doc %{pecl_name}-%{version}/CREDITS %config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini %{php_extdir}/%{pecl_name}.so %{pecl_xmldir}/%{name}.xml %changelog * Sat Dec 29 2012 F. Kooman - 1.2.0-1 - update to 1.2.0, PHP 5.3+ compatibility * Tue May 01 2012 F. Kooman - 1.1.0-1 - intial package