]> git.pld-linux.org Git - projects/template-specs.git/blame - php-pecl.spec
py_comp/py_ocomp must be before py_postclean
[projects/template-specs.git] / php-pecl.spec
CommitLineData
fc1df23f
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
9ec83f18 5%define php_name php%{?php_suffix}
abe712a7 6%define modname MODULE_NAME
fc1df23f
ER
7Summary: %{modname} -
8Summary(pl.UTF-8): %{modname} -
9ec83f18 9Name: %{php_name}-pecl-%{modname}
a7223ec4
AG
10Version: 1.0
11Release: 1
4099af7d 12License: PHP 3.01
a7223ec4 13Group: Development/Languages/PHP
fc1df23f 14Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
dc5e1efb 15# Source0-md5: -
abe712a7 16URL: http://pecl.php.net/package/MODULE_NAME/
512c7faf 17%{?with_tests:BuildRequires: %{php_name}-cli}
9ec83f18 18BuildRequires: %{php_name}-devel
3ad11c3e 19BuildRequires: rpmbuild(macros) >= 1.666
930a1dff
ER
20%if %{with tests}
21BuildRequires: %{php_name}-cli
22BuildRequires: %{php_name}-pcre
23%endif
672c5afc 24%{?requires_php_extension}
abe712a7 25Provides: php(MODULE_NAME) = %{version}
a7223ec4
AG
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
a7223ec4
AG
28%description
29
9be49f18 30%description -l pl.UTF-8
a7223ec4 31
a7223ec4 32%prep
05e722ff 33%setup -qc
fc1df23f 34mv %{modname}-%{version}/* .
a7223ec4
AG
35
36%build
a7223ec4
AG
37phpize
38%configure
39%{__make}
40
512c7faf
ER
41%if %{with tests}
42# simple module load test
43%{__php} -n -q \
44 -d extension_dir=modules \
45 -d extension=%{modname}.so \
46 -m > modules.log
47grep %{modname} modules.log
48
49export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
50%{__make} test \
bb69cd23
ER
51 PHP_EXECUTABLE=%{__php} \
52 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl" \
023d6644
ER
53
54# or:
55cat <<'EOF' > run-tests.sh
56#!/bin/sh
57export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
58%{__make} test \
59 PHP_EXECUTABLE=%{__php} \
60 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \
61 RUN_TESTS_SETTINGS="-q $*"
62EOF
63
64chmod +x run-tests.sh
65./run-tests.sh -w failed.log
66test -f failed.log -a ! -s failed.log
512c7faf
ER
67%endif
68
a7223ec4
AG
69%install
70rm -rf $RPM_BUILD_ROOT
f6dd55ea 71install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
9c71ffdc
ER
72install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
73install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
a7223ec4 74
852624ea 75%{__make} install \
0ec203b9
ER
76 EXTENSION_DIR=%{php_extensiondir} \
77 INSTALL_ROOT=$RPM_BUILD_ROOT
01c11931
ER
78
79install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
fc1df23f
ER
80cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
81; Enable %{modname} extension module
82extension=%{modname}.so
ceb2ba66 83EOF
a7223ec4 84
68c7fa4c 85install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
9c71ffdc
ER
86cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
87
a7223ec4
AG
88%clean
89rm -rf $RPM_BUILD_ROOT
90
91%post
6e284c47 92%php_webserver_restart
a7223ec4 93
ceb2ba66
AG
94%postun
95if [ "$1" = 0 ]; then
6e284c47 96 %php_webserver_restart
a7223ec4
AG
97fi
98
99%files
100%defattr(644,root,root,755)
f8cfa67b 101%doc CREDITS EXPERIMENTAL
fc1df23f
ER
102%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
103%attr(755,root,root) %{php_extensiondir}/%{modname}.so
9c71ffdc 104%{_examplesdir}/%{name}-%{version}
This page took 0.122396 seconds and 4 git commands to generate.