]> git.pld-linux.org Git - packages/php-redis.git/blame - php-redis.spec
always run module load test
[packages/php-redis.git] / php-redis.spec
CommitLineData
2b82b6de
ER
1# TODO
2# - use external igbinary and make it's dependency optional
b91beefc
ER
3#
4# Conditional build:
303e815d 5%bcond_without phpdoc # build phpdoc package
b91beefc
ER
6%bcond_without tests # build without tests
7
303e815d
ER
8# build "phpdoc" only for 7.3 version on pld builders
9%if 0%{?_pld_builder:1} && "%{?php_suffix}" != "73"
10%undefine with_phpdoc
11%endif
12
67fa4b41 13%define php_name php%{?php_suffix}
48db7d63
ER
14%define modname redis
15Summary: %{modname} A PHP extension for Redis
67fa4b41 16Name: %{php_name}-%{modname}
163e049e 17Version: 4.2.0
f2c23d87 18Release: 1
48db7d63
ER
19License: PHP 3.01
20Group: Development/Languages/PHP
7345c0d0 21Source0: https://github.com/phpredis/phpredis/tarball/%{version}/%{modname}-%{version}.tar.gz
163e049e 22# Source0-md5: e2664b39d94f5f72f2e6ac27db92bc70
7345c0d0
ER
23Source1: https://github.com/ukko/phpredis-phpdoc/archive/9ec1795bcd45ec83a19b46cf9a8b78b4e4d7ac80/%{modname}-phpdoc.tar.gz
24# Source1-md5: eaba2e5fad040e2f4526374c073ae5f7
25URL: https://github.com/phpredis/phpredis
67fa4b41 26BuildRequires: %{php_name}-devel >= 4:5.0.4
7345c0d0 27BuildRequires: %{php_name}-cli
c61b27e4
AM
28BuildRequires: %{php_name}-pcre
29BuildRequires: %{php_name}-session
30BuildRequires: %{php_name}-simplexml
a56ffbc5 31%if %{with tests}
c61b27e4 32%endif
48db7d63
ER
33BuildRequires: rpmbuild(macros) >= 1.519
34%{?requires_php_extension}
67fa4b41 35Requires: %{php_name}-session
54d79b38 36Provides: php(%{modname}) = %{version}
e15e2353 37Obsoletes: php-redis < 2.2.5-1
48db7d63
ER
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41The phpredis extension provides an API for communicating with the
42Redis key-value store.
43
44This extension also provides session support.
45
303e815d
ER
46%package -n php-redis-phpdoc
47Summary: @phpdoc extension PHP for IDE autocomplete
48Group: Documentation
49URL: https://github.com/ukko/phpredis-phpdoc
50Requires: php-dirs
51BuildArch: noarch
52
53%description -n php-redis-phpdoc
54@phpdoc extension PHP for IDE autocomplete.
55
48db7d63 56%prep
2b82b6de 57%setup -qc -a1
bc808e49 58mv phpredis-phpredis-*/* .
7345c0d0 59mv phpredis-phpdoc-* phpdoc
48db7d63
ER
60
61%build
62phpize
63%configure
64%{__make}
65
b91beefc
ER
66# simple module load test
67%{__php} -n \
68 -dextension_dir=modules \
fd0294ec 69 -dextension=%{php_extensiondir}/pcre.so \
b91beefc 70 -dextension=%{php_extensiondir}/spl.so \
fd0294ec 71 -dextension=%{php_extensiondir}/simplexml.so \
b91beefc
ER
72 -dextension=%{php_extensiondir}/session.so \
73 -dextension=%{modname}.so \
74 -m > modules.log
75grep %{modname} modules.log
b91beefc 76
48db7d63
ER
77%install
78rm -rf $RPM_BUILD_ROOT
48db7d63
ER
79%{__make} install \
80 EXTENSION_DIR=%{php_extensiondir} \
81 INSTALL_ROOT=$RPM_BUILD_ROOT
82
83install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
84cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
85; Enable %{modname} extension module
86extension=%{modname}.so
87EOF
88
303e815d
ER
89install -d $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
90cp -a phpdoc/src/*.php $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
7345c0d0 91
48db7d63
ER
92%clean
93rm -rf $RPM_BUILD_ROOT
94
95%post
96%php_webserver_restart
97
98%postun
99if [ "$1" = 0 ]; then
100 %php_webserver_restart
101fi
102
103%files
104%defattr(644,root,root,755)
7345c0d0 105%doc CREDITS README.markdown
48db7d63
ER
106%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
107%attr(755,root,root) %{php_extensiondir}/%{modname}.so
303e815d
ER
108
109%if %{with phpdoc}
110%files -n php-redis-phpdoc
111%defattr(644,root,root,755)
112%{_examplesdir}/php-%{modname}-%{version}
113%endif
This page took 0.061282 seconds and 5 git commands to generate.