3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname gearman
7 Summary: PHP wrapper to libgearman
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Tools
13 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: fb3bc8df2d017048726d5654459e8433
15 URL: http://gearman.org/
16 BuildRequires: %{php_name}-devel
17 BuildRequires: autoconf
18 BuildRequires: automake
19 BuildRequires: libgearman-devel >= 1.1.0
20 BuildRequires: libtool
21 BuildRequires: rpmbuild(macros) >= 1.666
22 Provides: php(gearman) = %{version}
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 This extension uses libgearman library to provide API for
27 communicating with gearmand, and writing clients and workers
31 mv %{modname}-%{version}/* .
33 # Upstream often forgets to change this
34 extver=$(sed -n '/#define PHP_GEARMAN_VERSION/{s/.* "//;s/".*$//;p}' php_gearman.h)
35 if test "x${extver}" != "x%{version}"; then
36 : Error: Upstream version is ${extver}, expecting %{version}.
46 # simple module load test
48 -d extension_dir=modules \
49 -d extension=%{modname}.so \
51 grep %{modname} modules.log
53 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
55 PHP_EXECUTABLE=%{__php}
59 rm -rf $RPM_BUILD_ROOT
61 EXTENSION_DIR=%{php_extensiondir} \
62 INSTALL_ROOT=$RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
65 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
67 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
68 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
69 ; Enable %{modname} extension module
70 extension=%{modname}.so
74 rm -rf $RPM_BUILD_ROOT
77 %defattr(644,root,root,755)
78 %doc README CREDITS LICENSE ChangeLog
79 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
80 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
81 %{_examplesdir}/%{name}-%{version}