summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-zmq.spec71
1 files changed, 57 insertions, 14 deletions
diff --git a/php-zmq.spec b/php-zmq.spec
index 4d8444b..7c0ed0e 100644
--- a/php-zmq.spec
+++ b/php-zmq.spec
@@ -2,11 +2,11 @@
%global version 0.6.0
# Temporarily using git checkout since the release version won't build anymore.
-%global release 5.20120613git516bd6f
+%global release 7.20120613git516bd6f
Name: php-zmq
Version: %{version}
-Release: %{release}%{?dist}.1
+Release: %{release}%{?dist}
Summary: PHP 0MQ/zmq/zeromq extension
# See https://github.com/mkoppanen/php-zmq/pull/58 for discussion
License: BSD
@@ -17,45 +17,88 @@ Source: php-zmq-0.6.0-2.20120613git516bd6f.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: php-devel
BuildRequires: php-cli
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 6
+BuildRequires: zeromq3-devel
+%else
BuildRequires: zeromq-devel >= 2.0.7
+%endif
# needed on EL-5
BuildRequires: pkgconfig
-Requires: zeromq >= 2.0.7
+Requires: php(zend-abi) = %{php_zend_api}
+Requires: php(api) = %{php_core_api}
%{?filter_from_provides: %filter_from_provides /^zmq.so/d}
%{?filter_setup}
+
%description
PHP extension for the 0MQ/zmq/zeromq messaging system
%prep
-%setup -q -n php-zmq
+%setup -q -c
+
+# duplicate tree for NTS/ZTS build
+mv php-zmq nts
+cp -pr nts zts
+
%build
-/usr/bin/phpize
-%configure
-%{__make} %{?_smp_mflags}
+cd nts
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
+make %{?_smp_mflags}
+
+cd ../zts
+%{_bindir}/zts-phpize
+%configure --with-php-config=%{_bindir}/zts-php-config
+make %{?_smp_mflags}
+
%install
-%{__make} install INSTALL_ROOT=%{buildroot}
+make -C nts install INSTALL_ROOT=%{buildroot}
+make -C zts install INSTALL_ROOT=%{buildroot}
# Create the ini location
-%{__mkdir} -p %{buildroot}/%{_sysconfdir}/php.d
+mkdir -p %{buildroot}/%{php_inidir}
+mkdir -p %{buildroot}/%{php_ztsinidir}
# Preliminary extension ini
-echo "extension=zmq.so" > %{buildroot}/%{_sysconfdir}/php.d/zmq.ini
+echo "extension=zmq.so" > %{buildroot}/%{php_inidir}/zmq.ini
+echo "extension=zmq.so" > %{buildroot}/%{php_ztsinidir}/zmq.ini
+
%check
-echo "n" | make test
+# Minimal load test
+%{_bindir}/php -n -d extension_dir=nts/modules -d extension=zmq.so -m | grep zmq
+%{_bindir}/zts-php -n -d extension_dir=zts/modules -d extension=zmq.so -m | grep zmq
+
+cd nts
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+make test
+
%files
-%doc README LICENSE
+%doc nts/{README,LICENSE}
%defattr(-,root,root,-)
-%{_libdir}/php/modules/zmq.so
-%config(noreplace) %{_sysconfdir}/php.d/zmq.ini
+%config(noreplace) %{php_inidir}/zmq.ini
+%config(noreplace) %{php_ztsinidir}/zmq.ini
+%{php_extdir}/zmq.so
+%{php_ztsextdir}/zmq.so
+
%changelog
+* Mon Nov 5 2012 Remi Collet <RPMS@FamilleCollet.com> - 0.6.0-7.20120613git516bd6f
+- Rebuilt against zeromq3 when available (fedora >= 17 and RHEL >= 6)
+- build ZTS extension
+
+* Mon Oct 22 2012 Ralph Bean <rbean@redhat.com> - 0.6.0-7.20120613git516bd6f
+- Rebuilt against zeromq3.
+
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-6.20120613git516bd6f
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.6.0-5.20120613git516bd6f
- Fixed the license field back to just "BSD". The files thought to be
PHP-licensed were in fact generated by "phpize" in the %%build section.