# remirepo spec file for php-pecl-msgpack # with SCL compatibility, from: # # Fedora spec file for php-pecl-msgpack # # Copyright (c) 2012-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %{?scl:%scl_package php-pecl-msgpack} %global gh_commit 943d27267fbf6da6b4d225f344f4731aec0c671b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner msgpack %global gh_project msgpack-php %global pecl_name msgpack %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini %global upstream_version 3.0.0 %global upstream_prever RC1 %global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} %global _configure ../%{sources}/configure # to use system library %bcond_with msgpack # to disable test suite %bcond_without tests Summary: API for communicating with MessagePack serialization Name: %{?scl_prefix}php-pecl-msgpack License: BSD-3-Clause Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} URL: https://pecl.php.net/package/msgpack Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-pecl-apcu-devel %if %{with msgpack} BuildRequires: msgpack-devel %else Provides: bundled(msgpack) = 3.2.0 %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} 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} %description This extension provide API for communicating with MessagePack serialization. MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON but it's faster and smaller. For example, small integers (like flags or error code) are encoded into a single byte, and typical short strings only require an extra byte in addition to the strings themselves. If you ever wished to use JSON for convenience (storing an image with metadata) but could not for technical reasons (encoding, size, speed...), MessagePack is a perfect replacement. This extension is still EXPERIMENTAL. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %package devel Summary: MessagePack developer files (header) Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{?scl_prefix}php-devel%{?_isa} %description devel These are the files needed to compile programs using MessagePack serializer. %prep %setup -qc sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml cd %{sources} %if %{with msgpack} # use system library rm -rf msgpack %endif # Sanity check, really often broken extver=$(sed -n '/#define PHP_MSGPACK_VERSION/{s/.* "//;s/".*$//;p}' php_msgpack.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then : Error: Upstream extension version is ${extver}, expecting %{upstream_version}%{?upstream_prever}%{?gh_date:-dev}. exit 1 fi cd .. mkdir NTS %if %{with_zts} mkdir ZTS %endif # Drop in the bit of configuration cat > %{ini_name} << 'EOF' ; Enable MessagePack extension module extension = %{pecl_name}.so ; Configuration options ;msgpack.error_display = On ;msgpack.php_only = On ;msgpack.assoc = On ;msgpack.illegal_key_insert = Off ;msgpack.use_str8_serialization = On EOF %build %{?dtsenable} cd %{sources} %{__phpize} [ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS %configure --with-php-config=%{__phpconfig} %make_build %if %{with_zts} cd ../ZTS %configure --with-php-config=%{__ztsphpconfig} %make_build %endif %install %{?dtsenable} # Install the NTS stuff %make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} # Install the ZTS stuff %make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Install the package XML file install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # Test & Documentation cd %{sources} for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do [ -f tests/$i ] && install -Dpm 644 tests/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/tests/$i [ -f $i ] && install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i done 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 # Erratic results, segfauilt and mark as XFAIL rm */tests/034.phpt %ifarch aarch64 # too slow rm */tests/035.phpt %endif %if "%{php_version}" > "7.4" OPT="-q --show-diff %{?_smp_mflags}" %else OPT="-q --show-diff" %endif cd %{sources} : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with tests} : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=apcu.so -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php $OPT %endif %if %{with_zts} : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with tests} : Upstream test suite for ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="-n -d extension=apcu.so -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ %{__ztsphp} -n run-tests.php $OPT %endif %endif %files %license %{sources}/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 %files devel %doc %{pecl_testdir}/%{pecl_name} %{php_incldir}/ext/%{pecl_name} %if %{with_zts} %{php_ztsincldir}/ext/%{pecl_name} %endif %changelog * Tue Sep 24 2024 Remi Collet - 3.0.0~RC1-2 - rebuild for 8.4.0RC1 * Mon Aug 26 2024 Remi Collet - 3.0.0~RC1-1 - update to 3.0.0RC1 - drop patch merged upstream - add APCu support * Fri Jul 5 2024 Remi Collet - 2.2.0-3 - fix test suite with 8.4 using patch from https://github.com/msgpack/msgpack-php/pull/174 * Wed Aug 30 2023 Remi Collet - 2.2.0-2 - rebuild for PHP 8.3.0RC1 * Fri Jun 2 2023 Remi Collet - 2.2.0-1 - update to 2.2.0 - build out of sources tree - use parallel execution for test suite * Fri Oct 7 2022 Remi Collet - 2.2.0~RC2-1 - update to 2.2.0RC2 * Fri Sep 9 2022 Remi Collet - 2.2.0~RC1-8 - ignore 8 failed tests with PHP 8.2 * Thu Jul 28 2022 Remi Collet - 2.2.0~RC1-7 - skip one test on aarch64 * Mon Sep 6 2021 Remi Collet - 2.2.0~RC1-6 - F35 build * Wed Sep 01 2021 Remi Collet - 2.2.0~RC1-4 - rebuild for 8.1.0RC1 * Tue Aug 31 2021 Remi Collet - 2.2.0~RC1-1 - update to 2.2.0RC1 * Thu Jun 10 2021 Remi Collet - 2.1.2-3 - add patch for test suite with PHP 8.1 from https://github.com/msgpack/msgpack-php/pull/156 * Wed Apr 28 2021 Remi Collet - 2.1.2-2 - F34 rebuild for https://github.com/remicollet/remirepo/issues/174 * Sat Nov 28 2020 Remi Collet - 2.1.2-1 - update to 2.1.2 * Wed Sep 30 2020 Remi Collet - 2.1.1-3 - rebuild for PHP 8.0.0RC1 * Wed Sep 23 2020 Remi Collet - 2.1.1-2 - add upstream patches for PHP 8 * Tue Jul 28 2020 Remi Collet - 2.1.1-1 - update to 2.1.1 * Fri Feb 28 2020 Remi Collet - 2.1.0-1 - update to 2.1.0 * Fri Dec 20 2019 Remi Collet - 2.1.0~beta1-1 - update to 2.1.0beta1 * Fri Dec 20 2019 Remi Collet - 2.1.0~beta1-0 - test build for upcoming 2.1.0beta1 * Tue Sep 03 2019 Remi Collet - 2.0.3-3 - rebuild for 7.4.0RC1 * Wed May 29 2019 Remi Collet - 2.0.3-2 - rebuild * Thu Dec 20 2018 Remi Collet - 2.0.3-1 - update to 2.0.3 * Thu Aug 16 2018 Remi Collet - 2.0.3-0.3.20171026.943d272 - rebuild for 7.3.0beta2 new ABI * Tue Jul 17 2018 Remi Collet - 2.0.3-0.2.20171026.943d272 - rebuld for 7.3.0alpha4 new ABI * Wed Jun 27 2018 Remi Collet - 2.0.3-0.1.20171026.943d272 - update to 2.0.3-dev for PHP 7.3 with patches from https://github.com/msgpack/msgpack-php/pull/124 https://github.com/msgpack/msgpack-php/pull/127 - ignore test suite result for now * Tue Jul 18 2017 Remi Collet - 2.0.2-4 - rebuild for PHP 7.2.0beta1 new API * Wed Jun 21 2017 Remi Collet - 2.0.2-3 - rebuild for 7.2.0alpha2 * Fri Apr 14 2017 Remi Collet - 2.0.2-2 - add patch for test suite with PHP 7.2 from https://github.com/msgpack/msgpack-php/pull/118 * Wed Dec 7 2016 Remi Collet - 2.0.2-1 - update to 2.0.2 * Thu Dec 1 2016 Remi Collet - 2.0.1-5 - rebuild with PHP 7.1.0 GA * Wed Sep 14 2016 Remi Collet - 2.0.1-4 - rebuild for PHP 7.1 new API version * Sat Jul 23 2016 Remi Collet - 2.0.1-3 - ignore more tests with 7.1 * Sat Jun 11 2016 Remi Collet - 2.0.1-2 - add patch for PHP 7.1 open https://github.com/msgpack/msgpack-php/pull/87 * Tue Mar 1 2016 Remi Collet - 2.0.1-1 - update to 2.0.1 (php 7, beta) - use sources from pecl * Tue Oct 27 2015 Remi Collet - 2.0.0-1 - update to 2.0.0 (php 7, beta) * Wed Oct 14 2015 Remi Collet - 2.0.0-0.1.20151014git75991cf - new snapshot, version bump to 2.0.0dev * Tue Oct 13 2015 Remi Collet - 0.5.7-0.7.20151002git7a5bdb1 - rebuild for PHP 7.0.0RC5 new API version - new snapshot * Fri Sep 18 2015 Remi Collet - 0.5.7-0.6.20150702gitce27a10 - F23 rebuild with rh_layout * Wed Jul 22 2015 Remi Collet - 0.5.7-0.5.20150702gitce27a10 - rebuild against php 7.0.0beta2 * Wed Jul 8 2015 Remi Collet - 0.5.7-0.4.20150702gitce27a10 - new snapshot, rebuild against php 7.0.0beta1 * Wed Jun 24 2015 Remi Collet - 0.5.7-0.3.20150612git95c8dc3 - allow build against rh-php56 (as more-php56) - rebuild for "rh_layout" (php70) * Fri Jun 12 2015 Remi Collet - 0.5.7-0.1.20150612git95c8dc3 - update to 0.5.7dev for PHP 7 - sources from github * Mon Apr 27 2015 Remi Collet - 0.5.6-1 - Update to 0.5.6 - drop runtime dependency on pear, new scriptlets * Wed Dec 24 2014 Remi Collet - 0.5.5-8.1 - Fedora 21 SCL mass rebuild * Sun Aug 24 2014 Remi Collet - 0.5.5-8 - improve SCL stuff * Wed Apr 9 2014 Remi Collet - 0.5.5-7 - add numerical prefix to extension configuration file * Wed Mar 19 2014 Remi Collet - 0.5.5-6 - allow SCL build * Fri Feb 28 2014 Remi Collet - 0.5.5-5 - cleanups - move doc in pecl_docdir - move tests in pecl_testdir (devel) * Thu Jul 18 2013 Remi Collet - 0.5.5-4 - bump release * Thu Apr 18 2013 Remi Collet - 0.5.5-4 - ExcludeArch: ppc64 (as msgpack) * Tue Apr 2 2013 Remi Collet - 0.5.5-3 - use system msgpack library headers * Tue Mar 26 2013 Remi Collet - 0.5.5-2 - cleanups * Wed Feb 20 2013 Remi Collet - 0.5.5-1 - Update to 0.5.5 * Fri Nov 30 2012 Remi Collet - 0.5.3-1.1 - also provides php-msgpack * Thu Oct 18 2012 Remi Collet - 0.5.3-1 - update to 0.5.3 (beta) * Sat Sep 15 2012 Remi Collet - 0.5.2-1 - initial package, version 0.5.2 (beta)