diff options
Diffstat (limited to 'php-pecl-selinux.spec')
-rw-r--r-- | php-pecl-selinux.spec | 99 |
1 files changed, 32 insertions, 67 deletions
diff --git a/php-pecl-selinux.spec b/php-pecl-selinux.spec index e0e7565..0c67c27 100644 --- a/php-pecl-selinux.spec +++ b/php-pecl-selinux.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-pecl-selinux # adapted for SCL # -# Copyright (c) 2011-2023 Remi Collet +# Copyright (c) 2011-2024 Remi Collet # # Fedora spec file for php-pecl-selinux # @@ -13,29 +13,23 @@ # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build +%{?scl:%scl_package php-pecl-selinux} -%if 0%{?scl:1} -%scl_package php-pecl-selinux -%endif +%bcond_without tests %global pecl_name selinux %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%global with_tests 0%{!?_without_tests:1} -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif +%global sources %{pecl_name}-%{version} +%global _configure ../%{sources}/configure Summary: SELinux binding for PHP scripting language Name: %{?scl_prefix}php-pecl-selinux -Version: 0.6.0 -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 0.6.1 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -52,19 +46,6 @@ 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} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -# Other third party repo stuff -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.1" -Obsoletes: php81-pecl-%{pecl_name} <= %{version} -%endif -%endif - %description This package is an extension to the PHP Hypertext Preprocessor. @@ -79,14 +60,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -c -q -mv %{pecl_name}-%{version} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ - %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -i package.xml -pushd NTS +pushd %{sources} extver=$(sed -n '/#define PHP_SELINUX_VERSION/{s/.* "//;s/".*$//;p}' php_selinux.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. @@ -100,29 +80,32 @@ cat > %{ini_name} << 'EOF' extension=%{pecl_name}.so EOF +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif %build %{?dtsenable} -cd NTS -%{_bindir}/phpize +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=%{_bindir}/php-config \ + --with-php-config=%{__phpconfig} \ --enable-selinux -make %{?_smp_mflags} +%make_build %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize %configure \ - --with-php-config=%{_bindir}/zts-php-config \ + --with-php-config=%{__ztsphpconfig} \ --enable-selinux -make %{?_smp_mflags} +%make_build %endif @@ -130,7 +113,7 @@ make %{?_smp_mflags} %{?dtsenable} # Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # Drop in the bit of configuration install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -140,12 +123,12 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} # Install the ZTS stuff -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif # Documentation -cd NTS +cd %{sources} 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 @@ -157,11 +140,11 @@ done --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' -%if %{with_tests} -cd NTS +%if %{with tests} +cd %{sources} : Upstream test suite for NTS extension TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=0 \ %{__php} -n run-tests.php -q --show-diff : Ignore result as unreliable in mock @@ -175,29 +158,8 @@ REPORT_EXIT_STATUS=0 \ %endif - -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %files -%{?_licensedir:%license NTS/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -211,6 +173,9 @@ fi %changelog +* Tue Oct 8 2024 Remi Collet <remi@remirepo.net> - 0.6.1-1 +- update to 0.6.1 + * Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 0.6.0-3 - rebuild for PHP 8.3.0RC1 |