From 2a3da241f94673ebed8ccca4c0e2da75c8da8da7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 23 Apr 2026 10:58:14 +0200 Subject: drop pear/pecl dependency sources from github --- composer.json | 18 +++++++++ makesrc.sh | 30 ++++++++++++++ php-pecl-xlswriter.spec | 101 ++++++++++++++++++------------------------------ 3 files changed, 86 insertions(+), 63 deletions(-) create mode 100644 composer.json create mode 100755 makesrc.sh diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..faeb352 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name": "viest/xlswriter", + "type": "php-ext", + "license": "BSD-2-Clause", + "description": "xlswriter is a PHP C Extension that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.", + "require": { + "php": ">= 7.0" + }, + "php-ext": { + "extension-name": "xlswriter", + "configure-options": [ + { + "name": "enable-reader", + "description": "Enable reader support" + } + ] + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..dfadee6 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +NAME=$(basename $PWD) +OWNER=$(sed -n '/^%global gh_vend/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_proj/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version/{s/.* //;p}' $NAME.spec) + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + +if [ -f $PROJECT-$VERSION.tgz ]; then + echo $PROJECT-$VERSION.tgz already present + exit 1 +fi + +echo "Cloning..." +rm -rf $PROJECT-$VERSION +git clone --recursive https://github.com/$OWNER/$PROJECT.git -b v$VERSION $PROJECT-$VERSION + +echo "Composer..." +pushd $PROJECT-$VERSION + cp composer.json .. +popd + +echo "Archiving..." +tar czf $PROJECT-$VERSION.tgz --exclude-vcs $PROJECT-$VERSION + +echo "Cleaning..." +rm -rf $PROJECT-$VERSION + +echo "Done." diff --git a/php-pecl-xlswriter.spec b/php-pecl-xlswriter.spec index 0267f7c..4e5520c 100644 --- a/php-pecl-xlswriter.spec +++ b/php-pecl-xlswriter.spec @@ -1,63 +1,60 @@ # remirepo spec file for php-pecl-xlswriter # -# Copyright (c) 2018-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2018-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -%bcond_with syslib %bcond_without tests %{?scl:%scl_package php-pecl-xlswriter} -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name xlswriter +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini -%global sources %{pecl_name}-%{version} -%global _configure ../%{sources}/configure +%global _configure ../configure +# Github forge +%global gh_vend viest +%global gh_proj php-ext-xlswriter +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +# PIE +%global pie_vend %{gh_vend} +%global pie_proj %{pecl_name} -%if %{with syslib} -# No soname, so manage dependency on available version -%global libxlsxwriter_version 1.0.0 -%global libxlsxio_version 0.2.29 -%endif -Summary: An efficient and fast xlsx file extension Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 1.5.8 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Summary: An efficient and fast xlsx file extension License: BSD-2-Clause -URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Version: 1.5.8 +Release: 2%{?dist} +%forgemeta +URL: %{forgeurl} +# use makesrc.sh to create a recursive snapshot +Source0: %{gh_proj}-%{version}.tgz +Source1: makesrc.sh BuildRequires: %{?dtsprefix}gcc BuildRequires: make BuildRequires: %{?scl_prefix}php-devel >= 7.0 -BuildRequires: %{?scl_prefix}php-pear -%if %{with syslib} -BuildRequires: libxlsxwriter-devel >= %{libxlsxwriter_version} -BuildRequires: libxlsxio-devel >= %{libxlsxio_version} -BuildRequires: zlib-devel -%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%if %{with syslib} -Requires: libxlsxwriter%{?_isa} >= %{libxlsxwriter_version} -Requires: libxlsxio%{?_isa} >= %{libxlsxio_version} -%else # see library/libxlsxwriter/include/xlsxwriter.h Provides: bundled(libxlsxwriter) = 1.1.3 # see library/libxlsxio/include/xlsxio_version.h Provides: bundled(libxlsxio) = 0.2.27 -%endif -Provides: %{?scl_prefix}php-%{pecl_name} = %{version} -Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# Extension +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +# PECL +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -91,18 +88,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep -%setup -q -c -# Don't install tests -sed -e 's/role="test"/role="src"/' \ - -e '/LICENSE/s/role="doc"/role="src"/' \ - -e '/name="library/d' \ - -i package.xml - -pushd %{sources} -%if %{with syslib} -# we use the system libraries -rm -r library -%endif +%forgesetup # Sanity check, really often broken extver=$(sed -n '/#define PHP_XLSWRITER_VERSION/{s/.* "//;s/".*$//;p}' php_xlswriter.h) @@ -110,7 +96,6 @@ if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}. exit 1 fi -popd mkdir NTS %if %{with_zts} @@ -132,22 +117,17 @@ peclbuild() { %configure \ --without-openssl \ --with-xlswriter \ -%if %{with syslib} - --with-libxlsxwriter=%{_prefix} \ - --with-libxlsxio=%{_prefix} \ -%endif --enable-reader \ --with-php-config=$1 %make_build } -cd %{sources} %{__phpize} [ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL -cd ../NTS +cd NTS peclbuild %{__phpconfig} %if %{with_zts} @@ -164,20 +144,12 @@ peclbuild %{__ztsphpconfig} # install config file 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_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif -# Documentation -for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i -done - %check OPT="-q -P --show-diff" @@ -185,7 +157,6 @@ OPT="-q -P --show-diff" OPT="$OPT %{?_smp_mflags}" %endif -cd %{sources} : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ @@ -215,9 +186,9 @@ cd .. %files -%license %{sources}/LICENSE -%doc %{pecl_docdir}/%{pecl_name} -%{pecl_xmldir}/%{name}.xml +%license LICENSE +%doc CREDITS +%doc *.md %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -229,6 +200,10 @@ cd .. %changelog +* Thu Apr 23 2026 Remi Collet - 1.5.8-2 +- drop pear/pecl dependency +- sources from github + * Tue Nov 12 2024 Remi Collet - 1.5.8-1 - update to 1.5.8 - drop patch merged upstream -- cgit