[remctl/el5] fix PHP build for EL5, and add remctl.ini PHP file

Ken Dreyer ktdreyer at fedoraproject.org
Sun Sep 9 05:13:59 UTC 2012


commit c79c8729feebfa79ed4a3b45a014b4fbbe1db5ea
Author: Ken Dreyer <ktdreyer at ktdreyer.com>
Date:   Tue Sep 4 20:57:57 2012 -0600

    fix PHP build for EL5, and add remctl.ini PHP file

 remctl.ini  |    2 ++
 remctl.spec |   29 ++++++++++++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/remctl.ini b/remctl.ini
new file mode 100644
index 0000000..3f51fcf
--- /dev/null
+++ b/remctl.ini
@@ -0,0 +1,2 @@
+; Enable remctl extension module
+extension=remctl.so
diff --git a/remctl.spec b/remctl.spec
index 24e47e7..b9cd944 100644
--- a/remctl.spec
+++ b/remctl.spec
@@ -1,12 +1,13 @@
 Name: remctl
 Version: 3.2
-Release: 4%{?dist}
+Release: 5%{?dist}
 Summary: Client/server for Kerberos-authenticated command execution
 
 Group: Applications/Internet
 License: MIT
 URL: http://www.eyrie.org/~eagle/software/remctl
 Source0: http://archives.eyrie.org/software/kerberos/remctl-%{version}.tar.gz
+Source1: remctl.ini
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 BuildRequires: krb5-devel
@@ -19,6 +20,15 @@ BuildRequires: ruby(abi) = 1.8
 %endif
 BuildRequires: ruby-devel
 
+# RHEL 5/6 compatibility for PHP
+%if 0%{?el5}
+%global php_apiver  %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
+%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
+%endif
+%if 0%{?el5} || 0%{?el6}
+%{!?php_inidir:	%{expand: %%global php_inidir %{_sysconfdir}/php.d }}
+%endif
+
 # RHEL 5 compatibility for Python
 %if 0%{?el5}
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
@@ -70,8 +80,12 @@ remctl's Perl bindings, you need to install this package.
 Summary: PHP interface to remctl
 Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
-Requires: php(zend-abi) = %{php_zend_api}
-Requires: php(api) = %{php_core_api}
+%if 0%{?el5}
+Requires:     php-api = %{php_apiver}
+%else
+Requires:     php(zend-abi) = %{php_zend_api}
+Requires:     php(api) = %{php_core_api}
+%endif
 
 %description php
 remctl implements a client/server protocol for running single commands
@@ -143,6 +157,10 @@ find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
 # And the libraries
 find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
 
+# PHP configuration
+mkdir -p %{buildroot}%{php_inidir}
+install -p %{SOURCE1} %{buildroot}%{php_inidir}
+
 %clean
 rm -rf %{buildroot}
 
@@ -174,6 +192,7 @@ rm -rf %{buildroot}
 %files php
 %defattr(-,root,root,-)
 %{php_extdir}/remctl.so
+%config(noreplace) %{php_inidir}/remctl.ini
 
 %files python
 %defattr(-,root,root,-)
@@ -189,6 +208,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Sep 03 2012 Ken Dreyer <ktdreyer at ktdreyer.com> - 3.2-5
+- Fix PHP build for EL5
+- Add remctl.ini PHP file
+
 * Mon Sep 03 2012 Ken Dreyer <ktdreyer at ktdreyer.com> - 3.2-4
 - Add PHP, Python, and Ruby bindings
 - Drop separate Perl "vendor" patch in favor of using REMCTL_PERL_FLAGS


More information about the scm-commits mailing list