]>
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 | ||
1fb09c77 ER |
53 | # these tests fail, likely everywhere, not just pld |
54 | %{__rm} tests/ereg_basic_001.phpt | |
55 | %{__rm} tests/ereg_basic_002.phpt | |
56 | %{__rm} tests/ereg_error_002.phpt | |
57 | %{__rm} tests/ereg_replace_basic_001.phpt | |
58 | %{__rm} tests/ereg_replace_error_002.phpt | |
59 | %{__rm} tests/ereg_replace_variation_001.phpt | |
60 | %{__rm} tests/ereg_variation_001.phpt | |
61 | %{__rm} tests/ereg_variation_004.phpt | |
62 | %{__rm} tests/eregi_basic_001.phpt | |
63 | %{__rm} tests/eregi_basic_002.phpt | |
64 | %{__rm} tests/eregi_error_002.phpt | |
65 | %{__rm} tests/eregi_replace_basic_001.phpt | |
66 | %{__rm} tests/eregi_replace_error_002.phpt | |
67 | %{__rm} tests/eregi_replace_variation_001.phpt | |
68 | %{__rm} tests/eregi_variation_001.phpt | |
69 | %{__rm} tests/eregi_variation_004.phpt | |
70 | %{__rm} tests/split_basic_001.phpt | |
71 | %{__rm} tests/split_basic_002.phpt | |
72 | %{__rm} tests/split_error_002.phpt | |
73 | %{__rm} tests/split_variation_001.phpt | |
74 | %{__rm} tests/spliti_basic_001.phpt | |
75 | %{__rm} tests/spliti_basic_002.phpt | |
76 | %{__rm} tests/spliti_error_002.phpt | |
77 | %{__rm} tests/spliti_variation_001.phpt | |
cc893fe8 ER |
78 | %build |
79 | phpize | |
80 | %configure \ | |
81 | --with-regex=system | |
82 | %{__make} | |
83 | ||
84 | %if %{with tests} | |
85 | # simple module load test | |
86 | %{__php} -n -q \ | |
87 | -d extension_dir=modules \ | |
88 | -d extension=%{modname}.so \ | |
89 | -m > modules.log | |
90 | grep %{modname} modules.log | |
91 | ||
34177306 ER |
92 | ./run-tests.sh -w failed.log |
93 | test -f failed.log -a ! -s failed.log | |
cc893fe8 ER |
94 | %endif |
95 | ||
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | %{__make} install \ | |
99 | EXTENSION_DIR=%{php_extensiondir} \ | |
100 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
101 | ||
102 | # drop, no -devel package | |
103 | %{__rm} -r $RPM_BUILD_ROOT%{php_includedir}/ext/ereg | |
104 | ||
105 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
106 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
107 | ; Enable %{modname} extension module | |
108 | extension=%{modname}.so | |
109 | EOF | |
110 | ||
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %post | |
115 | %php_webserver_restart | |
116 | ||
117 | %postun | |
118 | if [ "$1" = 0 ]; then | |
119 | %php_webserver_restart | |
120 | fi | |
121 | ||
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc README.md CREDITS | |
125 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
126 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |