06b9043
# Fedora spec file for php-pecl-solr2
7ad77a5
#
5717426
# Copyright (c) 2011-2018 Remi Collet
7ad77a5
# Copyright (c) 2010 Johan Cwiklinski
7ad77a5
# License: CC-BY-SA
06b9043
# http://creativecommons.org/licenses/by-sa/4.0/
7ad77a5
#
7ad77a5
# Please, preserve the changelog entries
7ad77a5
#
5717426
5717426
# we don't want -z defs linker flag
5717426
%undefine _strict_symbol_defs_build
5717426
7ad77a5
%global pecl_name solr
7ad77a5
%global with_zts  0%{?__ztsphp:1}
7ad77a5
# After 20-curl, 40-json
7ad77a5
%global ini_name  50-%{pecl_name}.ini
06b9043
# For full test (using localhost server) use --with tests
6737513
# retrieve: docker pull omars/solr53
6737513
# create:   docker run -d -p 8983:8983 --name solr5 -t omars/solr53
6737513
# cleanup:  docker stop solr5 && docker rm solr5
06b9043
%global with_tests 0%{?_with_tests:1}
7ad77a5
7ad77a5
Summary:        Object oriented API to Apache Solr
7ad77a5
Name:           php-pecl-solr2
6133931
Version:        2.4.0
bb192b6
Release:        12%{?dist}
7ad77a5
License:        PHP
7ad77a5
URL:            http://pecl.php.net/package/solr
7ad77a5
7ad77a5
Source0:        http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
7ad77a5
d54fd13
Patch0:         upstream.patch
4243c50
Patch1:         0001-fix-Wimplicit-function-declaration.patch
4243c50
Patch2:         0003-Fix-Wincompatible-pointer-types-with-7.3.patch
4243c50
Patch3:         0005-fix-segfault-in-013.solrclient_getByIds.sh.patch
d54fd13
7ad77a5
BuildRequires:  php-devel
7ad77a5
BuildRequires:  php-pear
7ad77a5
BuildRequires:  php-curl
7ad77a5
BuildRequires:  php-json
7ad77a5
BuildRequires:  curl-devel
7ad77a5
BuildRequires:  libxml2-devel
e9b71f1
BuildRequires:  pcre-devel
7ad77a5
7ad77a5
Requires:       php(zend-abi) = %{php_zend_api}
7ad77a5
Requires:       php(api) = %{php_core_api}
7ad77a5
Requires:       php-curl%{?_isa}
7ad77a5
Requires:       php-json%{?_isa}
7ad77a5
7ad77a5
Provides:       php-%{pecl_name} = %{version}
7ad77a5
Provides:       php-%{pecl_name}%{?_isa} = %{version}
7ad77a5
Provides:       php-pecl(%{pecl_name}) = %{version}
7ad77a5
Provides:       php-pecl(%{pecl_name})%{?_isa} = %{version}
33257f8
b4be94b
Obsoletes:      php-pecl-solr         < 2
b4be94b
Provides:       php-pecl-solr         = %{version}
b4be94b
Provides:       php-pecl-solr%{?_isa} = %{version}
7ad77a5
7ad77a5
7ad77a5
%description
7ad77a5
It effectively simplifies the process of interacting with Apache Solr using
7ad77a5
PHP5 and it already comes with built-in readiness for the latest features.
7ad77a5
7ad77a5
The extension has features such as built-in, serializable query string builder
7ad77a5
objects which effectively simplifies the manipulation of name-value pair
7ad77a5
request parameters across repeated requests.
7ad77a5
7ad77a5
The response from the Solr server is also automatically parsed into native php
7ad77a5
objects whose properties can be accessed as array keys or object properties
7ad77a5
without any additional configuration on the client-side.
7ad77a5
7ad77a5
Its advanced HTTP client reuses the same connection across multiple requests
7ad77a5
and provides built-in support for connecting to Solr servers secured behind
7ad77a5
HTTP Authentication or HTTP proxy servers. It is also able to connect to
7ad77a5
SSL-enabled containers.
7ad77a5
7ad77a5
Please consult the documentation for more details on features.
7ad77a5
  http://php.net/solr
