summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-03-29 13:52:18 +0200
committerRemi Collet <fedora@famillecollet.com>2016-03-29 13:52:18 +0200
commit3b87900beed3fb2e4e0524716f1675fb501ff747 (patch)
tree3dda193e2ea870fa7cbce65228339c0e87c623d5
parent061adba078a4ad9b8446d195122bb743c1d85557 (diff)
php-pecl-apm: 2.1.0 (php 5 and 7, beta)
-rw-r--r--APM-pr38.patch75
-rw-r--r--php-pecl-apm.spec33
2 files changed, 100 insertions, 8 deletions
diff --git a/APM-pr38.patch b/APM-pr38.patch
new file mode 100644
index 0000000..191288f
--- /dev/null
+++ b/APM-pr38.patch
@@ -0,0 +1,75 @@
+From ba6e8150b4d90220d89f77d5188918960bf0b3b4 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Tue, 29 Mar 2016 13:29:03 +0200
+Subject: [PATCH] fix php5/ZTS build
+
+---
+ apm.c | 2 +-
+ driver_mysql.c | 2 +-
+ driver_socket.c | 2 +-
+ driver_sqlite3.c | 2 +-
+ php_apm.h | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/apm.c b/apm.c
+index 5c64e67..624369c 100644
+--- a/apm.c
++++ b/apm.c
+@@ -566,7 +566,7 @@ static void process_event(int event_type, int type, char * error_filename, uint
+ #define FETCH_HTTP_GLOBALS(name) (tmp = PG(http_globals)[TRACK_VARS_##name])
+ #endif
+
+-void extract_data()
++void extract_data(TSRMLS_D)
+ {
+ zval *tmp;
+
+diff --git a/driver_mysql.c b/driver_mysql.c
+index d8f3a30..1f2390b 100644
+--- a/driver_mysql.c
++++ b/driver_mysql.c
+@@ -140,7 +140,7 @@ static void apm_driver_mysql_insert_request(TSRMLS_D)
+ struct in_addr ip_addr;
+ MYSQL *connection;
+
+- extract_data();
++ extract_data(TSRMLS_C);
+
+ APM_DEBUG("[MySQL driver] Begin insert request\n");
+ if (APM_G(mysql_is_request_created)) {
+diff --git a/driver_socket.c b/driver_socket.c
+index a614bd0..97261be 100644
+--- a/driver_socket.c
++++ b/driver_socket.c
+@@ -143,7 +143,7 @@ int apm_driver_socket_rshutdown(TSRMLS_D)
+ return SUCCESS;
+ }
+
+- extract_data();
++ extract_data(TSRMLS_C);
+
+ sd_it = 0;
+
+diff --git a/driver_sqlite3.c b/driver_sqlite3.c
+index 3050c33..049e5e1 100644
+--- a/driver_sqlite3.c
++++ b/driver_sqlite3.c
+@@ -191,7 +191,7 @@ static void apm_driver_sqlite3_insert_request(TSRMLS_D)
+ struct in_addr ip_addr;
+ sqlite3 *connection;
+
+- extract_data();
++ extract_data(TSRMLS_C);
+
+ APM_DEBUG("[SQLite driver] Begin insert request\n");
+ if (APM_G(sqlite3_is_request_created)) {
+diff --git a/php_apm.h b/php_apm.h
+index 9bad594..775d158 100644
+--- a/php_apm.h
++++ b/php_apm.h
+@@ -378,4 +378,4 @@ length);
+
+ #endif
+
+-void extract_data();
++void extract_data(TSRMLS_D);
diff --git a/php-pecl-apm.spec b/php-pecl-apm.spec
index 7679176..0358764 100644
--- a/php-pecl-apm.spec
+++ b/php-pecl-apm.spec
@@ -8,19 +8,20 @@
#
%if 0%{?scl:1}
%if "%{scl}" == "rh-php56"
-%global sub_prefix more-php56-
+%global sub_prefix more-php56-
%else
-%global sub_prefix %{scl_prefix}
+%global sub_prefix %{scl_prefix}
%endif
+%scl_package php-pecl-apm
+%else
+%global pkg_name %{name}
%endif
-%{?scl: %scl_package php-pecl-apm}
-%{!?scl: %global pkg_name %{name}}
%global gh_commit c0bd339a94b7fe5da66c6b5ced286345a4b5410f
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner patrickallaert
%global gh_project php-apm
-%global gh_date 20151117
+#global gh_date 20151117
%global pecl_name apm
%global proj_name APM
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -40,17 +41,21 @@
Name: %{?sub_prefix}php-pecl-apm
Summary: Alternative PHP Monitor
-Version: 2.0.5
+Version: 2.1.0
%if 0%{?gh_date:1}
Release: 6.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Source0: http://pecl.php.net/get/%{proj_name}-%{version}.tgz
%endif
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
# Disable the extension and drivers by default
Patch0: %{proj_name}-config.patch
+# See https://github.com/patrickallaert/php-apm/pull/38
+Patch1: %{proj_name}-pr38.patch
+
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{proj_name}
@@ -74,8 +79,10 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_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}
# Other third party repo stuff
@@ -126,14 +133,19 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
+%if 0%{?gh_date:1}
mv %{gh_project}-%{gh_commit} NTS
mv NTS/package.xml .
+%else
+mv %{proj_name}-%{version} NTS
+%endif
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
cd NTS
%patch0 -p0 -b .rpm
sed -e 's:/var/php/apm/db:%{_localstatedir}/lib/php/apm/db:' -i apm.ini
+%patch1 -p1 -b .pr38
: Sanity check, really often broken
extver=$(sed -n '/#define PHP_APM_VERSION/{s/.* "//;s/".*$//;p}' php_apm.h)
@@ -267,6 +279,11 @@ fi
%changelog
+* Tue Mar 29 2016 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
+- Update to 2.1.0
+- add patch to fix ZTS build
+ open https://github.com/patrickallaert/php-apm/pull/38
+
* Sat Mar 5 2016 Remi Collet <remi@fedoraproject.org> - 2.0.5-6.20151117gitc0bd339
- refresh and adapt for F24