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