]> git.pld-linux.org Git - packages/php-pecl-gearman.git/blame - php-pecl-gearman.spec
add restart hooks
[packages/php-pecl-gearman.git] / php-pecl-gearman.spec
CommitLineData
863d2177
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname gearman
7Summary: PHP wrapper to libgearman
8Name: %{php_name}-pecl-%{modname}
9Version: 1.1.2
10Release: 1
11License: PHP
12Group: Development/Tools
13Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14# Source0-md5: fb3bc8df2d017048726d5654459e8433
15URL: http://gearman.org/
16BuildRequires: %{php_name}-devel
17BuildRequires: autoconf
18BuildRequires: automake
19BuildRequires: libgearman-devel >= 1.1.0
20BuildRequires: libtool
21BuildRequires: rpmbuild(macros) >= 1.666
22Provides: php(gearman) = %{version}
23BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25%description
26This extension uses libgearman library to provide API for
27communicating with gearmand, and writing clients and workers
28
29%prep
30%setup -qc
31mv %{modname}-%{version}/* .
32
33# Upstream often forgets to change this
34extver=$(sed -n '/#define PHP_GEARMAN_VERSION/{s/.* "//;s/".*$//;p}' php_gearman.h)
35if test "x${extver}" != "x%{version}"; then
36 : Error: Upstream version is ${extver}, expecting %{version}.
37 exit 1
38fi
39
40%build
41phpize
42%configure
43%{__make}
44
45%if %{with tests}
46# simple module load test
47%{__php} -n -q \
48 -d extension_dir=modules \
49 -d extension=%{modname}.so \
50 -m > modules.log
51grep %{modname} modules.log
52
53export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
54%{__make} test \
55 PHP_EXECUTABLE=%{__php}
56%endif
57
58%install
59rm -rf $RPM_BUILD_ROOT
60%{__make} install \
61 EXTENSION_DIR=%{php_extensiondir} \
62 INSTALL_ROOT=$RPM_BUILD_ROOT
63
64install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
65cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
66
67install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
68cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
69; Enable %{modname} extension module
70extension=%{modname}.so
71EOF
72
73%clean
74rm -rf $RPM_BUILD_ROOT
75
b13f4020
ER
76%post
77%php_webserver_restart
78
79%postun
80if [ "$1" = 0 ]; then
81 %php_webserver_restart
82fi
83
863d2177
ER
84%files
85%defattr(644,root,root,755)
86%doc README CREDITS LICENSE ChangeLog
87%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
88%attr(755,root,root) %{php_extensiondir}/%{modname}.so
89%{_examplesdir}/%{name}-%{version}
This page took 0.080438 seconds and 4 git commands to generate.