# remirepo spec file for php-pggi # # Copyright (c) 2018-2019 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %{?scl: %scl_package php-pggi} %global gh_commit 031d42c22b4a346c87bad4bf84bc2a29ba67f7fe %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner Letargie %global gh_project pggi %global pecl_name pggi %global with_zts 0 Summary: GTK bindings Name: %{?scl_prefix}php-pggi Version: 0.4.1 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD Group: Development/Languages URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz BuildRequires: %{?dtsprefix}gcc BuildRequires: gtk3-devel BuildRequires: %{?scl_prefix}php-devel > 7 BuildRequires: %{?scl_prefix}php-pear Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-cli%{?_isa} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} %if "%{?scl_prefix}" != "%{?sub_prefix}" Provides: %{?scl_prefix}php-%{pecl_name} = %{version}-%{release} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}-%{release} %endif %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} Obsoletes: php70u-%{pecl_name} <= %{version} Obsoletes: php70w-%{pecl_name} <= %{version} %if "%{php_version}" > "7.1" Obsoletes: php71u-%{pecl_name} <= %{version} Obsoletes: php71w-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.2" Obsoletes: php72u-%{pecl_name} <= %{version} Obsoletes: php72w-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.3" Obsoletes: php73u-%{pecl_name} <= %{version} Obsoletes: php73w-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "7.4" Obsoletes: php74-%{pecl_name} <= %{version} Obsoletes: php74w-%{pecl_name} <= %{version} %endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 # Filter shared private %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} %endif %description PHP extension providing a small langage binding for GTK+ 3 toolkit allowing to write GUI Applications. This extension exposes the abstract syntax tree generated by PHP 7. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %prep %setup -qc mv %{gh_project}-%{gh_commit} NTS cd NTS # Sanity check, really often broken extver=$(sed -n '/#define PGGI_VERSION/{s/.* "//;s/".*$//;p}' src/pggi.h) if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}. exit 1 fi cd .. : Create launcher cat << 'EOF' | tee pggi #!/bin/sh exec %{__php} -d extension=pggi.so -d phar.readonly=0 "$@" EOF %if %{with_zts} cat << 'EOF' | tee zts-pggi #!/bin/sh exec %{__ztsphp} -d extension=pggi.so -d phar.readonly=0 "$@" EOF %endif %build %{?dtsenable} cd NTS %{_bindir}/phpize %configure \ --with-php-config=%{_bindir}/php-config \ --enable-pggi make %{?_smp_mflags} %if %{with_zts} cd ../ZTS %{_bindir}/zts-phpize %configure \ --with-php-config=%{_bindir}/zts-php-config \ --enable-pggi make %{?_smp_mflags} %endif %install %{?dtsenable} : Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} : Install the launcher install -D -m 755 pggi %{buildroot}%{_bindir}/pggi %if %{with_zts} : Install the ZTS stuff make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 755 zts-pggi %{buildroot}%{_bindir}/zts-pggi %endif %check cd NTS : Minimal load test for NTS extension %{__php} --no-php-ini \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %if %{with_zts} cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} %endif %files %{?_licensedir:%license NTS/LICENCE} %doc NTS/*md %doc NTS/examples %{php_extdir}/%{pecl_name}.so %{_bindir}/pggi %if %{with_zts} %{php_ztsextdir}/%{pecl_name}.so %{_bindir}/zts-pggi %endif %changelog * Wed Oct 9 2019 Remi Collet - 0.4.1-1 - update to 0.4.1 - drop patches merged upstream * Tue Oct 8 2019 Remi Collet - 0.4.0-1 - update to 0.4.0 - drop patches merged upstream - open https://github.com/Letargie/pggi/pull/14 fix various build warnings * Thu Aug 16 2018 Remi Collet - 0.3.0-4 - rebuild for 7.3.0beta2 new ABI * Wed Jul 18 2018 Remi Collet - 0.3.0-3 - rebuild for 7.3.0alpha4 new ABI * Mon Jun 18 2018 Remi Collet - 0.3.0-2 - rebuild with new sources * Mon Jun 11 2018 Remi Collet - 0.3.0-1 - new package, version 0.3.0 - open https://github.com/Letargie/pggi/pull/8 [-Wformat=] - open https://github.com/Letargie/pggi/pull/9 [-Wimplicit-function-declaration] - open https://github.com/Letargie/pggi/pull/11 [-Werror=format-security]