9b443d
# Fedora spec file for php-pecl-zip
9b443d
#
9b443d
# Copyright (c) 2013-2018 Remi Collet
9b443d
# License: CC-BY-SA
9b443d
# http://creativecommons.org/licenses/by-sa/4.0/
9b443d
#
9b443d
# Please, preserve the changelog entries
9b443d
#
9b443d
9b443d
# we don't want -z defs linker flag
9b443d
%undefine _strict_symbol_defs_build
9b443d
9b443d
%global pecl_name zip
9b443d
%global with_zts  0%{?__ztsphp:1}
9b443d
%global ini_name  40-%{pecl_name}.ini
9b443d
9b443d
Summary:      A ZIP archive management extension
9b443d
Summary(fr):  Une extension de gestion des ZIP
9b443d
Name:         php-pecl-zip
9b443d
Version:      1.15.3
9b443d
Release:      1%{?dist}
9b443d
License:      PHP
9b443d
Group:        Development/Languages
9b443d
URL:          http://pecl.php.net/package/zip
9b443d
9b443d
Source:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
9b443d
9b443d
BuildRequires: php-devel
9b443d
BuildRequires: pkgconfig(libzip) >= 1.0.0
9b443d
BuildRequires: zlib-devel
9b443d
BuildRequires: php-pear
9b443d
9b443d
Requires:     php(zend-abi) = %{php_zend_api}
9b443d
Requires:     php(api) = %{php_core_api}
9b443d
9b443d
Provides:     php-pecl(%{pecl_name}) = %{version}
9b443d
Provides:     php-pecl(%{pecl_name})%{?_isa} = %{version}
9b443d
Provides:     php-%{pecl_name} = %{version}-%{release}
9b443d
Provides:     php-%{pecl_name}%{?_isa} = %{version}-%{release}
9b443d
9b443d
9b443d
%description
9b443d
Zip is an extension to create and read zip files.
9b443d
9b443d
%description -l fr
9b443d
Zip est une extension pour créer et lire les archives au format ZIP.
9b443d
9b443d
9b443d
%prep 
9b443d
%setup -c -q
9b443d
9b443d
# Don't install/register tests
9b443d
sed -e 's/role="test"/role="src"/' \
9b443d
    -e '/LICENSE/s/role="doc"/role="src"/' \
9b443d
    -i package.xml
9b443d
9b443d
cd %{pecl_name}-%{version}
9b443d
# Sanity check, really often broken
9b443d
extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php5/php_zip.h)
9b443d
if test "x${extver}" != "x%{version}%{?prever}"; then
9b443d
   : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}.
9b443d
   exit 1
9b443d
fi
9b443d
9b443d
cd ..
9b443d
: Create the configuration file
9b443d
cat >%{ini_name} << 'EOF'
9b443d
; Enable ZIP extension module
9b443d
extension=%{pecl_name}.so
9b443d
EOF
9b443d
9b443d
%if %{with_zts}
9b443d
: Duplicate sources tree for ZTS build
9b443d
cp -pr %{pecl_name}-%{version} %{pecl_name}-zts
9b443d
%endif
9b443d
9b443d
9b443d
%build
9b443d
cd %{pecl_name}-%{version}
9b443d
%{_bindir}/phpize
9b443d
%configure \
9b443d
  --with-libzip \
9b443d
  --with-libdir=%{_lib} \
9b443d
  --with-php-config=%{_bindir}/php-config
9b443d
9b443d
make %{?_smp_mflags}
9b443d
9b443d
%if %{with_zts}
9b443d
cd ../%{pecl_name}-zts
9b443d
%{_bindir}/zts-phpize
9b443d
%configure \
9b443d
  --with-libzip \
9b443d
  --with-libdir=%{_lib} \
9b443d
  --with-php-config=%{_bindir}/zts-php-config
