]>
Commit | Line | Data |
---|---|---|
fc1df23f ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
9ec83f18 | 5 | %define php_name php%{?php_suffix} |
fc1df23f ER |
6 | %define modname - |
7 | Summary: %{modname} - | |
8 | Summary(pl.UTF-8): %{modname} - | |
9ec83f18 | 9 | Name: %{php_name}-pecl-%{modname} |
a7223ec4 AG |
10 | Version: 1.0 |
11 | Release: 1 | |
4099af7d | 12 | License: PHP 3.01 |
a7223ec4 | 13 | Group: Development/Languages/PHP |
fc1df23f | 14 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz |
dc5e1efb | 15 | # Source0-md5: - |
9ec83f18 | 16 | URL: http://pecl.php.net/package/modname/ |
512c7faf | 17 | %{?with_tests:BuildRequires: %{php_name}-cli} |
9ec83f18 | 18 | BuildRequires: %{php_name}-devel |
3ad11c3e | 19 | BuildRequires: rpmbuild(macros) >= 1.666 |
672c5afc | 20 | %{?requires_php_extension} |
a7223ec4 AG |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
22 | ||
a7223ec4 AG |
23 | %description |
24 | ||
9be49f18 | 25 | %description -l pl.UTF-8 |
a7223ec4 | 26 | |
a7223ec4 | 27 | %prep |
05e722ff | 28 | %setup -qc |
fc1df23f | 29 | mv %{modname}-%{version}/* . |
a7223ec4 AG |
30 | |
31 | %build | |
a7223ec4 AG |
32 | phpize |
33 | %configure | |
34 | %{__make} | |
35 | ||
512c7faf ER |
36 | %if %{with tests} |
37 | # simple module load test | |
38 | %{__php} -n -q \ | |
39 | -d extension_dir=modules \ | |
40 | -d extension=%{modname}.so \ | |
41 | -m > modules.log | |
42 | grep %{modname} modules.log | |
43 | ||
44 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
45 | %{__make} test \ | |
46 | PHP_EXECUTABLE=%{__php} | |
47 | %endif | |
48 | ||
a7223ec4 AG |
49 | %install |
50 | rm -rf $RPM_BUILD_ROOT | |
f6dd55ea | 51 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d |
9c71ffdc ER |
52 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} |
53 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}} | |
a7223ec4 | 54 | |
852624ea | 55 | %{__make} install \ |
0ec203b9 ER |
56 | EXTENSION_DIR=%{php_extensiondir} \ |
57 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
01c11931 ER |
58 | |
59 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
fc1df23f ER |
60 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
61 | ; Enable %{modname} extension module | |
62 | extension=%{modname}.so | |
ceb2ba66 | 63 | EOF |
a7223ec4 | 64 | |
68c7fa4c | 65 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
9c71ffdc ER |
66 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
67 | ||
a7223ec4 AG |
68 | %clean |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %post | |
6e284c47 | 72 | %php_webserver_restart |
a7223ec4 | 73 | |
ceb2ba66 AG |
74 | %postun |
75 | if [ "$1" = 0 ]; then | |
6e284c47 | 76 | %php_webserver_restart |
a7223ec4 AG |
77 | fi |
78 | ||
79 | %files | |
80 | %defattr(644,root,root,755) | |
f8cfa67b | 81 | %doc CREDITS EXPERIMENTAL |
fc1df23f ER |
82 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini |
83 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so | |
9c71ffdc | 84 | %{_examplesdir}/%{name}-%{version} |