]>
Commit | Line | Data |
---|---|---|
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 |
7 | Summary: %{modname} - |
8 | Summary(pl.UTF-8): %{modname} - | |
9ec83f18 | 9 | Name: %{php_name}-pecl-%{modname} |
a7223ec4 AG |
10 | Version: 1.0 |
11 | Release: 1 | |
4099af7d | 12 | License: PHP 3.01 |
a7223ec4 | 13 | Group: Development/Languages/PHP |
e80c7459 | 14 | Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz |
dc5e1efb | 15 | # Source0-md5: - |
e80c7459 | 16 | URL: https://pecl.php.net/package/MODULE_NAME/ |
512c7faf | 17 | %{?with_tests:BuildRequires: %{php_name}-cli} |
9ec83f18 | 18 | BuildRequires: %{php_name}-devel |
3ad11c3e | 19 | BuildRequires: rpmbuild(macros) >= 1.666 |
930a1dff ER |
20 | %if %{with tests} |
21 | BuildRequires: %{php_name}-cli | |
22 | BuildRequires: %{php_name}-pcre | |
23 | %endif | |
672c5afc | 24 | %{?requires_php_extension} |
0ca2f24d | 25 | Requires: %{php_name}-spl |
7abd4293 | 26 | Provides: php(%{modname}) = %{version} |
a7223ec4 AG |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
a7223ec4 AG |
29 | %description |
30 | ||
9be49f18 | 31 | %description -l pl.UTF-8 |
a7223ec4 | 32 | |
a7223ec4 | 33 | %prep |
05e722ff | 34 | %setup -qc |
fc1df23f | 35 | mv %{modname}-%{version}/* . |
a7223ec4 | 36 | |
2f89de89 ER |
37 | xfail() { |
38 | local t=$1 | |
39 | test -f $t | |
40 | cat >> $t <<-EOF | |
41 | ||
42 | --XFAIL-- | |
43 | Skip | |
44 | EOF | |
45 | } | |
46 | ||
47 | # failed tests. investigate later | |
48 | while read line; do | |
49 | t=${line##*\[}; t=${t%\]} | |
50 | xfail $t | |
51 | done << 'EOF' | |
52 | Test for blowfish compatibility [tests/blowfish.phpt] | |
53 | Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt] | |
54 | EOF | |
55 | ||
a7223ec4 | 56 | %build |
a7223ec4 AG |
57 | phpize |
58 | %configure | |
59 | %{__make} | |
60 | ||
512c7faf ER |
61 | %if %{with tests} |
62 | # simple module load test | |
63 | %{__php} -n -q \ | |
64 | -d extension_dir=modules \ | |
82804f07 | 65 | -d extension=%{php_extensiondir}/spl.so \ |
512c7faf ER |
66 | -d extension=%{modname}.so \ |
67 | -m > modules.log | |
68 | grep %{modname} modules.log | |
69 | ||
70 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
71 | %{__make} test \ | |
bb69cd23 ER |
72 | PHP_EXECUTABLE=%{__php} \ |
73 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl" \ | |
023d6644 ER |
74 | |
75 | # or: | |
76 | cat <<'EOF' > run-tests.sh | |
77 | #!/bin/sh | |
78 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
67c04377 | 79 | exec %{__make} test \ |
023d6644 ER |
80 | PHP_EXECUTABLE=%{__php} \ |
81 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="spl pdo session" \ | |
82 | RUN_TESTS_SETTINGS="-q $*" | |
83 | EOF | |
023d6644 | 84 | chmod +x run-tests.sh |
67c04377 ER |
85 | |
86 | ./run-tests.sh | |
512c7faf ER |
87 | %endif |
88 | ||
a7223ec4 AG |
89 | %install |
90 | rm -rf $RPM_BUILD_ROOT | |
f6dd55ea | 91 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d |
9c71ffdc ER |
92 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} |
93 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}} | |
a7223ec4 | 94 | |
852624ea | 95 | %{__make} install \ |
0ec203b9 ER |
96 | EXTENSION_DIR=%{php_extensiondir} \ |
97 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
01c11931 ER |
98 | |
99 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
fc1df23f ER |
100 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
101 | ; Enable %{modname} extension module | |
102 | extension=%{modname}.so | |
ceb2ba66 | 103 | EOF |
a7223ec4 | 104 | |
68c7fa4c | 105 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
9c71ffdc ER |
106 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
107 | ||
a7223ec4 AG |
108 | %clean |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %post | |
6e284c47 | 112 | %php_webserver_restart |
a7223ec4 | 113 | |
ceb2ba66 AG |
114 | %postun |
115 | if [ "$1" = 0 ]; then | |
6e284c47 | 116 | %php_webserver_restart |
a7223ec4 AG |
117 | fi |
118 | ||
119 | %files | |
120 | %defattr(644,root,root,755) | |
f8cfa67b | 121 | %doc CREDITS EXPERIMENTAL |
fc1df23f ER |
122 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini |
123 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so | |
9c71ffdc | 124 | %{_examplesdir}/%{name}-%{version} |