9b443d
9b443d
make %{?_smp_mflags}
9b443d
%endif
9b443d
9b443d
9b443d
%install
9b443d
make -C %{pecl_name}-%{version} install INSTALL_ROOT=%{buildroot}
9b443d
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
9b443d
9b443d
# Install XML package description
9b443d
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
9b443d
9b443d
%if %{with_zts}
9b443d
make -C %{pecl_name}-zts install INSTALL_ROOT=%{buildroot}
9b443d
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
9b443d
%endif
9b443d
9b443d
# Documentation
9b443d
cd %{pecl_name}-%{version}
9b443d
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
9b443d
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
9b443d
done
9b443d
9b443d
9b443d
%check
9b443d
cd %{pecl_name}-%{version}
9b443d
: minimal load test of NTS extension
9b443d
%{_bindir}/php --no-php-ini \
9b443d
    --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
9b443d
    --modules | grep %{pecl_name}
9b443d
9b443d
: upstream test suite for NTS extension
9b443d
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
9b443d
REPORT_EXIT_STATUS=1 \
9b443d
NO_INTERACTION=1 \
9b443d
TEST_PHP_EXECUTABLE=%{_bindir}/php \
9b443d
%{_bindir}/php -n run-tests.php
9b443d
9b443d
%if %{with_zts}
9b443d
cd ../%{pecl_name}-zts
9b443d
: minimal load test of ZTS extension
9b443d
%{_bindir}/zts-php --no-php-ini \
9b443d
    --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
9b443d
    --modules | grep %{pecl_name}
