summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-06-10 07:06:04 +0200
committerRemi Collet <fedora@famillecollet.com>2012-06-10 07:06:04 +0200
commit5e4456d7b80d252b0ff2fa1e2551d03287067207 (patch)
tree583db9e5aa2f4047058de610f8b825b56dab9344
repo reorg
-rw-r--r--Makefile4
-rw-r--r--README24
-rw-r--r--php-pecl-rrd.spec191
-rw-r--r--rrd-zts.patch119
-rw-r--r--rrdtool-php.lst9
5 files changed, 347 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e65467
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../common/Makefile
+
diff --git a/README b/README
new file mode 100644
index 0000000..cd3222b
--- /dev/null
+++ b/README
@@ -0,0 +1,24 @@
+Old bugs (merged in version 0.10.0)
+http://pecl.php.net/bugs/21132 - configure don't honor --libdir
+http://pecl.php.net/bugs/21133 - Provides tests
+http://pecl.php.net/bugs/21135 - declaration warnings - missing headers
+http://pecl.php.net/bugs/21178 - Build against rrdtool 1.4.x
+
+Old bugs (merged in version 1.0.0)
+http://pecl.php.net/bugs/21580 - Build fails against rrdtool 1.2.x
+http://pecl.php.net/bugs/21583 - Please provides LICENSE file
+http://pecl.php.net/bugs/21576 - FAIL RRDCreator test
+http://pecl.php.net/bugs/21577 - rrd 0.10.0 report as 0.9.0
+http://pecl.php.net/bugs/21578 - This RRD was created on another architecture
+http://pecl.php.net/bugs/21579 - FAIL rrd_info test [tests/rrd_012.phpt]
+http://pecl.php.net/bugs/22586 - RFE php-strversion
+
+Commited but not yet published
+ none
+
+Current Bugs
+http://pecl.php.net/bugs/22642 - Build logs against various rrdtool version (with failed tests)
+
+
+Submitted for review : https://bugzilla.redhat.com/695819
+
diff --git a/php-pecl-rrd.spec b/php-pecl-rrd.spec
new file mode 100644
index 0000000..737b07b
--- /dev/null
+++ b/php-pecl-rrd.spec
@@ -0,0 +1,191 @@
+%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+
+%global pecl_name rrd
+
+
+Summary: PHP Bindings for rrdtool
+Name: php-pecl-rrd
+Version: 1.0.5
+Release: 2%{?dist}
+License: BSD
+Group: Development/Languages
+URL: http://pecl.php.net/package/rrd
+
+Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?pre}.tgz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: php-devel >= 5.3.2
+BuildRequires: rrdtool
+BuildRequires: rrdtool-devel >= 1.3.0
+BuildRequires: php-pear
+
+Requires(post): %{__pecl}
+Requires(postun): %{__pecl}
+Conflicts: rrdtool-php
+Provides: php-pecl(%{pecl_name}) = %{version}%{?pre}
+Requires: php(zend-abi) = %{php_zend_api}
+Requires: php(api) = %{php_core_api}
+
+
+# RPM 4.8
+%{?filter_provides_in: %filter_provides_in %{_dir}/.*\.so$}
+%{?filter_setup}
+# RPM 4.9
+%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{_libdir}/.*\\.so$
+
+
+%description
+Procedural and simple OO wrapper for rrdtool - data logging and graphing
+system for time series data.
+
+
+%prep
+%setup -c -q
+
+cp -r %{pecl_name}-%{version}%{?pre} %{pecl_name}-%{version}-zts
+
+extver=$(sed -n '/#define PHP_RRD_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}%{?pre}/php_rrd.h)
+if test "x${extver}" != "x%{version}%{?pre}"; then
+ : Error: Upstream version is ${extver}, expecting %{version}.
+ exit 1
+fi
+
+cat > %{pecl_name}.ini << 'EOF'
+; Enable %{pecl_name} extension module
+extension=%{pecl_name}.so
+EOF
+
+
+%build
+cd %{pecl_name}-%{version}%{?pre}
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
+make %{?_smp_mflags}
+
+cd ../%{pecl_name}-%{version}-zts
+%{_bindir}/zts-phpize
+%configure --with-php-config=%{_bindir}/zts-php-config
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make install -C %{pecl_name}-%{version}%{?pre} INSTALL_ROOT=%{buildroot}
+make install -C %{pecl_name}-%{version}-zts INSTALL_ROOT=%{buildroot}
+
+# Drop in the bit of configuration
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+
+
+%check
+%{__ztsphp} --no-php-ini \
+ --define extension_dir=%{pecl_name}-%{version}-zts/modules \
+ --define extension=%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+cd %{pecl_name}-%{version}%{?pre}
+%{__php} --no-php-ini \
+ --define extension_dir=modules \
+ --define extension=%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+
+make -C tests/data clean
+make -C tests/data all
+make test NO_INTERACTION=1 | tee rpmtests.log
+
+if grep -q "FAILED TEST" rpmtests.log; then
+ for t in tests/*diff; do
+ echo "*** FAILED: $(basename $t .diff)"
+ diff -u tests/$(basename $t .diff).exp tests/$(basename $t .diff).out || :
+ done
+%if 0%{?fedora} >= 14
+ # tests only succeed with rrdtool 1.4.x
+ # http://pecl.php.net/bugs/22642
+ exit 1
+%endif
+fi
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post
+%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+
+
+%postun
+if [ $1 -eq 0 ] ; then
+ %{pecl_uninstall} %{pecl_name} >/dev/null || :
+fi
+
+
+%files
+%defattr(-, root, root, -)
+%doc %{pecl_name}-%{version}%{?pre}/{CREDITS,LICENSE}
+%config(noreplace) %{php_inidir}/%{pecl_name}.ini
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%{php_extdir}/%{pecl_name}.so
+%{php_ztsextdir}/%{pecl_name}.so
+%{pecl_xmldir}/%{name}.xml
+
+
+%changelog
+* Fri Nov 18 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.5-2
+- build against php 5.4
+
+* Fri Nov 18 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.5-1
+- update to 1.0.5
+- change license from PHP to BSD
+
+* Sun Nov 13 2011 Remi Collet <remi@fedoraproject.org> - 1.0.5-0.3.RC2
+- build against php 5.4
+
+* Mon Oct 17 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.5-0.2.RC2
+- update to 1.0.5RC2
+- drop patch merged upstream
+
+* Wed Oct 05 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.5-0.1.RC1
+- update to 1.0.5RC1
+- build ZTS extension
+- patch for https://bugs.php.net/bug.php?id=59992
+
+* Tue Aug 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.4-1
+- Version 1.0.4 (stable) - API 1.0.4 (stable)
+- fix filters
+
+* Fri Apr 29 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.3-1
+- Version 1.0.3 (stable) - API 1.0.3 (stable)
+- no change in sources
+
+* Wed Apr 20 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.2-1
+- Version 1.0.2 (stable) - API 1.0.2 (stable)
+- no change in sources
+
+* Sat Apr 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.1-1
+- Version 1.0.1 (stable) - API 1.0.1 (stable)
+- no change in sources
+- remove generated Changelog (only latest version, no real value)
+
+* Tue Apr 12 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.0-1
+- Version 1.0.0 (stable) - API 1.0.0 (stable)
+- remove all patches merged by upstream
+
+* Sat Mar 05 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-2
+- improved patches
+- implement rrd_strversion
+
+* Fri Mar 04 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-1
+- Version 0.10.0 (stable) - API 0.10.0 (beta)
+- remove patches, merged upstream
+- add links to 5 new upstream bugs
+
+* Mon Jan 03 2011 Remi Collet <Fedora@FamilleCollet.com> 0.9.0-1
+- Version 0.9.0 (beta) - API 0.9.0 (beta)
+- initial RPM
+
diff --git a/rrd-zts.patch b/rrd-zts.patch
new file mode 100644
index 0000000..89e136e
--- /dev/null
+++ b/rrd-zts.patch
@@ -0,0 +1,119 @@
+diff -up rrd-1.0.5-zts/config.h.zts rrd-1.0.5-zts/config.h
+diff -up rrd-1.0.5-zts/php_rrd.h.zts rrd-1.0.5-zts/php_rrd.h
+diff -up rrd-1.0.5-zts/rrd_create.c.zts rrd-1.0.5-zts/rrd_create.c
+--- rrd-1.0.5-zts/rrd_create.c.zts 2011-10-05 16:55:01.879360846 +0200
++++ rrd-1.0.5-zts/rrd_create.c 2011-10-05 16:57:33.400886856 +0200
+@@ -359,7 +359,7 @@ static zend_function_entry rrd_create_me
+ };
+
+ /* minit hook, called from main module minit */
+-void rrd_create_minit(TSRMLS_DC)
++void rrd_create_minit(TSRMLS_D)
+ {
+ zend_class_entry ce;
+ INIT_CLASS_ENTRY(ce, "RRDCreator", rrd_create_methods);
+diff -up rrd-1.0.5-zts/rrd_create.h.zts rrd-1.0.5-zts/rrd_create.h
+--- rrd-1.0.5-zts/rrd_create.h.zts 2011-10-05 16:55:01.890360872 +0200
++++ rrd-1.0.5-zts/rrd_create.h 2011-10-05 16:55:39.430491085 +0200
+@@ -19,7 +19,7 @@
+ #ifndef RRD_CREATE_H
+ #define RRD_CREATE_H
+
+-void rrd_create_minit(TSRMLS_DC);
++void rrd_create_minit(TSRMLS_D);
+ PHP_FUNCTION(rrd_create);
+
+ #endif /* RRD_CREATE_H */
+diff -up rrd-1.0.5-zts/rrd.c.zts rrd-1.0.5-zts/rrd.c
+--- rrd-1.0.5-zts/rrd.c.zts 2011-10-05 16:55:01.876360794 +0200
++++ rrd-1.0.5-zts/rrd.c 2011-10-05 16:56:02.510571180 +0200
+@@ -585,9 +585,9 @@ static zend_function_entry rrd_functions
+ /* {{{ PHP_MINIT_FUNCTION */
+ static PHP_MINIT_FUNCTION(rrd)
+ {
+- rrd_graph_minit(TSRMLS_CC);
+- rrd_create_minit(TSRMLS_CC);
+- rrd_update_minit(TSRMLS_CC);
++ rrd_graph_minit(TSRMLS_C);
++ rrd_create_minit(TSRMLS_C);
++ rrd_update_minit(TSRMLS_C);
+ return SUCCESS;
+ }
+ /* }}} */
+diff -up rrd-1.0.5-zts/rrd_graph.c.zts rrd-1.0.5-zts/rrd_graph.c
+--- rrd-1.0.5-zts/rrd_graph.c.zts 2011-10-05 16:55:01.881360851 +0200
++++ rrd-1.0.5-zts/rrd_graph.c 2011-10-05 16:57:10.217806300 +0200
+@@ -319,7 +319,7 @@ PHP_METHOD(RRDGraph, saveVerbose)
+
+ /* making return array */
+ array_init(return_value);
+- rrd_info_toarray(rrd_info_data, return_value);
++ rrd_info_toarray(rrd_info_data, return_value TSRMLS_CC);
+
+ rrd_info_free(rrd_info_data);
+ rrd_args_free(graph_argv);
+@@ -413,7 +413,7 @@ static zend_function_entry rrd_graph_met
+ };
+
+ /* minit hook, called from main module minit */
+-void rrd_graph_minit(TSRMLS_DC)
++void rrd_graph_minit(TSRMLS_D)
+ {
+ zend_class_entry ce;
+ INIT_CLASS_ENTRY(ce, "RRDGraph", rrd_graph_methods);
+diff -up rrd-1.0.5-zts/rrd_graph.h.zts rrd-1.0.5-zts/rrd_graph.h
+--- rrd-1.0.5-zts/rrd_graph.h.zts 2011-10-05 16:55:01.892360879 +0200
++++ rrd-1.0.5-zts/rrd_graph.h 2011-10-05 16:55:20.609425792 +0200
+@@ -19,7 +19,7 @@
+ #ifndef RRD_GRAPH_H
+ #define RRD_GRAPH_H
+
+-extern void rrd_graph_minit(TSRMLS_DC);
++extern void rrd_graph_minit(TSRMLS_D);
+ extern PHP_FUNCTION(rrd_graph);
+
+ #endif /* RRD_GRAPH_H */
+diff -up rrd-1.0.5-zts/rrd_info.c.zts rrd-1.0.5-zts/rrd_info.c
+--- rrd-1.0.5-zts/rrd_info.c.zts 2011-10-05 16:55:01.882360849 +0200
++++ rrd-1.0.5-zts/rrd_info.c 2011-10-05 16:58:30.590085673 +0200
+@@ -60,7 +60,7 @@ PHP_FUNCTION(rrd_info)
+
+ /* making return array*/
+ array_init(return_value);
+- rrd_info_toarray(rrd_info_data, return_value);
++ rrd_info_toarray(rrd_info_data, return_value TSRMLS_CC);
+ rrd_info_free(rrd_info_data);
+ }
+ /* }}} */
+@@ -99,4 +99,4 @@ uint rrd_info_toarray(const rrd_info_t *
+
+ return 1;
+ }
+-/* }}} */
+\ Pas de fin de ligne à la fin du fichier.
++/* }}} */
+diff -up rrd-1.0.5-zts/rrd_info.h.zts rrd-1.0.5-zts/rrd_info.h
+diff -up rrd-1.0.5-zts/rrd_update.c.zts rrd-1.0.5-zts/rrd_update.c
+--- rrd-1.0.5-zts/rrd_update.c.zts 2011-10-05 16:55:01.884360848 +0200
++++ rrd-1.0.5-zts/rrd_update.c 2011-10-05 16:57:52.776954202 +0200
+@@ -290,7 +290,7 @@ static zend_function_entry rrd_update_me
+ };
+
+ /* minit hook, called from main module minit */
+-void rrd_update_minit(TSRMLS_DC)
++void rrd_update_minit(TSRMLS_D)
+ {
+ zend_class_entry ce;
+ INIT_CLASS_ENTRY(ce, "RRDUpdater", rrd_update_methods);
+diff -up rrd-1.0.5-zts/rrd_update.h.zts rrd-1.0.5-zts/rrd_update.h
+--- rrd-1.0.5-zts/rrd_update.h.zts 2011-10-05 16:55:01.896360893 +0200
++++ rrd-1.0.5-zts/rrd_update.h 2011-10-05 16:55:42.005500019 +0200
+@@ -19,7 +19,7 @@
+ #ifndef RRD_UPDATE_H
+ #define RRD_UPDATE_H
+
+-void rrd_update_minit(TSRMLS_DC);
++void rrd_update_minit(TSRMLS_D);
+ PHP_FUNCTION(rrd_update);
+
+ #endif /* RRD_UPDATE_H */
diff --git a/rrdtool-php.lst b/rrdtool-php.lst
new file mode 100644
index 0000000..454d697
--- /dev/null
+++ b/rrdtool-php.lst
@@ -0,0 +1,9 @@
+ [2474] => rrd_graph
+ [2475] => rrd_fetch
+ [2476] => rrd_error
+ [2477] => rrd_clear_error
+ [2478] => rrd_update
+ [2479] => rrd_last
+ [2480] => rrd_create
+ [2481] => rrdtool_info
+ [2482] => rrdtool_logo_guid