]> git.pld-linux.org Git - projects/template-specs.git/blame - php-pecl.spec
- use explicit PYTEST_PLUGINS lists for reliable tests (not failing if some conflicti...
[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
e80c7459 14Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
dc5e1efb 15# Source0-md5: -
e80c7459 16URL: https://pecl.php.net/package/MODULE_NAME/
aa102165 17BuildRequires: %{php_name}-cli
9ec83f18 18BuildRequires: %{php_name}-devel
3ad11c3e 19BuildRequires: rpmbuild(macros) >= 1.666
930a1dff 20%if %{with tests}
930a1dff
ER
21BuildRequires: %{php_name}-pcre
22%endif
672c5afc 23%{?requires_php_extension}
0ca2f24d 24Requires: %{php_name}-spl
7abd4293 25Provides: php(%{modname}) = %{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 35
aa102165
ER
36cat <<'EOF' > run-tests.sh
37#!/bin/sh
38export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
39exec %{__make} test \
40 PHP_EXECUTABLE=%{__php} \
41 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \
42 RUN_TESTS_SETTINGS="-q $*"
43EOF
44chmod +x run-tests.sh
45
2f89de89
ER
46xfail() {
47 local t=$1
48 test -f $t
49 cat >> $t <<-EOF
50
51 --XFAIL--
52 Skip
53 EOF
54}
55
2f89de89
ER
56while read line; do
57 t=${line##*\[}; t=${t%\]}
58 xfail $t
59done << 'EOF'
60Test for blowfish compatibility [tests/blowfish.phpt]
61Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
62EOF
63
a7223ec4 64%build
a7223ec4
AG
65phpize
66%configure
67%{__make}
68
512c7faf
ER
69# simple module load test
70%{__php} -n -q \
71 -d extension_dir=modules \
82804f07 72 -d extension=%{php_extensiondir}/spl.so \
512c7faf
ER
73 -d extension=%{modname}.so \
74 -m > modules.log
75grep %{modname} modules.log
76
aa102165
ER
77%if %{with tests}
78./run-tests.sh --show-diff
512c7faf
ER
79%endif
80
a7223ec4
AG
81%install
82rm -rf $RPM_BUILD_ROOT
f6dd55ea 83install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
9c71ffdc
ER
84install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
85install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
a7223ec4 86
852624ea 87%{__make} install \
0ec203b9
ER
88 EXTENSION_DIR=%{php_extensiondir} \
89 INSTALL_ROOT=$RPM_BUILD_ROOT
01c11931
ER
90
91install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
fc1df23f
ER
92cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
93; Enable %{modname} extension module
94extension=%{modname}.so
ceb2ba66 95EOF
a7223ec4 96
68c7fa4c 97install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
9c71ffdc
ER
98cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99
a7223ec4
AG
100%clean
101rm -rf $RPM_BUILD_ROOT
102
103%post
6e284c47 104%php_webserver_restart
a7223ec4 105
ceb2ba66
AG
106%postun
107if [ "$1" = 0 ]; then
6e284c47 108 %php_webserver_restart
a7223ec4
AG
109fi
110
111%files
112%defattr(644,root,root,755)
f8cfa67b 113%doc CREDITS EXPERIMENTAL
fc1df23f
ER
114%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
115%attr(755,root,root) %{php_extensiondir}/%{modname}.so
9c71ffdc 116%{_examplesdir}/%{name}-%{version}
This page took 0.429814 seconds and 4 git commands to generate.