3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
7 Summary: A simple dependency injection container for PHP
8 Name: %{php_name}-ext-%{modname}
12 Group: Development/Languages/PHP
13 Source0: https://github.com/silexphp/Pimple/archive/v%{version}/%{modname}-%{version}.tar.gz
14 # Source0-md5: a9b3be3c864b98eeb1f8b9acbac6c118
15 URL: http://pimple.sensiolabs.org/
16 BuildRequires: %{php_name}-devel
17 BuildRequires: rpmbuild(macros) >= 1.666
19 BuildRequires: %{php_name}-cli
20 BuildRequires: %{php_name}-pcre
21 BuildRequires: %{php_name}-spl
23 %{?requires_php_extension}
24 Provides: php(pimple) = %{version}
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define namespace Pimple
30 Pimple is a small dependency injection container for PHP that consists
31 of just one file and one class.
35 mv Pimple-%{version}/ext/pimple/* .
43 # simple module load test
45 -d extension_dir=modules \
46 -d extension=%{php_extensiondir}/pcre.so \
47 -d extension=%{php_extensiondir}/spl.so \
48 -d extension=%{modname}.so \
50 grep %{modname} modules.log
52 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
54 PHP_EXECUTABLE=%{__php} \
55 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl"
59 rm -rf $RPM_BUILD_ROOT
61 EXTENSION_DIR=%{php_extensiondir} \
62 INSTALL_ROOT=$RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
65 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
66 ; Enable %{modname} extension module
67 extension=%{modname}.so
71 %php_webserver_restart
75 %php_webserver_restart
79 rm -rf $RPM_BUILD_ROOT
82 %defattr(644,root,root,755)
84 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
85 %attr(755,root,root) %{php_extensiondir}/%{modname}.so