!1 package init
From: @wu-leilei Reviewed-by: @small_leek Signed-off-by: @small_leek
This commit is contained in:
commit
088c54e91f
158
php-pecl-zip.spec
Normal file
158
php-pecl-zip.spec
Normal file
@ -0,0 +1,158 @@
|
||||
%undefine _strict_symbol_defs_build
|
||||
|
||||
%global pecl_name zip
|
||||
%global with_zts 0%{?__ztsphp:1}
|
||||
%global ini_name 40-%{pecl_name}.ini
|
||||
|
||||
%global upstream_version 1.19.3
|
||||
|
||||
Summary: A ZIP archive management extension
|
||||
Summary(fr): Une extension de gestion des ZIP
|
||||
Name: php-pecl-zip
|
||||
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
|
||||
Release: 1
|
||||
License: PHP
|
||||
URL: https://pecl.php.net/package/zip
|
||||
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: php-devel
|
||||
BuildRequires: pkgconfig(libzip) >= 1.0.0
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: php-pear
|
||||
|
||||
Requires: php(zend-abi) = %{php_zend_api}
|
||||
Requires: php(api) = %{php_core_api}
|
||||
|
||||
Provides: php-pecl(%{pecl_name}) = %{version}
|
||||
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
|
||||
Provides: php-%{pecl_name} = %{version}-%{release}
|
||||
Provides: php-%{pecl_name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
|
||||
%description
|
||||
Zip is an extension to create and read zip files.
|
||||
|
||||
%description -l fr
|
||||
Zip est une extension pour créer et lire les archives au format ZIP.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -c -q
|
||||
mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
|
||||
|
||||
# Don't install/register tests
|
||||
sed -e 's/role="test"/role="src"/' \
|
||||
-e '/LICENSE/s/role="doc"/role="src"/' \
|
||||
-i package.xml
|
||||
|
||||
cd NTS
|
||||
# Sanity check, really often broken
|
||||
extver=$(sed -n '/#define PHP_ZIP_VERSION/{s/.* "//;s/".*$//;p}' php8/php_zip.h)
|
||||
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
|
||||
: Error: Upstream extension version is ${extver}, expecting %{upstream_version}%{?upstream_prever}.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
: Create the configuration file
|
||||
cat >%{ini_name} << 'EOF'
|
||||
; Enable ZIP extension module
|
||||
extension=%{pecl_name}.so
|
||||
EOF
|
||||
|
||||
%if %{with_zts}
|
||||
: Duplicate sources tree for ZTS build
|
||||
cp -pr NTS ZTS
|
||||
%endif
|
||||
|
||||
|
||||
%build
|
||||
cd NTS
|
||||
%{_bindir}/phpize
|
||||
%configure \
|
||||
--with-libzip \
|
||||
--with-libdir=%{_lib} \
|
||||
--with-php-config=%{_bindir}/php-config
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%if %{with_zts}
|
||||
cd ../ZTS
|
||||
%{_bindir}/zts-phpize
|
||||
%configure \
|
||||
--with-libzip \
|
||||
--with-libdir=%{_lib} \
|
||||
--with-php-config=%{_bindir}/zts-php-config
|
||||
|
||||
make %{?_smp_mflags}
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
make -C NTS install INSTALL_ROOT=%{buildroot}
|
||||
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
|
||||
|
||||
# Install XML package description
|
||||
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
|
||||
|
||||
%if %{with_zts}
|
||||
make -C ZTS install INSTALL_ROOT=%{buildroot}
|
||||
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
|
||||
%endif
|
||||
|
||||
# Documentation
|
||||
cd NTS
|
||||
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
|
||||
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
|
||||
done
|
||||
|
||||
|
||||
%check
|
||||
cd NTS
|
||||
: minimal load test of NTS extension
|
||||
%{_bindir}/php --no-php-ini \
|
||||
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
|
||||
--modules | grep %{pecl_name}
|
||||
|
||||
: upstream test suite for NTS extension
|
||||
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
|
||||
REPORT_EXIT_STATUS=1 \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=%{_bindir}/php \
|
||||
%{_bindir}/php -n run-tests.php --show-diff
|
||||
|
||||
%if %{with_zts}
|
||||
cd ../ZTS
|
||||
: minimal load test of ZTS extension
|
||||
%{_bindir}/zts-php --no-php-ini \
|
||||
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
|
||||
--modules | grep %{pecl_name}
|
||||
|
||||
: upstream test suite for ZTS extension
|
||||
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
|
||||
REPORT_EXIT_STATUS=1 \
|
||||
NO_INTERACTION=1 \
|
||||
TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \
|
||||
%{_bindir}/zts-php -n run-tests.php --show-diff
|
||||
%endif
|
||||
|
||||
|
||||
%files
|
||||
%license NTS/LICENSE
|
||||
%doc %{pecl_docdir}/%{pecl_name}
|
||||
%{pecl_xmldir}/%{name}.xml
|
||||
|
||||
%config(noreplace) %{php_inidir}/%{ini_name}
|
||||
%{php_extdir}/%{pecl_name}.so
|
||||
|
||||
%if %{with_zts}
|
||||
%config(noreplace) %{php_ztsinidir}/%{ini_name}
|
||||
%{php_ztsextdir}/%{pecl_name}.so
|
||||
%endif
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Sep 6 2021 wulei <wulei80@huawei.com> - 1.19.3-1
|
||||
- package init
|
||||
BIN
zip-1.19.3.tgz
Normal file
BIN
zip-1.19.3.tgz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user