7ad77a5
7ad77a5
Warning: PECL Solr 2 is not compatible with Solr Server < 4.0
7ad77a5
7ad77a5
7ad77a5
%prep
7ad77a5
%setup -c -q
7ad77a5
2389d54
# Don't install/register tests
b4be94b
sed -e 's/role="test"/role="src"/' \
6133931
    -e '/LICENSE/s/role="doc"/role="src"/' \
b4be94b
    -i package.xml
2389d54
7ad77a5
mv %{pecl_name}-%{version}%{?prever} NTS
7ad77a5
7ad77a5
cd NTS
d54fd13
%patch0 -p1 -b .upstream
4243c50
%patch1 -p1 -b .up1
4243c50
%patch2 -p1 -b .up2
4243c50
%patch3 -p1 -b .up3
f432342
7ad77a5
# Check version
6133931
DIR=src/php$(%{__php} -r 'echo PHP_MAJOR_VERSION;')
6133931
extver=$(sed -n '/#define PHP_SOLR_VERSION /{s/.* "//;s/".*$//;p}' $DIR/php_solr_version.h)
7ad77a5
if test "x${extver}" != "x%{version}%{?prever}"; then
7ad77a5
   : Error: Upstream version is ${extver}, expecting %{version}%{?prever}.
7ad77a5
   exit 1
7ad77a5
fi
7ad77a5
7ad77a5
cd ..
7ad77a5
7ad77a5
# Create configuration file
7ad77a5
cat > %{ini_name} << 'EOF'
7ad77a5
; Enable Solr extension module
7ad77a5
extension=%{pecl_name}.so
7ad77a5
EOF
7ad77a5
7ad77a5
%if %{with_zts}
7ad77a5
cp -r NTS ZTS
7ad77a5
%endif
7ad77a5
7ad77a5
7ad77a5
%build
7ad77a5
cd NTS
7ad77a5
%{_bindir}/phpize
7ad77a5
%configure  --with-php-config=%{_bindir}/php-config
7ad77a5
make %{?_smp_mflags}
7ad77a5
7ad77a5
%if %{with_zts}
7ad77a5
cd ../ZTS
7ad77a5
%{_bindir}/zts-phpize
7ad77a5
%configure  --with-php-config=%{_bindir}/zts-php-config
7ad77a5
make %{?_smp_mflags}
7ad77a5
%endif
7ad77a5
7ad77a5
7ad77a5
%install
7ad77a5
make -C NTS install INSTALL_ROOT=%{buildroot}
7ad77a5
7ad77a5
# Install XML package description
7ad77a5
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
7ad77a5
7ad77a5
# install config file
7ad77a5
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
7ad77a5
7ad77a5
%if %{with_zts}
7ad77a5
make -C ZTS install INSTALL_ROOT=%{buildroot}
7ad77a5
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
7ad77a5
%endif
7ad77a5
2389d54
# Documentation
7ad77a5
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
7ad77a5
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
7ad77a5
done
7ad77a5
7ad77a5
7ad77a5
%check
06b9043
%if %{with_tests}
06b9043
sed -e '/SOLR_SERVER_CONFIGURED/s/false/true/' \
4243c50
    -e '/SOLR_SERVER_HOSTNAME/s/solr.test/localhost/' \
06b9043
    -i ?TS/tests/test.config.inc
06b9043
%else
06b9043
sed -e '/SOLR_SERVER_CONFIGURED/s/true/false/' \
06b9043
    -i ?TS/tests/test.config.inc
06b9043
%endif
7ad77a5
7ad77a5
: Minimal load test for NTS installed extension
7ad77a5
%{__php} \
7ad77a5
   -n \
7ad77a5
   -d extension=curl.so \
