Blame SPECS/rh-php71.spec

332bc8
%{!?scl_vendor: %global scl_vendor rh}
332bc8
%global scl_name_base    php
332bc8
%global scl_name_version 71
332bc8
%global scl              %{scl_vendor}-%{scl_name_base}%{scl_name_version}
332bc8
%global macrosdir        %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_root_sysconfdir}/rpm; echo $d)
332bc8
%global install_scl      1
332bc8
%global nfsmountable     1
332bc8
332bc8
%scl_package %scl
332bc8
332bc8
# do not produce empty debuginfo package
332bc8
%global debug_package %{nil}
332bc8
332bc8
Summary:       Package that installs PHP 7.1
332bc8
Name:          %scl_name
332bc8
Version:       1
332bc8
Release:       1%{?dist}
332bc8
Group:         Development/Languages
332bc8
License:       GPLv2+
332bc8
332bc8
Source0:       macros-build
332bc8
Source1:       README
332bc8
Source2:       LICENSE
332bc8
Source3:       register
332bc8
Source4:       deregister
332bc8
Source5:       50-copy-files
332bc8
Source6:       50-clean-files
332bc8
332bc8
BuildRequires: scl-utils-build
332bc8
BuildRequires: help2man
332bc8
# Temporary work-around
332bc8
BuildRequires: iso-codes
332bc8
332bc8
Requires:      %{?scl_prefix}php-common%{?_isa}
332bc8
Requires:      %{?scl_prefix}php-cli%{?_isa}
332bc8
Requires:      %{?scl_prefix}php-pear
332bc8
Requires:      %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
332bc8
332bc8
%description
332bc8
This is the main package for %scl Software Collection,
332bc8
that install PHP 7.1 language.
332bc8
332bc8
332bc8
%package runtime
332bc8
Summary:   Package that handles %scl Software Collection.
332bc8
Group:     Development/Languages
332bc8
Requires:  scl-utils
332bc8
Requires(post): policycoreutils-python libselinux-utils
332bc8
332bc8
%description runtime
332bc8
Package shipping essential scripts to work with %scl Software Collection.
332bc8
332bc8
332bc8
%package build
332bc8
Summary:   Package shipping basic build configuration
332bc8
Group:     Development/Languages
332bc8
Requires:  scl-utils-build
332bc8
Requires:  %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
332bc8
332bc8
%description build
332bc8
Package shipping essential configuration macros
332bc8
to build %scl Software Collection.
332bc8
332bc8
332bc8
%package scldevel
332bc8
Summary:   Package shipping development files for %scl
332bc8
Group:     Development/Languages
332bc8
Requires:  %{?scl_name}-runtime%{?_isa} = %{version}-%{release}
332bc8
332bc8
%description scldevel
332bc8
Package shipping development files, especially usefull for development of
332bc8
packages depending on %scl Software Collection.
332bc8
332bc8
332bc8
%prep
332bc8
%setup -c -T
332bc8
332bc8
cat <
332bc8
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
332bc8
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
332bc8
export MANPATH=%{_mandir}:\${MANPATH}
332bc8
EOF
332bc8
332bc8
# generate rpm macros file for depended collections
332bc8
cat << EOF | tee scldev
332bc8
%%scl_%{scl_name_base}         %{scl}
332bc8
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
332bc8
EOF
332bc8
332bc8
# This section generates README file from a template and creates man page
332bc8
# from that file, expanding RPM macros in the template file.
332bc8
cat >README <<'EOF'
332bc8
%{expand:%(cat %{SOURCE1})}
332bc8
EOF
332bc8
332bc8
# copy additional files
332bc8
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} .
332bc8
332bc8
332bc8
%build
332bc8
# generate a helper script that will be used by help2man
332bc8
cat >h2m_helper <<'EOF'
332bc8
#!/bin/bash
332bc8
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
332bc8
EOF
332bc8
chmod a+x h2m_helper
332bc8
332bc8
# generate the man page
332bc8
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
332bc8
# Fix single quotes in man page. See RHBZ#1219527
332bc8
#
332bc8
# http://lists.gnu.org/archive/html/groff/2008-06/msg00001.html suggests that
332bc8
# using "'" for quotes is correct, but the current implementation of man in 6
332bc8
# mangles it when rendering.
332bc8
sed -i "s/'/\\\\(aq/g" %{scl_name}.7
332bc8
 
