%define modname zookeeper %define dirname %{modname} %define soname %{modname}.so %define inifile B09_%{modname}.ini Summary: PHP extension for interfacing with Apache ZooKeeper Name: php-%{modname} Version: 0.1.0 Release: %mkrel 8 Group: Development/PHP License: PHP License URL: http://pecl.php.net/package/zookeeper/ Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz BuildRequires: php-devel >= 3:5.2.0 BuildRequires: zookeeper-devel >= 3 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description This extension provides API for communicating with ZooKeeper service. %prep %setup -q -n %{modname}-%{version} [ "../package*.xml" != "/" ] && mv ../package*.xml . # lib64 fix perl -pi -e "s|/lib\b|/%{_lib}|g" config.m4 %build %serverbuild phpize %configure2_5x --with-libdir=%{_lib} \ --with-%{modname}=shared,%{_prefix} %make mv modules/*.so . %install rm -rf %{buildroot} install -d %{buildroot}%{_libdir}/php/extensions install -d %{buildroot}%{_sysconfdir}/php.d install -m755 %{soname} %{buildroot}%{_libdir}/php/extensions/ cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF extension = %{soname} EOF %post if [ -f /var/lock/subsys/httpd ]; then %{_initrddir}/httpd restart >/dev/null || : fi %postun if [ "$1" = "0" ]; then if [ -f /var/lock/subsys/httpd ]; then %{_initrddir}/httpd restart >/dev/null || : fi fi %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc CREDITS ChangeLog LICENSE README.markdown zookeeper-api.php package*.xml %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/php.d/%{inifile} %attr(0755,root,root) %{_libdir}/php/extensions/%{soname}