7ad77a5
   -d extension=json.so \
7ad77a5
   -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
7ad77a5
   -m | grep %{pecl_name}
7ad77a5
7ad77a5
: Upstream test suite for NTS extension
06b9043
cd NTS
06b9043
TEST_PHP_ARGS="-n -d extension=curl.so -d extension=json.so -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
7ad77a5
REPORT_EXIT_STATUS=1 \
7ad77a5
NO_INTERACTION=1 \
7ad77a5
TEST_PHP_EXECUTABLE=%{__php} \
c543fa4
%{__php} -n run-tests.php --show-diff
7ad77a5
7ad77a5
%if %{with_zts}
7ad77a5
: Minimal load test for ZTS installed extension
7ad77a5
%{__ztsphp} \
7ad77a5
   -n \
7ad77a5
   -d extension=curl.so \
7ad77a5
   -d extension=json.so \
7ad77a5
   -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
7ad77a5
   -m | grep %{pecl_name}
7ad77a5
7ad77a5
: Upstream test suite for ZTS extension
06b9043
cd ../ZTS
06b9043
TEST_PHP_ARGS="-n -d extension=curl.so -d extension=json.so -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
7ad77a5
REPORT_EXIT_STATUS=1 \
7ad77a5
NO_INTERACTION=1 \
7ad77a5
TEST_PHP_EXECUTABLE=%{__ztsphp} \
c543fa4
%{__ztsphp} -n run-tests.php --show-diff
7ad77a5
%endif
7ad77a5
7ad77a5
7ad77a5
%files
b4be94b
%license NTS/LICENSE
7ad77a5
%doc %{pecl_docdir}/%{pecl_name}
7ad77a5
%{pecl_xmldir}/%{name}.xml
7ad77a5
7ad77a5
%config(noreplace) %{php_inidir}/%{ini_name}
7ad77a5
%{php_extdir}/%{pecl_name}.so
7ad77a5
7ad77a5
%if %{with_zts}
7ad77a5
%config(noreplace) %{php_ztsinidir}/%{ini_name}
7ad77a5
%{php_ztsextdir}/%{pecl_name}.so
7ad77a5
%endif
7ad77a5
7ad77a5
7ad77a5
%changelog
bb192b6
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-12
bb192b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
bb192b6
4243c50
* Fri Oct 12 2018 Remi Collet <remi@remirepo.net> - 2.4.0-11
4243c50
- Rebuild for https://fedoraproject.org/wiki/Changes/php73
4243c50
- add upstream patch for PHP 7.3
4243c50
a152e0a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-10
a152e0a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a152e0a
c19ff16
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-9
c19ff16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c19ff16
5717426
* Thu Jan 25 2018 Remi Collet <remi@remirepo.net> - 2.4.0-8
5717426
- undefine _strict_symbol_defs_build
5717426
f650bec
* Tue Oct 03 2017 Remi Collet <remi@fedoraproject.org> - 2.4.0-7
f650bec
- rebuild for https://fedoraproject.org/wiki/Changes/php72
f650bec
760d4d2
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-6
760d4d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
760d4d2
f46c382
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-5
f46c382
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f46c382
1c88ab7
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-4
1c88ab7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1c88ab7
6264965
* Fri Nov 25 2016 Remi Collet <remi@fedoraproject.org> - 2.4.0-3
6264965
- rebuild for https://fedoraproject.org/wiki/Changes/php71
6264965
33257f8
* Mon Jun 27 2016 Remi Collet <remi@fedoraproject.org> - 2.4.0-2
33257f8
- rebuild for https://fedoraproject.org/wiki/Changes/php70
33257f8
6133931
* Wed Mar 30 2016 Remi Collet <remi@fedoraproject.org> - 2.4.0-1
6133931
- update to 2.4.0 (stable)
6133931
b4be94b
* Sat Feb 13 2016 Remi Collet <remi@fedoraproject.org> - 2.3.0-3
b4be94b
- drop scriptlets (replaced by file triggers in php-pear)
b4be94b
- cleanup
b4be94b
465aef7
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
465aef7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
465aef7
6737513
* Wed Dec  2 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
6737513
- update to 2.3.0 (stable)
6737513
f432342
* Sun Sep 27 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-2
f432342
- add upstream patch for zpp calls (fix broken ppc64)
f432342
06b9043
* Sun Sep 27 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-1
06b9043
- update to 2.2.1 (stable)
06b9043
- add option to build full test suite with a Solr server
06b9043
573aa5a
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-2
573aa5a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
573aa5a
2389d54
* Sun Jan 18 2015 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
2389d54
- update to 2.1.0
2389d54
- don't install/register test suite
2389d54
29d6f29
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-2
29d6f29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
29d6f29
7ad77a5
* Tue Jun 24 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
7ad77a5
- update to 2.0.0
7ad77a5
- cleanup for review
d0714d3
- ignore 080.solrutils_escapequerychars.phpt on ppc64
7ad77a5
7ad77a5
* Mon Jun 23 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.4
7ad77a5
- test build before 2.0.0 finale
7ad77a5
7ad77a5
* Thu Apr 17 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.3.beta
7ad77a5
- add numerical prefix to extension configuration file (php 5.6)
7ad77a5
7ad77a5
* Tue Mar 25 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.2.beta
7ad77a5
- allow SCL build
7ad77a5
7ad77a5
* Sat Mar  8 2014 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.1.beta
7ad77a5
- update to 2.0.0b (beta)
7ad77a5
- install doc in pecl_docdir
7ad77a5
- install tests in pecl_testdir
7ad77a5
7ad77a5
* Sun Oct 21 2012 Remi Collet <remi@fedoraproject.org> - 1.0.2-4
7ad77a5
- rebuild
7ad77a5
7ad77a5
* Tue Nov 29 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-2
7ad77a5
- php 5.4 build
7ad77a5
7ad77a5
* Tue Nov 29 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
7ad77a5
- update to 1.0.2
7ad77a5
7ad77a5
* Mon Nov 28 2011 Remi Collet <remi@fedoraproject.org> - 1.0.1-4.svn320130
7ad77a5
- svn snapshot (test suite is now ok)
7ad77a5
7ad77a5
* Wed Nov 16 2011 Remi Collet <remi@fedoraproject.org> - 1.0.1-3
7ad77a5
- build against php 5.4
7ad77a5
- ignore test result because of https://bugs.php.net/60313
7ad77a5
7ad77a5
* Thu Oct 06 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.0.1-2
7ad77a5
- ZTS extension
7ad77a5
- spec cleanups
7ad77a5
7ad77a5
* Fri Jun 10 2011 Remi Collet <Fedora@famillecollet.com> - 1.0.1-1
7ad77a5
- Version 1.0.1 (stable) - API 1.0.1 (stable)
7ad77a5
- run test suite after build
7ad77a5
7ad77a5
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.11-2
7ad77a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
7ad77a5
7ad77a5
* Wed Jun 23 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.9.11-1
7ad77a5
- update to latest release
7ad77a5
7ad77a5
* Thu May 13 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.9.10-2
7ad77a5
- consitent use of pecl_name macro
7ad77a5
- add %%check
7ad77a5
- fixes some typos
7ad77a5
- thanks Remi :)
7ad77a5
7ad77a5
* Thu May 13 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.9.10-1
7ad77a5
- update to latest release
7ad77a5
7ad77a5
* Tue Apr 27 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.9.9-2
7ad77a5
- Add missing Requires
7ad77a5
- Remove conditionnal 'php_zend_api' 'pecl_install' no longer required
7ad77a5
- %%define no longer must be used
7ad77a5
- Thanks to Remi :)
7ad77a5
7ad77a5
* Mon Apr 26 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.9.9-1
7ad77a5
- Initial packaging