]>
Commit | Line | Data |
---|---|---|
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 | |
7 | Summary: %{modname} - | |
8 | Summary(pl.UTF-8): %{modname} - | |
9 | Name: %{php_name}-pecl-%{modname} | |
1240f5c1 | 10 | # version taken from package.xml, .c source has NO_VERSION_YET macro |
cc893fe8 ER |
11 | Version: 1.0.0 |
12 | Release: 1 | |
13 | License: PHP 3.01 | |
14 | Group: Development/Languages/PHP | |
15 | Source0: 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 | |
17 | URL: http://pecl.php.net/package/ereg/ | |
18 | %{?with_tests:BuildRequires: %{php_name}-cli} | |
19 | BuildRequires: %{php_name}-devel >= 4:7.0.0 | |
20 | BuildRequires: rpmbuild(macros) >= 1.666 | |
21 | %if %{with tests} | |
22 | BuildRequires: %{php_name}-cli | |
23 | BuildRequires: %{php_name}-pcre | |
24 | %endif | |
25 | %{?requires_php_extension} | |
26 | Provides: php(ereg) = %{version} | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | This extension provides the ereg family of functions that were | |
31 | provided with PHP 3-5. These functions have been superseded by the | |
32 | preg family of functions provided by the PCRE extension: | |
33 | <http://php.net/pcre>. | |
34 | ||
35 | You are strongly encouraged to port your code to use PCRE, as this | |
36 | extension is not maintained and is available for historical reasons | |
37 | only. | |
38 | ||
39 | %prep | |
40 | %setup -qc | |
41 | mv %{modname}-*/* . | |
42 | ||
34177306 ER |
43 | cat <<'EOF' > run-tests.sh |
44 | #!/bin/sh | |
45 | export 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 $*" | |
50 | EOF | |
51 | chmod +x run-tests.sh | |
52 | ||
cc893fe8 ER |
53 | %build |
54 | phpize | |
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 | |
65 | grep %{modname} modules.log | |
66 | ||
34177306 ER |
67 | ./run-tests.sh -w failed.log |
68 | test -f failed.log -a ! -s failed.log | |
cc893fe8 ER |
69 | %endif |
70 | ||
71 | %install | |
72 | rm -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 | ||
80 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
81 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
82 | ; Enable %{modname} extension module | |
83 | extension=%{modname}.so | |
84 | EOF | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %post | |
90 | %php_webserver_restart | |
91 | ||
92 | %postun | |
93 | if [ "$1" = 0 ]; then | |
94 | %php_webserver_restart | |
95 | fi | |
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 |