]> git.pld-linux.org Git - packages/php-ext-pimple.git/blame - php-ext-pimple.spec
depend pcre when testing
[packages/php-ext-pimple.git] / php-ext-pimple.spec
CommitLineData
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
7Summary: A simple dependency injection container for PHP
bd027da5 8Name: %{php_name}-ext-%{modname}
fb41d5cf
ER
9Version: 3.0.0
10Release: 1
11License: MIT
12Group: Development/Languages/PHP
13Source0: https://github.com/silexphp/Pimple/archive/v%{version}/%{modname}-%{version}.tar.gz
14# Source0-md5: 09c5470d679cf31187289aa89d039926
15URL: http://pimple.sensiolabs.org/
16BuildRequires: %{php_name}-devel
17BuildRequires: rpmbuild(macros) >= 1.666
18%if %{with tests}
19BuildRequires: %{php_name}-cli
20BuildRequires: %{php_name}-pcre
21BuildRequires: %{php_name}-spl
22%endif
23%{?requires_php_extension}
24Provides: php(pimple) = %{version}
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%define namespace Pimple
28
29%description
30Pimple is a small dependency injection container for PHP that consists
31of just one file and one class.
32
33%prep
34%setup -qc
35mv Pimple-%{version}/ext/pimple/* .
36
37# failing test
38%{__rm} tests/015.phpt
39
40%build
41phpize
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
52grep %{modname} modules.log
53
54export 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
61rm -rf $RPM_BUILD_ROOT
62%{__make} install \
63 EXTENSION_DIR=%{php_extensiondir} \
64 INSTALL_ROOT=$RPM_BUILD_ROOT
65
66install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
67cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
68; Enable %{modname} extension module
69extension=%{modname}.so
70EOF
71
72%post
73%php_webserver_restart
74
75%postun
76if [ "$1" = 0 ]; then
77 %php_webserver_restart
78fi
79
80%clean
81rm -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
This page took 0.142133 seconds and 4 git commands to generate.