Skip to content
This repository was archived by the owner on Jul 3, 2019. It is now read-only.

Commit 94f146a

Browse files
author
Remi Collet
committed
git snapshopt for PHP 7
- don't install/register tests - fix license installation
1 parent b71890e commit 94f146a

File tree

3 files changed

+55
-17
lines changed

3 files changed

+55
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ package*xml
44
/memcached-2.0.1.tgz
55
/memcached-2.1.0.tgz
66
/memcached-2.2.0.tgz
7+
/php-memcached-3.0.0-6ace07d.tar.gz

php-pecl-memcached.spec

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright (c) 2009-2016 Remi Collet
44
# License: CC-BY-SA
5-
# http://creativecommons.org/licenses/by-sa/3.0/
5+
# http://creativecommons.org/licenses/by-sa/4.0/
66
#
77
# Please, preserve the changelog entries
88
#
@@ -11,21 +11,30 @@
1111
%global with_tests 0%{?_with_tests:1}
1212
%global pecl_name memcached
1313
# After 40-igbinary, 40-json, 40-msgpack
14-
%global ini_name 50-%{pecl_name}.ini
14+
%global ini_name 50-%{pecl_name}.ini
15+
# https://github.com/php-memcached-dev/php-memcached/commits/php7
16+
%global gh_commit 6ace07da69a5ebc021e56a9d2f52cdc8897b4f23
17+
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
18+
%global gh_date 20160217
19+
%global gh_owner php-memcached-dev
20+
%global gh_project php-memcached
1521

1622
Summary: Extension to work with the Memcached caching daemon
1723
Name: php-pecl-memcached
18-
Version: 2.2.0
19-
Release: 8%{?dist}
20-
# memcached is PHP, FastLZ is MIT
21-
License: PHP and MIT
24+
Version: 3.0.0
25+
%if 0%{?gh_date:1}
26+
Release: 0.1.%{gh_date}git%{gh_short}%{?dist}
27+
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz
28+
%else
29+
Release: 1%{?dist}
30+
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
31+
%endif
32+
License: PHP
2233
Group: Development/Languages
2334
URL: http://pecl.php.net/package/%{pecl_name}
2435

25-
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
2636

27-
# 5.2.10 required to HAVE_JSON enabled
28-
BuildRequires: php-devel >= 5.2.10
37+
BuildRequires: php-devel >= 7
2938
BuildRequires: php-pear
3039
BuildRequires: php-json
3140
BuildRequires: php-pecl-igbinary-devel
@@ -36,16 +45,17 @@ BuildRequires: libevent-devel > 2
3645
BuildRequires: libmemcached-devel > 1
3746
BuildRequires: zlib-devel
3847
BuildRequires: cyrus-sasl-devel
48+
BuildRequires: fastlz-devel
3949
%if %{with_tests}
4050
BuildRequires: memcached
4151
%endif
4252

4353
Requires: php-json%{?_isa}
44-
Requires: php-pecl-igbinary%{?_isa}
54+
Requires: php-igbinary%{?_isa}
4555
Requires: php(zend-abi) = %{php_zend_api}
4656
Requires: php(api) = %{php_core_api}
4757
%ifnarch ppc64
48-
Requires: php-pecl-msgpack%{?_isa}
58+
Requires: php-msgpack%{?_isa}
4959
%endif
5060

5161
Provides: php-%{pecl_name} = %{version}
@@ -68,11 +78,31 @@ It also provides a session handler (memcached).
6878
%prep
6979
%setup -c -q
7080

81+
%if 0%{?gh_date:1}
82+
mv %{gh_project}-%{gh_commit} NTS
83+
sed -e '/PHP_MEMCACHED_VERSION/s/3.0.0b1/%{version}-dev/' -i NTS/php_memcached.h
84+
%{__php} -r '
85+
$pkg = simplexml_load_file("NTS/package.xml");
86+
$pkg->date = substr("%{gh_date}",0,4)."-".substr("%{gh_date}",4,2)."-".substr("%{gh_date}",6,2);
87+
$pkg->version->release = "%{version}dev";
88+
$pkg->stability->release = "devel";
89+
$pkg->asXML("package.xml");
90+
'
91+
%else
7192
mv %{pecl_name}-%{version}%{?prever} NTS
93+
%endif
94+
95+
# Don't install/register tests
96+
sed -e 's/role="test"/role="src"/' \
97+
-e '/LICENSE/s/role="doc"/role="src"/' \
98+
-e '/name=.fastlz/d' \
99+
-i package.xml
100+
101+
rm -r NTS/fastlz
72102

73103
# Chech version as upstream often forget to update this
74104
extver=$(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_memcached.h)
75-
if test "x${extver}" != "x%{version}"; then
105+
if test "x${extver}" != "x%{version}%{?gh_date:-dev}%{?intver}"; then
76106
: Error: Upstream HTTP version is now ${extver}, expecting %{version}.
77107
: Update the pdover macro and rebuild.
78108
exit 1
@@ -114,7 +144,12 @@ peclconf() {
114144
%ifnarch ppc64
115145
--enable-memcached-msgpack \
116146
%endif
147+
%if 1
148+
--disable-memcached-protocol \
149+
%else
117150
--enable-memcached-protocol \
151+
%endif
152+
--with-system-fastlz \
118153
--with-php-config=$1
119154
}
120155
cd NTS
@@ -149,9 +184,6 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
149184

150185
# Test & Documentation
151186
cd NTS
152-
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
153-
do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
154-
done
155187
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
156188
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
157189
done
@@ -213,8 +245,8 @@ exit $ret
213245

214246

215247
%files
248+
%license NTS/LICENSE
216249
%doc %{pecl_docdir}/%{pecl_name}
217-
%doc %{pecl_testdir}/%{pecl_name}
218250
%{pecl_xmldir}/%{name}.xml
219251

220252
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -227,6 +259,11 @@ exit $ret
227259

228260

229261
%changelog
262+
* Mon Jun 27 2016 Remi Collet <rcollet@redhat.com> - 3.0.0-0.1.20160217git6ace07d
263+
- git snapshopt for PHP 7
264+
- don't install/register tests
265+
- fix license installation
266+
230267
* Wed Feb 10 2016 Remi Collet <remi@fedoraproject.org> - 2.2.0-8
231268
- drop scriptlets (replaced by file triggers in php-pear)
232269
- cleanup

sources

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
28937c6144f734e000c6300242f44ce6 memcached-2.2.0.tgz
1+
773cfe454e8eee2a17797b1bfafb1dcd php-memcached-3.0.0-6ace07d.tar.gz

0 commit comments

Comments
 (0)