]> git.pld-linux.org Git - packages/php-pecl-ereg.git/blame - php-pecl-ereg.spec
add test runner script
[packages/php-pecl-ereg.git] / php-pecl-ereg.spec
CommitLineData
cc893fe8
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname ereg
7Summary: %{modname} -
8Summary(pl.UTF-8): %{modname} -
9Name: %{php_name}-pecl-%{modname}
1240f5c1 10# version taken from package.xml, .c source has NO_VERSION_YET macro
cc893fe8
ER
11Version: 1.0.0
12Release: 1
13License: PHP 3.01
14Group: Development/Languages/PHP
15Source0: http://git.php.net/?p=pecl/text/ereg.git;a=snapshot;h=ee45d78c6bec127c60c687b4dd6dd62d369d172a;sf=tgz;/php-pecl-%{modname}-%{version}.tar.gz
16# Source0-md5: 21835a1e81d90de53a58efb9f8c96294
17URL: http://pecl.php.net/package/ereg/
18%{?with_tests:BuildRequires: %{php_name}-cli}
19BuildRequires: %{php_name}-devel >= 4:7.0.0
20BuildRequires: rpmbuild(macros) >= 1.666
21%if %{with tests}
22BuildRequires: %{php_name}-cli
23BuildRequires: %{php_name}-pcre
24%endif
25%{?requires_php_extension}
26Provides: php(ereg) = %{version}
27BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29%description
30This extension provides the ereg family of functions that were
31provided with PHP 3-5. These functions have been superseded by the
32preg family of functions provided by the PCRE extension:
33<http://php.net/pcre>.
34
35You are strongly encouraged to port your code to use PCRE, as this
36extension is not maintained and is available for historical reasons
37only.
38
39%prep
40%setup -qc
41mv %{modname}-*/* .
42
34177306
ER
43cat <<'EOF' > run-tests.sh
44#!/bin/sh
45export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
46%{__make} test \
47 PHP_EXECUTABLE=%{__php} \
48 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="" \
49 RUN_TESTS_SETTINGS="-q $*"
50EOF
51chmod +x run-tests.sh
52
cc893fe8
ER
53%build
54phpize
55%configure \
56 --with-regex=system
57%{__make}
58
59%if %{with tests}
60# simple module load test
61%{__php} -n -q \
62 -d extension_dir=modules \
63 -d extension=%{modname}.so \
64 -m > modules.log
65grep %{modname} modules.log
66
34177306
ER
67./run-tests.sh -w failed.log
68test -f failed.log -a ! -s failed.log
cc893fe8
ER
69%endif
70
71%install
72rm -rf $RPM_BUILD_ROOT
73%{__make} install \
74 EXTENSION_DIR=%{php_extensiondir} \
75 INSTALL_ROOT=$RPM_BUILD_ROOT
76
77# drop, no -devel package
78%{__rm} -r $RPM_BUILD_ROOT%{php_includedir}/ext/ereg
79
80install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
81cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
82; Enable %{modname} extension module
83extension=%{modname}.so
84EOF
85
86%clean
87rm -rf $RPM_BUILD_ROOT
88
89%post
90%php_webserver_restart
91
92%postun
93if [ "$1" = 0 ]; then
94 %php_webserver_restart
95fi
96
97%files
98%defattr(644,root,root,755)
99%doc README.md CREDITS
100%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
101%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.07607 seconds and 4 git commands to generate.