]>
Commit | Line | Data |
---|---|---|
fb41d5cf ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
5 | %define php_name php%{?php_suffix} | |
6 | %define modname pimple | |
7 | Summary: A simple dependency injection container for PHP | |
bd027da5 | 8 | Name: %{php_name}-ext-%{modname} |
fb41d5cf ER |
9 | Version: 3.0.0 |
10 | Release: 1 | |
11 | License: MIT | |
12 | Group: Development/Languages/PHP | |
13 | Source0: https://github.com/silexphp/Pimple/archive/v%{version}/%{modname}-%{version}.tar.gz | |
14 | # Source0-md5: 09c5470d679cf31187289aa89d039926 | |
15 | URL: http://pimple.sensiolabs.org/ | |
16 | BuildRequires: %{php_name}-devel | |
17 | BuildRequires: rpmbuild(macros) >= 1.666 | |
18 | %if %{with tests} | |
19 | BuildRequires: %{php_name}-cli | |
20 | BuildRequires: %{php_name}-pcre | |
21 | BuildRequires: %{php_name}-spl | |
22 | %endif | |
23 | %{?requires_php_extension} | |
24 | Provides: php(pimple) = %{version} | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %define namespace Pimple | |
28 | ||
29 | %description | |
30 | Pimple is a small dependency injection container for PHP that consists | |
31 | of just one file and one class. | |
32 | ||
33 | %prep | |
34 | %setup -qc | |
35 | mv Pimple-%{version}/ext/pimple/* . | |
36 | ||
37 | # failing test | |
38 | %{__rm} tests/015.phpt | |
39 | ||
40 | %build | |
41 | phpize | |
42 | %configure | |
43 | %{__make} | |
44 | ||
45 | %if %{with tests} | |
46 | # simple module load test | |
47 | %{__php} -n -q \ | |
48 | -d extension_dir=modules \ | |
49 | -d extension=%{php_extensiondir}/spl.so \ | |
50 | -d extension=%{modname}.so \ | |
51 | -m > modules.log | |
52 | grep %{modname} modules.log | |
53 | ||
54 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
55 | %{__make} test \ | |
56 | PHP_EXECUTABLE=%{__php} \ | |
e6d4c6c9 | 57 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl" |
fb41d5cf ER |
58 | %endif |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %{__make} install \ | |
63 | EXTENSION_DIR=%{php_extensiondir} \ | |
64 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
65 | ||
66 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
67 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
68 | ; Enable %{modname} extension module | |
69 | extension=%{modname}.so | |
70 | EOF | |
71 | ||
72 | %post | |
73 | %php_webserver_restart | |
74 | ||
75 | %postun | |
76 | if [ "$1" = 0 ]; then | |
77 | %php_webserver_restart | |
78 | fi | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
85 | %doc README.md | |
86 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
87 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |