From fc680870aa9d54a5d802ece07547a49ba1f67d1c Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 15 Jul 2009 14:26:43 +0000 Subject: [PATCH] deal with churn in php language --- graphviz.spec.in | 26 +++++++++++++++++++++++--- tclpkg/gv/demo/modgraph.php | 5 +++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/graphviz.spec.in b/graphviz.spec.in index 0629e7e27..049c2e6d8 100644 --- a/graphviz.spec.in +++ b/graphviz.spec.in @@ -531,15 +531,21 @@ Perl extension for graphviz. Group: Applications/Multimedia Summary: PHP extension for graphviz Requires: graphviz = %{version}-%{release} php +%if %{?php_zend_api}0 +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +%else +Requires: php-api = %{php_apiver} +%endif %description php PHP extension for graphviz. %files php %defattr(-,root,root,-) -%dir %{_libdir}/graphviz/php -%{_libdir}/graphviz/php/* -%{_libdir}/php*/* +%config(noreplace) %{_sysconfdir}/php.d/%{name}.ini +%{_libdir}/graphviz/php/ +%{php_extdir}/gv.so %{_datadir}/php*/* %{_datadir}/graphviz/demo/*.php* %{_mandir}/man3/*.3php* @@ -730,6 +736,20 @@ chmod -x %{buildroot}%{_datadir}/%{name}/lefty/* cp -a %{buildroot}%{_datadir}/%{name}/doc __doc rm -rf %{buildroot}%{_datadir}/%{name}/doc +# PHP configuration file +%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d +%{__cat} << __EOF__ > %{buildroot}%{_sysconfdir}/php.d/%{name}.ini +; Enable %{name} extension module +extension=gv.so +__EOF__ + +%check +%ifnarch ppc64 ppc +# regression test, segfaults on ppc/ppc64, possible endian issues? +cd rtest +make rtest +%endif + %clean # optional regression test using the products in the build tree %if 0%{?rtest} diff --git a/tclpkg/gv/demo/modgraph.php b/tclpkg/gv/demo/modgraph.php index a15a88e8e..12e8bcded 100755 --- a/tclpkg/gv/demo/modgraph.php +++ b/tclpkg/gv/demo/modgraph.php @@ -23,10 +23,11 @@ gv::setv($E, "arrowsize", ".4"); $f = fopen("/proc/modules", "r"); while ( ! feof($f)) { $rec = fgets($f); + if ($rec == "") break; $matches = preg_split("/[\s]+/", $rec, -1, PREG_SPLIT_NO_EMPTY); - $n = gv::node($G,$matches[0:0]); - $usedbylist = preg_split("/[,]/", $matches[3:0], -1, PREG_SPLIT_NO_EMPTY); + $n = gv::node($G,$matches[0]); + $usedbylist = preg_split("/[,]/", $matches[3], -1, PREG_SPLIT_NO_EMPTY); foreach ($usedbylist as $i => $usedby) { if ($usedby != "-") { gv::edge($n, gv::node($G, $usedby)); -- 2.40.0