summaryrefslogtreecommitdiffstats
path: root/php-pecl-memcache.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-memcache.spec')
-rw-r--r--php-pecl-memcache.spec110
1 files changed, 86 insertions, 24 deletions
diff --git a/php-pecl-memcache.spec b/php-pecl-memcache.spec
index 190944f..002fa9d 100644
--- a/php-pecl-memcache.spec
+++ b/php-pecl-memcache.spec
@@ -6,32 +6,44 @@
#
# Please, preserve the changelog entries
#
-%{?scl: %scl_package php-pecl-memcache}
+%if 0%{?scl:1}
+%global sub_prefix %{scl_prefix}
+%scl_package php-pecl-memcache
+%endif
-%global pecl_name memcache
+# https://github.com/websupport-sk/pecl-memcache/commits/NON_BLOCKING_IO_php7
+%global gh_commit df7735e813d247ea141458e1774d163ad4e2d068
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner websupport-sk
+%global gh_project pecl-memcache
+%global gh_date 20161124
+%global pecl_name memcache
# Not ready, some failed UDP tests. Neded investigation.
-%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
-%global with_zts 0%{?__ztsphp:1}
+%global with_tests 0%{?_with_tests:1}
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
+%global ini_name %{pecl_name}.ini
%else
-%global ini_name 40-%{pecl_name}.ini
+%global ini_name 40-%{pecl_name}.ini
%endif
Summary: Extension to work with the Memcached caching daemon
Name: %{?scl_prefix}php-pecl-memcache
-Version: 3.0.8
-Release: 8%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Version: 3.0.9
+%if 0%{?gh_date:1}
+Release: 0.8.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+%else
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+%endif
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
-Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-# Missing in official archive
-# http://svn.php.net/viewvc/pecl/memcache/branches/NON_BLOCKING_IO/tests/connect.inc?view=co
-Source3: connect.inc
-
-Patch0: %{pecl_name}-gcc5.patch
+%if 0%{?gh_date:1}
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
+%else
+Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel
@@ -49,8 +61,10 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+%if "%{?scl_prefix}" != "%{?sub_prefix}"
Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
@@ -66,6 +80,18 @@ Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.0"
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -90,20 +116,31 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -c -q
+%if 0%{?gh_date:1}
+mv %{gh_project}-%{gh_commit} NTS
+%{__php} -r '
+ $pkg = simplexml_load_file("NTS/package.xml");
+ $pkg->date = substr("%{gh_date}",0,4)."-".substr("%{gh_date}",4,2)."-".substr("%{gh_date}",6,2);
+ $pkg->version->release = "%{version}dev";
+ $pkg->stability->release = "devel";
+ $pkg->asXML("package.xml");
+'
+%else
+mv %{pecl_name}-%{version} NTS
+%endif
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{version} NTS
pushd NTS
-%patch0 -p1 -b .gcc5
# Chech version as upstream often forget to update this
-extver=$(sed -n '/#define PHP_MEMCACHE_VERSION/{s/.* "//;s/".*$//;p}' php_memcache.h)
-if test "x${extver}" != "x%{version}"; then
- : Error: Upstream version is now ${extver}, expecting %{version}.
+dir=php$(%{__php} -r 'echo PHP_MAJOR_VERSION;')
+extver=$(sed -n '/#define PHP_MEMCACHE_VERSION/{s/.* "//;s/".*$//;p}' $dir/php_memcache.h)
+if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
+ : Error: Upstream version is now ${extver}, expecting %{version}%{?gh_date:-dev}.
: Update the pdover macro and rebuild.
exit 1
fi
@@ -186,7 +223,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# Documentation
-for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+for i in $(grep '<file .* role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -207,10 +244,12 @@ done
%if %{with_tests}
: Configuration for tests
cd NTS
-cp %{SOURCE3} tests
sed -e "s:/var/run/memcached/memcached.sock:$PWD/memcached.sock:" \
-i tests/connect.inc
+: Udp tests
+rm tests/0{36,38,39,55,57}.phpt
+
: Launch the daemons
memcached -p 11211 -U 11211 -d -P $PWD/memcached1.pid
memcached -p 11212 -U 11212 -d -P $PWD/memcached2.pid
@@ -222,7 +261,7 @@ TEST_PHP_EXECUTABLE=%{_bindir}/php \
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests.php || ret=1
+%{_bindir}/php -n run-tests.php --show-diff || ret=1
: Cleanup
if [ -f memcached2.pid ]; then
@@ -262,8 +301,10 @@ fi
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
+
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
+
%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ini_name}
%{php_ztsextdir}/%{pecl_name}.so
@@ -271,10 +312,31 @@ fi
%changelog
-* Wed Mar 9 2016 Remi Collet <remi@fedoraproject.org> - 3.0.8-8
+* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 3.0.9-0.8.20161124gitdf7735e
+- rebuild for PHP 7.2.0beta1 new API
+
+* Fri Dec 2 2016 Remi Collet <remi@fedoraproject.org> - 3.0.9-0.7.20161124gitdf7735e
+- refresh to more recent snapshot
+
+* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 3.0.9-0.6.20160311git4991c2f
+- rebuild with PHP 7.1.0 GA
+
+* Wed Sep 14 2016 Remi Collet <remi@fedoraproject.org> - 3.0.9-0.5.20160311git4991c2f
+- rebuild for PHP 7.1 new API version
+
+* Sat Jun 11 2016 Remi Collet <rcollet@redhat.com> - 3.0.9-0.4.20160311git4991c2f
+- refresh
+
+* Sat Mar 5 2016 Remi Collet <rcollet@redhat.com> - 3.0.9-0.3.20151130gitfdbd46b
- adapt for F24
+
+* Sun Jan 10 2016 Remi Collet <rcollet@redhat.com> - 3.0.9-0.2.20151130gitfdbd46b
+- set stability = devel in package.xml
+
+* Sun Jan 3 2016 Remi Collet <rcollet@redhat.com> - 3.0.9-0.1.20151130gitfdbd46b
+- git snapshopt for PHP 7
+- sources from https://github.com/websupport-sk/pecl-memcache (for PHP 7)
- drop runtime dependency on pear, new scriptlets
-- fix license management
- don't install/register tests
* Tue Feb 10 2015 Remi Collet <rcollet@redhat.com> - 3.0.8-7