# remirepo spec file for php74 SCL metapackage # # Copyright (c) 2018-2023 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global scl_name_base xtreamcodes %global scl %{scl_name_base} %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_root_sysconfdir}/rpm; echo $d) %global install_scl 1 %if 0%{?fedora} >= 20 || 0%{?rhel} >= 8 %global rh_layout 1 %else %global nfsmountable 1 %endif %scl_package %scl # do not produce empty debuginfo package %global debug_package %{nil} Summary: Package that installs PHP 7.4 Name: %scl_name Version: 7.4 Release: 3%{?dist} License: GPL-2.0-or-later Source0: macros-build Source1: README Source2: LICENSE BuildRequires: scl-utils-build BuildRequires: help2man # Temporary work-around BuildRequires: iso-codes BuildRequires: environment-modules Requires: %{?scl_prefix}php Requires: %{?scl_name}-runtime%{?_isa} = %{version}-%{release} %description This is the main package for %scl Software Collection, that install PHP 7.4 language. %package runtime Summary: Package that handles %scl Software Collection. Requires: scl-utils Requires: environment-modules Requires(post): %{_root_sbindir}/semanage Requires(post): %{_root_sbindir}/selinuxenabled Provides: %{?scl_name}-runtime(%{scl_vendor}) Provides: %{?scl_name}-runtime(%{scl_vendor})%{?_isa} %description runtime Package shipping essential scripts to work with %scl Software Collection. %package build Summary: Package shipping basic build configuration Requires: scl-utils-build Requires: %{?scl_name}-runtime%{?_isa} = %{version}-%{release} %description build Package shipping essential configuration macros to build %scl Software Collection. %package scldevel Summary: Package shipping development files for %scl Requires: %{?scl_name}-runtime%{?_isa} = %{version}-%{release} Requires: %{?scl_name}-build%{?_isa} = %{version}-%{release} %description scldevel Package shipping development files, especially usefull for development of packages depending on %scl Software Collection. %prep %setup -c -T cat <README <<'EOF' %{expand:%(cat %{SOURCE1})} EOF # copy the license file so %%files section sees it cp %{SOURCE2} . : prefix in %{_prefix} : config in %{_sysconfdir} : data in %{_localstatedir} %build # generate a helper script that will be used by help2man cat >h2m_helper <<'EOF' #!/bin/bash [ "$1" == "--version" ] && echo "%{scl_name} Software Collection (PHP %{version})" || cat README EOF chmod a+x h2m_helper # generate the man page help2man -N --section 7 ./h2m_helper -o %{scl_name}.7 %install install -D -m 644 enable %{buildroot}%{_scl_scripts}/enable install -D -m 644 envmod %{buildroot}%{_root_datadir}/Modules/modulefiles/%{scl_name} install -D -m 644 scldev %{buildroot}%{macrosdir}/macros.%{scl_name_base}-scldevel install -D -m 644 %{scl_name}.7 %{buildroot}%{_root_mandir}/man7/%{scl_name}.7 install -d -m 755 %{buildroot}%{_datadir}/licenses install -d -m 755 %{buildroot}%{_datadir}/doc/pecl install -d -m 755 %{buildroot}%{_datadir}/tests/pecl install -d -m 755 %{buildroot}%{_localstatedir}/lib/pear/pkgxml %scl_install %if 0%{?rhel} == 7 mkdir -p %{buildroot}/opt/rh/xtreamcodes/ touch %{buildroot}/opt/rh/xtreamcodes/xtreamcodes %endif cat %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config # Add the scl_package_override macro sed -e 's/@SCL@/%{scl}/g;s:@PREFIX@:/opt/%{scl_vendor}:;s/@VENDOR@/%{scl_vendor}/' %{SOURCE0} \ | tee -a %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config # Move in correct location, if needed if [ "%{_root_sysconfdir}/rpm" != "%{macrosdir}" ]; then mv %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config \ %{buildroot}%{macrosdir}/macros.%{scl}-config fi %post runtime # Simple copy of context from system root to SCL root. semanage fcontext -a -e / %{?_scl_root} &>/dev/null || : semanage fcontext -a -e %{_root_sysconfdir} %{_sysconfdir} &>/dev/null || : semanage fcontext -a -e %{_root_localstatedir} %{_localstatedir} &>/dev/null || : selinuxenabled && load_policy || : restorecon -R %{?_scl_root} &>/dev/null || : restorecon -R %{_sysconfdir} &>/dev/null || : restorecon -R %{_localstatedir} &>/dev/null || : %{!?_licensedir:%global license %%doc} %files %if 0%{?fedora} < 19 && 0%{?rhel} < 7 %files runtime %else %files runtime -f filesystem %endif %license LICENSE %doc README %scl_files %{_root_mandir}/man7/%{scl_name}.* %{?_licensedir:%{_datadir}/licenses} %{_datadir}/tests %{_root_datadir}/Modules/modulefiles/%{scl_name} %files build %{macrosdir}/macros.%{scl}-config %files scldevel %{macrosdir}/macros.%{scl_name_base}-scldevel %changelog * Wed Apr 26 2023 Remi Collet 7.4-3 - redefine %%__phpize and %%__phpconfig * Thu Mar 9 2023 Remi Collet 7.4-2 - define %%scl_vendor and %%_scl_prefix in macros.php74-config - move man page out of scl tree - improve the man page * Tue Nov 9 2021 Remi Collet 7.4-1 - EL-9 build * Thu Apr 9 2020 Remi Collet 1.0-3 - add conflict between php73-syspaths and php74-syspaths * Thu Aug 22 2019 Remi Collet 1.0-2 - fix error: Macro %%undefine is a built-in see https://bugzilla.redhat.com/1744583 * Mon May 20 2019 Remi Collet 1.0-1 - initial package for 7.4 * Wed Feb 20 2019 Remi Collet 2.0-1 - add syspaths sub package providing system-wide wrappers * Thu Jan 17 2019 Remi Collet 1.0-2 - cleanup for EL-8 * Thu Aug 23 2018 Remi Collet 1.0-1 - scl-utils 2.0.2 drop modules support * Thu Jun 7 2018 Remi Collet 1.0-0.1 - initial packaging