]> git.pld-linux.org Git - packages/php-pecl-redis.git/blame - php-redis.spec
subpackage phpdoc
[packages/php-pecl-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
c61b27e4 27%if %{with tests}
7345c0d0 28BuildRequires: %{php_name}-cli
c61b27e4
AM
29BuildRequires: %{php_name}-pcre
30BuildRequires: %{php_name}-session
31BuildRequires: %{php_name}-simplexml
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%if %{with tests}
67# simple module load test
68%{__php} -n \
69 -dextension_dir=modules \
fd0294ec 70 -dextension=%{php_extensiondir}/pcre.so \
b91beefc 71 -dextension=%{php_extensiondir}/spl.so \
fd0294ec 72 -dextension=%{php_extensiondir}/simplexml.so \
b91beefc
ER
73 -dextension=%{php_extensiondir}/session.so \
74 -dextension=%{modname}.so \
75 -m > modules.log
76grep %{modname} modules.log
77%endif
78
48db7d63
ER
79%install
80rm -rf $RPM_BUILD_ROOT
48db7d63
ER
81%{__make} install \
82 EXTENSION_DIR=%{php_extensiondir} \
83 INSTALL_ROOT=$RPM_BUILD_ROOT
84
85install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
86cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
87; Enable %{modname} extension module
88extension=%{modname}.so
89EOF
90
303e815d
ER
91install -d $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
92cp -a phpdoc/src/*.php $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
7345c0d0 93
48db7d63
ER
94%clean
95rm -rf $RPM_BUILD_ROOT
96
97%post
98%php_webserver_restart
99
100%postun
101if [ "$1" = 0 ]; then
102 %php_webserver_restart
103fi
104
105%files
106%defattr(644,root,root,755)
7345c0d0 107%doc CREDITS README.markdown
48db7d63
ER
108%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
109%attr(755,root,root) %{php_extensiondir}/%{modname}.so
303e815d
ER
110
111%if %{with phpdoc}
112%files -n php-redis-phpdoc
113%defattr(644,root,root,755)
114%{_examplesdir}/php-%{modname}-%{version}
115%endif
This page took 0.13043 seconds and 4 git commands to generate.