9b443d
9b443d
: upstream test suite for ZTS extension
9b443d
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
9b443d
REPORT_EXIT_STATUS=1 \
9b443d
NO_INTERACTION=1 \
9b443d
TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \
9b443d
%{_bindir}/zts-php -n run-tests.php
9b443d
%endif
9b443d
9b443d
9b443d
%files
9b443d
%license %{pecl_name}-%{version}/LICENSE
9b443d
%doc %{pecl_docdir}/%{pecl_name}
9b443d
%{pecl_xmldir}/%{name}.xml
9b443d
9b443d
%config(noreplace) %{php_inidir}/%{ini_name}
9b443d
%{php_extdir}/%{pecl_name}.so
9b443d
9b443d
%if %{with_zts}
9b443d
%config(noreplace) %{php_ztsinidir}/%{ini_name}
9b443d
%{php_ztsextdir}/%{pecl_name}.so
9b443d
%endif
9b443d
9b443d
9b443d
%changelog
9b443d
* Tue Jun 12 2018 Remi Collet <remi@remirepo.net> - 1.15.3-1
9b443d
- Update to 1.15.3
9b443d
9b443d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.2-3
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
9b443d
9b443d
* Fri Jan 26 2018 Remi Collet <remi@remirepo.net> - 1.15.2-2
9b443d
- undefine _strict_symbol_defs_build
9b443d
9b443d
* Tue Dec 19 2017 Remi Collet <remi@fedoraproject.org> - 1.15.2-1
9b443d
- Update to 1.15.2
9b443d
9b443d
* Tue Oct 03 2017 Remi Collet <remi@fedoraproject.org> - 1.15.1-4
9b443d
- rebuild for https://fedoraproject.org/wiki/Changes/php72
9b443d
9b443d
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-3
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
9b443d
9b443d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-2
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9b443d
9b443d
* Tue Jul 11 2017 Remi Collet <remi@remirepo.net> - 1.15.1-1
9b443d
- Update to 1.15.1
9b443d
9b443d
* Mon Jul 10 2017 Remi Collet <remi@remirepo.net> - 1.15.0-1
9b443d
- Update to 1.15.0
9b443d
9b443d
* Wed Apr  5 2017 Remi Collet <remi@remirepo.net> - 1.14.0-1
9b443d
- Update to 1.14.0
9b443d
9b443d
* Tue Feb 28 2017 Remi Collet <remi@fedoraproject.org> - 1.13.5-4
9b443d
- rebuild for new libzip
9b443d
9b443d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.5-3
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9b443d
9b443d
* Mon Nov 14 2016 Remi Collet <remi@fedoraproject.org> - 1.13.5-2
9b443d
- rebuild for https://fedoraproject.org/wiki/Changes/php71
9b443d
9b443d
* Fri Oct 14 2016 Remi Collet <remi@fedoraproject.org> - 1.13.5-1
9b443d
- Update to 1.13.5
9b443d
9b443d
* Thu Jul 21 2016 Remi Collet <remi@fedoraproject.org> - 1.13.4-1
9b443d
- Update to 1.13.4
9b443d
9b443d
* Mon Jun 27 2016 Remi Collet <remi@fedoraproject.org> - 1.13.3-2
9b443d
- rebuild for https://fedoraproject.org/wiki/Changes/php70
9b443d
9b443d
* Thu Jun 23 2016 Remi Collet <remi@fedoraproject.org> - 1.13.3-1
9b443d
- Update to 1.13.3
9b443d
9b443d
* Tue Mar  1 2016 Remi Collet <remi@fedoraproject.org> - 1.13.2-1
9b443d
- Update to 1.13.2
9b443d
- fix license management
9b443d
9b443d
* Wed Feb 10 2016 Remi Collet <remi@fedoraproject.org> - 1.13.1-3
9b443d
- drop scriptlets (replaced file triggers in php-pear)
9b443d
- ignore 1 test (change in php, FTBFS detected by Koschei)
9b443d
9b443d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.1-2
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9b443d
9b443d
* Thu Sep 10 2015 Remi Collet <remi@fedoraproject.org> - 1.13.1-1
9b443d
- Update to 1.13.1 (no change)
9b443d
9b443d
* Mon Sep  7 2015 Remi Collet <remi@fedoraproject.org> - 1.13.0-1
9b443d
- Update to 1.13.0
9b443d
- raise dependency on libzip 1.0.0
9b443d
- don't install/register tests
9b443d
9b443d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.5-3
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9b443d
9b443d
* Wed May 06 2015 Remi Collet <remi@fedoraproject.org> - 1.12.5-2
9b443d
- rebuild for new libzip
9b443d
9b443d
* Thu Apr 16 2015 Remi Collet <remi@fedoraproject.org> - 1.12.5-1
9b443d
- Update to 1.12.5 (stable)
9b443d
9b443d
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.4-5
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
9b443d
9b443d
* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 1.12.4-4
9b443d
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
9b443d
9b443d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.4-3
9b443d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9b443d
9b443d
* Thu Apr 24 2014 Remi Collet <rcollet@redhat.com> - 1.12.4-2
9b443d
- add numerical prefix to extension configuration file
9b443d
9b443d
* Wed Jan 29 2014 Remi Collet <remi@fedoraproject.org> - 1.12.4-1
9b443d
- Update to 1.12.4 (stable) for libzip 0.11.2
9b443d
9b443d
* Thu Dec 12 2013 Remi Collet <remi@fedoraproject.org> - 1.12.3-1
9b443d
- Update to 1.12.3 (stable)
9b443d
- drop merged patch
9b443d
9b443d
* Thu Oct 24 2013 Remi Collet <remi@fedoraproject.org> 1.12.2-2
9b443d
- upstream patch, don't use any libzip private struct
9b443d
- drop LICENSE_libzip when system version is used
9b443d
- always build ZTS extension
9b443d
9b443d
* Wed Oct 23 2013 Remi Collet <remi@fedoraproject.org> 1.12.2-1
9b443d
- update to 1.12.2 (beta)
9b443d
- drop merged patches
9b443d
- install doc in pecl doc_dir
9b443d
- install tests in pecl test_dir
9b443d
9b443d
* Thu Aug 22 2013 Remi Collet <rcollet@redhat.com> 1.12.1-5
9b443d
- really really fix all spurious-executable-perm
9b443d
9b443d
* Thu Aug 22 2013 Remi Collet <rcollet@redhat.com> 1.12.1-4
9b443d
- really fix all spurious-executable-perm
9b443d
9b443d
* Thu Aug 22 2013 Remi Collet <rcollet@redhat.com> 1.12.1-3
9b443d
- fixes from review comments #999313: clarify License
9b443d
- drop execution right from sources
9b443d
- BR libzip-devel always needed
9b443d
9b443d
* Tue Aug 20 2013 Remi Collet <rcollet@redhat.com> 1.12.1-2
9b443d
- refresh our merged patches from upstream git
9b443d
9b443d
* Thu Aug 08 2013 Remi Collet <rcollet@redhat.com> 1.12.1-1
9b443d
- New spec for version 1.12.1 (beta)