332bc8
332bc8
%install
332bc8
install -D -m 644 enable         %{buildroot}%{_scl_scripts}/enable
332bc8
install -D -m 644 register       %{buildroot}%{_scl_scripts}/register
332bc8
install -d -m 755                %{buildroot}%{_scl_scripts}/register.content
332bc8
install -D -m 644 50-copy-files  %{buildroot}%{_scl_scripts}/register.d/50-copy-files
332bc8
install -D -m 644 deregister     %{buildroot}%{_scl_scripts}/deregister
332bc8
install -D -m 644 50-clean-files %{buildroot}%{_scl_scripts}/deregister.d/50-clean-files
332bc8
sed -e 's:@SCLDIR@:%{_scl_scripts}:' \
332bc8
    -i %{buildroot}%{_scl_scripts}/*gister
332bc8
332bc8
install -D -m 644 scldev %{buildroot}%{macrosdir}/macros.%{scl_name_base}-scldevel
332bc8
install -D -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
332bc8
332bc8
install -d -m 755 %{buildroot}%{_datadir}/licenses
332bc8
install -d -m 755 %{buildroot}%{_datadir}/doc/pecl
332bc8
install -d -m 755 %{buildroot}%{_datadir}/tests/pecl
332bc8
install -d -m 755 %{buildroot}%{_scl_root}/var/lib/pear/pkgxml
332bc8
332bc8
%scl_install
332bc8
332bc8
# Add the scl_package_override macro
332bc8
sed -e 's/@SCL@/%{scl_name_base}%{scl_name_version}/g' \
332bc8
    -e 's/@VENDOR@/%{scl_vendor}/' \
332bc8
    %{SOURCE0} \
332bc8
  | tee -a %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
332bc8
332bc8
# Move in correct location, if needed
332bc8
if [ "%{_root_sysconfdir}/rpm" != "%{macrosdir}" ]; then
332bc8
  mv  %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config \
332bc8
      %{buildroot}%{macrosdir}/macros.%{scl}-config
332bc8
fi
332bc8
332bc8
332bc8
%post runtime
332bc8
# Simple copy of context from system root to SCL root.
332bc8
semanage fcontext -a -e /                      %{?_scl_root}     &>/dev/null || :
332bc8
semanage fcontext -a -e %{_root_sysconfdir}    %{_sysconfdir}    &>/dev/null || :
332bc8
semanage fcontext -a -e %{_root_localstatedir} %{_localstatedir} &>/dev/null || :
332bc8
selinuxenabled && load_policy || :
332bc8
restorecon -R %{?_scl_root}     &>/dev/null || :
332bc8
restorecon -R %{_sysconfdir}    &>/dev/null || :
332bc8
restorecon -R %{_localstatedir} &>/dev/null || :
332bc8
332bc8
332bc8
%files
332bc8
332bc8
332bc8
%{!?_licensedir:%global license %%doc}
332bc8
332bc8
%if 0%{?fedora} < 19 && 0%{?rhel} < 7
332bc8
%files runtime
332bc8
%else
332bc8
%files runtime -f filesystem
332bc8
%endif
332bc8
%license LICENSE
332bc8
%doc README
332bc8
%scl_files
332bc8
%{_scl_scripts}/register
332bc8
%{_scl_scripts}/register.d/
332bc8
%{_scl_scripts}/register.content/
332bc8
%{_scl_scripts}/deregister
332bc8
%{_scl_scripts}/deregister.d/
332bc8
%{?_licensedir:%{_datadir}/licenses}
332bc8
%{_datadir}/tests
332bc8
%{_scl_root}/var
332bc8
332bc8
332bc8
%files build
332bc8
%{macrosdir}/macros.%{scl}-config
332bc8
332bc8
332bc8
%files scldevel
332bc8
%{macrosdir}/macros.%{scl_name_base}-scldevel
332bc8
332bc8
332bc8
%changelog
332bc8
* Thu Jun  1 2017 Remi Collet <rcollet@redhat.com> 1-1
332bc8
- initial package for rh-php71 in RHSCL-3.0
332bc8
332bc8
* Thu Jul 21 2016 Remi Collet <rcollet@redhat.com> 2.3-1
332bc8
- initial package for rh-php70 in RHSCL-2.3
332bc8
332bc8
* Mon Mar 16 2015 Remi Collet <rcollet@redhat.com> 2.0-6
332bc8
- rebuild to remove scls directory #1200056
332bc8
- fix incorrect selinux contexts #1194337
332bc8
332bc8
* Wed Jan 28 2015 Remi Collet <rcollet@redhat.com> 2.0-5
332bc8
- own licenses and tests directory
332bc8
332bc8
* Mon Jan 26 2015 Remi Collet <rcollet@redhat.com> 2.0-4
332bc8
- silent rmdir in deregister script
332bc8
332bc8
* Mon Jan 26 2015 Remi Collet <rcollet@redhat.com> 2.0-3
332bc8
- add register and deregister scripts
332bc8
332bc8
* Wed Jan 14 2015 Remi Collet <rcollet@redhat.com> 2.0-2
332bc8
- drop scl_vendor prefix from macro
332bc8
332bc8
* Tue Jan 13 2015 Remi Collet <rcollet@redhat.com> 2.0-1
332bc8
- initial package for rh-php56 in RHSCL-2.0
332bc8
332bc8
* Wed Nov 26 2014 Remi Collet <remi@fedoraproject.org> 2.0-2
332bc8
- add LD_LIBRARY_PATH in enable script for embedded
332bc8
332bc8
* Mon Sep  8 2014 Remi Collet <remi@fedoraproject.org> 2.0-1
332bc8
- provides php56-runtime(remi)
332bc8
- add _sclreq macro
332bc8
332bc8
* Sun Aug 24 2014 Remi Collet <rcollet@redhat.com> 1.0-1
332bc8
- initial packaging from php55 from rhscl 1.1
332bc8
- install macro in /usr/lib/rpm/macros.d
332bc8
- each package requires runtime (for license)
332bc8
332bc8
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-7
332bc8
- Fix path typo in README
332bc8
  Related: #1061455
332bc8
332bc8
* Mon Mar 24 2014 Remi Collet <rcollet@redhat.com> 1.1-6
332bc8
- own locale and man directories, #1074337
332bc8
332bc8
* Wed Feb 12 2014 Remi Collet <rcollet@redhat.com> 1.1-5
332bc8
- avoid empty debuginfo subpackage
332bc8
- add LICENSE, README and php55.7 man page #1061455
332bc8
- add scldevel subpackage #1063357
332bc8
332bc8
* Mon Jan 20 2014 Remi Collet <rcollet@redhat.com> 1.1-4
332bc8
- rebuild with latest scl-utils #1054731
332bc8
332bc8
* Tue Nov 19 2013 Remi Collet <rcollet@redhat.com> 1.1-2
332bc8
- fix scl_package_override
332bc8
332bc8
* Tue Nov 19 2013 Remi Collet <rcollet@redhat.com> 1.1-1
332bc8
- build for RHSCL 1.1
332bc8
332bc8
* Tue Sep 17 2013 Remi Collet <rcollet@redhat.com> 1-1.5
332bc8
- add macros.php55-build for scl_package_override
332bc8
332bc8
* Fri Aug  2 2013 Remi Collet <rcollet@redhat.com> 1-1
332bc8
- initial packaging