f1484b2
%{!?php_inidir:  %global php_inidir   %{_sysconfdir}/php.d}
f1484b2
%{!?__pecl:      %global __pecl       %{_bindir}/pecl}
f1484b2
%{!?__php:       %global __php        %{_bindir}/php}
Paul Whalen 556809b
f1484b2
%global pecl_name gearman
f1484b2
%global with_zts  0%{?__ztsphp:1}
98dbc64
%if "%{php_version}" < "5.6"
98dbc64
%global ini_name  %{pecl_name}.ini
98dbc64
%else
98dbc64
%global ini_name  40-%{pecl_name}.ini
98dbc64
%endif
Paul Whalen 556809b
Paul Whalen 556809b
Name:		php-pecl-gearman
f1484b2
Version:	1.1.2
Remi Collet 9f026a8
Release:	4%{?dist}
Paul Whalen 556809b
Summary:	PHP wrapper to libgearman
Paul Whalen 556809b
Paul Whalen 556809b
Group:		Development/Tools
Paul Whalen 556809b
License:	PHP
Paul Whalen 556809b
URL:		http://gearman.org
b54c07c
Source0:	http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Paul Whalen 556809b
Remi Collet 5bede66
BuildRequires:	libgearman-devel > 1.1.0
e06d28f
BuildRequires:	php-devel
Paul Whalen 556809b
BuildRequires:	php-pear
Paul Whalen 556809b
# Required by phpize
e06d28f
BuildRequires:	autoconf, automake, libtool
Paul Whalen 556809b
Paul Whalen 556809b
Requires:	php(zend-abi) = %{php_zend_api}
Paul Whalen 556809b
Requires:	php(api) = %{php_core_api}
Remi Collet 9f026a8
%if 0%{?fedora} < 24
Paul Whalen 556809b
Requires(post): %{__pecl}
Paul Whalen 556809b
Requires(postun): %{__pecl}
Remi Collet 9f026a8
%endif
Paul Whalen 556809b
f1484b2
Provides:	php-%{pecl_name} = %{version}
f1484b2
Provides:	php-%{pecl_name}%{?_isa} = %{version}
e06d28f
Provides:	php-pecl(%{pecl_name}) = %{version}
f1484b2
Provides:	php-pecl(%{pecl_name})%{?_isa} = %{version}
b54c07c
f1484b2
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
f1484b2
# Filter shared private
f1484b2
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
b54c07c
%{?filter_setup}
f1484b2
%endif
b54c07c
Paul Whalen 556809b
Paul Whalen 556809b
%description
Paul Whalen 556809b
This extension uses libgearman library to provide API for
Paul Whalen 556809b
communicating with gearmand, and writing clients and workers
Paul Whalen 556809b
f1484b2
Documentation: http://php.net/gearman
f1484b2
f1484b2
Paul Whalen 556809b
%prep
b54c07c
%setup -q -c
b54c07c
f1484b2
# Dont register tests on install
f1484b2
sed -e 's/role="test"/role="src"/' -i package.xml
f1484b2
f1484b2
mv %{pecl_name}-%{version} NTS
f1484b2
b54c07c
# Upstream often forget to change this
f1484b2
extver=$(sed -n '/#define PHP_GEARMAN_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_gearman.h)
b54c07c
if test "x${extver}" != "x%{version}"; then
b54c07c
   : Error: Upstream version is ${extver}, expecting %{version}.
b54c07c
   exit 1
b54c07c
fi
b54c07c
98dbc64
cat >%{ini_name} <
b54c07c
; enable %{pecl_name} extension
b54c07c
extension=%{pecl_name}.so
b54c07c
EOF
b54c07c
f1484b2
%if %{with_zts}
f1484b2
cp -pr NTS ZTS
f1484b2
%endif
f1484b2
Paul Whalen 556809b
Paul Whalen 556809b
%build
f1484b2
cd NTS
f1484b2
%{_bindir}/phpize
f1484b2
%configure  --with-php-config=%{_bindir}/php-config
f1484b2
make %{?_smp_mflags}
f1484b2
f1484b2
%if %{with_zts}
f1484b2
cd ../ZTS
f1484b2
%{_bindir}/zts-phpize
f1484b2
%configure  --with-php-config=%{_bindir}/zts-php-config
Paul Whalen 556809b
make %{?_smp_mflags}
f1484b2
%endif
Paul Whalen 556809b
Paul Whalen 556809b
Paul Whalen 556809b
%install
f1484b2
make -C NTS install INSTALL_ROOT=%{buildroot}
b54c07c
Paul Whalen 556809b
# Install XML package description
b54c07c
install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
b54c07c
b54c07c
# install config file
98dbc64
install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
Paul Whalen 556809b
f1484b2
%if %{with_zts}
f1484b2
make -C ZTS install INSTALL_ROOT=%{buildroot}
f1484b2
install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
f1484b2
%endif
f1484b2
f1484b2
# Documentation
f1484b2
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
f1484b2
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
f1484b2
done
f1484b2
Paul Whalen 556809b
b54c07c
%check
f1484b2
: Minimal load test for NTS extension
f1484b2
%{__php} --no-php-ini \
f1484b2
    --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
f1484b2
    --modules | grep %{pecl_name}
b54c07c
f1484b2
%if %{with_zts}
f1484b2
: Minimal load test for ZTS extension
f1484b2
%{__ztsphp} --no-php-ini \
f1484b2
    --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
b54c07c
    --modules | grep %{pecl_name}
f1484b2
%endif
b54c07c
Paul Whalen 556809b
Remi Collet 9f026a8
%if 0%{?fedora} < 24
Paul Whalen 556809b
%post
Paul Whalen 556809b
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
Paul Whalen 556809b
Paul Whalen 556809b
%postun
Paul Whalen 556809b
if [ $1 -eq 0 ] ; then
Paul Whalen 556809b
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
Paul Whalen 556809b
fi
Remi Collet 9f026a8
%endif
f1484b2
Paul Whalen 556809b
Paul Whalen 556809b
%files
f1484b2
%{?_licensedir:%license NTS/LICENSE}
f1484b2
%doc %{pecl_docdir}/%{pecl_name}
Paul Whalen 556809b
%{pecl_xmldir}/%{name}.xml
Paul Whalen 556809b
f1484b2
%config(noreplace) %{php_inidir}/%{ini_name}
f1484b2
%{php_extdir}/%{pecl_name}.so
f1484b2
f1484b2
%if %{with_zts}
f1484b2
%{php_ztsextdir}/%{pecl_name}.so
f1484b2
%config(noreplace) %{php_ztsinidir}/%{ini_name}
f1484b2
%endif
Paul Whalen 556809b
Paul Whalen 556809b
Paul Whalen 556809b
%changelog
Remi Collet 9f026a8
* Wed Feb 10 2016 Remi Collet <remi@fedoraproject.org> - 1.1.2-4
Remi Collet 9f026a8
- F24: drop scriptlets (replaced by file triggers in php-pear)
Remi Collet 9f026a8
01862a5
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2-3
01862a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
01862a5
72fa151
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-2
72fa151
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
72fa151
f1484b2
* Tue Sep  9 2014 Remi Collet <remi@fedoraproject.org> - 1.1.2-1
f1484b2
- update to 1.1.2
f1484b2
- cleanup and modernize the spec file
f1484b2
- build ZTS extension
f1484b2
- install doc in pecl_docdir
f1484b2
ed9cccd
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-5
ed9cccd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
ed9cccd
98dbc64
* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 1.1.1-4
98dbc64
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
98dbc64
- add numerical prefix to extension configuration file
98dbc64
add3831
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-3
add3831
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
add3831
b533867
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-2
b533867
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
b533867
Remi Collet 5bede66
* Fri Mar 22 2013 Remi Collet <rcollet@redhat.com> - 1.1.1-1
Remi Collet 5bede66
- update to 1.1.1
Remi Collet 5bede66
- rebuild for http://fedoraproject.org/wiki/Features/Php55
Remi Collet 5bede66
c9be081
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
c9be081
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c9be081
aa3f140
* Fri Nov 30 2012 Tom Callaway <spot@fedoraproject.org> - 1.1.0-1
aa3f140
- update to 1.1.0
aa3f140
e06d28f
* Sat Aug 04 2012 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
e06d28f
- update to 1.0.2
e06d28f
- add BR on libgearman-1.0, workaround for https://bugzilla.redhat.com/819209
e06d28f
- add missing provides php-pecl(gearman)
e06d28f
3b63bb1
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
3b63bb1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3b63bb1
b54c07c
* Thu Jan 19 2012 Remi Collet <remi@fedoraproject.org> - 1.0.1-1
b54c07c
- update to 1.0.1 for php 5.4
b54c07c
- add %%check for php extension
b54c07c
- add filter to fix private-shared-object-provides
b54c07c
- use %%setup -c because package.xml is outside the tree
b54c07c
ccf5a7e
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-6
ccf5a7e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
ccf5a7e
Jesse Keating aec6071
* Fri Aug 12 2011 Jesse Keating <jkeating@redhat.com> - 0.7.0-5
Jesse Keating aec6071
- Rebuild for broken deps
Jesse Keating aec6071
Paul Whalen 556809b
* Mon Apr 11 2011 Paul Whalen <paul.whalen@senecac.on.ca> 0.7.0-4
Paul Whalen 556809b
- fix setup and package.xml install
Paul Whalen 556809b
Paul Whalen 556809b
* Mon Apr 11 2011 Paul Whalen <paul.whalen@senecac.on.ca> 0.7.0-3
Paul Whalen 556809b
- correct macros, add license to files
Paul Whalen 556809b
Paul Whalen 556809b
* Fri Apr 08 2011 Paul Whalen <paul.whalen@senecac.on.ca> 0.7.0-2
Paul Whalen 556809b
- correct package following pecl packaging guidelines
Paul Whalen 556809b
Paul Whalen 556809b
* Fri Mar 11 2011 Paul Whalen <paul.whalen@senecac.on.ca> 0.7.0-1
Paul Whalen 556809b
- Initial Packaging
Paul Whalen 556809b