Blame SPECS/rh-php70.spec

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