Blame SPECS/php55.spec

a6d9c8
%global scl_name_base    php
a6d9c8
%global scl_name_version 55
a6d9c8
%global scl              %{scl_name_base}%{scl_name_version}
a6d9c8
%scl_package %scl
a6d9c8
a6d9c8
# do not produce empty debuginfo package
a6d9c8
%global debug_package %{nil}
a6d9c8
a6d9c8
Summary:       Package that installs PHP 5.5
a6d9c8
Name:          %scl_name
22a395
Version:       2.0
22a395
Release:       1%{?dist}
a6d9c8
Group:         Development/Languages
a6d9c8
License:       GPLv2+
a6d9c8
a6d9c8
Source0:       macros-build
a6d9c8
Source1:       README
a6d9c8
Source2:       LICENSE
a6d9c8
a6d9c8
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
a6d9c8
BuildRequires: scl-utils-build
a6d9c8
BuildRequires: help2man
a6d9c8
# Temporary work-around
a6d9c8
BuildRequires: iso-codes
a6d9c8
a6d9c8
Requires:      %{?scl_prefix}php-common
a6d9c8
Requires:      %{?scl_prefix}php-cli
a6d9c8
Requires:      %{?scl_prefix}php-pear
a6d9c8
a6d9c8
%description
a6d9c8
This is the main package for %scl Software Collection,
a6d9c8
that install PHP 5.5 language.
a6d9c8
a6d9c8
a6d9c8
%package runtime
a6d9c8
Summary:   Package that handles %scl Software Collection.
a6d9c8
Group:     Development/Languages
a6d9c8
Requires:  scl-utils
22a395
Requires(post): policycoreutils-python libselinux-utils
a6d9c8
a6d9c8
%description runtime
a6d9c8
Package shipping essential scripts to work with %scl Software Collection.
a6d9c8
a6d9c8
a6d9c8
%package build
a6d9c8
Summary:   Package shipping basic build configuration
a6d9c8
Group:     Development/Languages
a6d9c8
Requires:  scl-utils-build
a6d9c8
a6d9c8
%description build
a6d9c8
Package shipping essential configuration macros
a6d9c8
to build %scl Software Collection.
a6d9c8
a6d9c8
a6d9c8
%package scldevel
a6d9c8
Summary:   Package shipping development files for %scl
a6d9c8
Group:     Development/Languages
a6d9c8
a6d9c8
%description scldevel
a6d9c8
Package shipping development files, especially usefull for development of
a6d9c8
packages depending on %scl Software Collection.
a6d9c8
a6d9c8
a6d9c8
%prep
a6d9c8
%setup -c -T
a6d9c8
a6d9c8
cat <
a6d9c8
export PATH=%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}
a6d9c8
export MANPATH=%{_mandir}:\${MANPATH}
a6d9c8
EOF
a6d9c8
a6d9c8
# generate rpm macros file for depended collections
a6d9c8
cat << EOF | tee scldev
a6d9c8
%%scl_%{scl_name_base}         %{scl}
a6d9c8
%%scl_prefix_%{scl_name_base}  %{scl_prefix}
a6d9c8
EOF
a6d9c8
a6d9c8
# This section generates README file from a template and creates man page
a6d9c8
# from that file, expanding RPM macros in the template file.
a6d9c8
cat >README <<'EOF'
a6d9c8
%{expand:%(cat %{SOURCE1})}
a6d9c8
EOF
a6d9c8
a6d9c8
# copy the license file so %%files section sees it
a6d9c8
cp %{SOURCE2} .
a6d9c8
a6d9c8
a6d9c8
%build
a6d9c8
# generate a helper script that will be used by help2man
a6d9c8
cat >h2m_helper <<'EOF'
a6d9c8
#!/bin/bash
a6d9c8
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
a6d9c8
EOF
a6d9c8
chmod a+x h2m_helper
a6d9c8
a6d9c8
# generate the man page
a6d9c8
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
a6d9c8
a6d9c8
a6d9c8
%install
a6d9c8
install -D -m 644 enable %{buildroot}%{_scl_scripts}/enable
a6d9c8
install -D -m 644 scldev %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
a6d9c8
install -D -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
a6d9c8
a6d9c8
%scl_install
a6d9c8
a6d9c8
# Add the scl_package_override macro
a6d9c8
sed -e 's/@SCL@/%{scl}/g' %{SOURCE0} \
a6d9c8
  | tee -a %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
a6d9c8
a6d9c8
22a395
%post runtime
22a395
# Simple copy of context from system root to SCL root.
22a395
semanage fcontext -a -e /  %{?_scl_root}  &>/dev/null || :
22a395
selinuxenabled && load_policy || :
22a395
restorecon -R %{?_scl_root}  &>/dev/null || :
22a395
22a395
a6d9c8
%files
a6d9c8
a6d9c8
a6d9c8
%files runtime -f filesystem
a6d9c8
%defattr(-,root,root)
a6d9c8
%doc README LICENSE
a6d9c8
%scl_files
a6d9c8
%{_mandir}/man7/%{scl_name}.*
a6d9c8
a6d9c8
a6d9c8
%files build
a6d9c8
%defattr(-,root,root)
a6d9c8
%{_root_sysconfdir}/rpm/macros.%{scl}-config
a6d9c8
a6d9c8
a6d9c8
%files scldevel
a6d9c8
%defattr(-,root,root)
a6d9c8
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
a6d9c8
a6d9c8
a6d9c8
%changelog
22a395
* Tue Mar 17 2015 Remi Collet <rcollet@redhat.com> - 2.0-1
22a395
- fix incorrect selinux contexts #1194336
22a395
a6d9c8
* Mon Mar 31 2014 Honza Horak <hhorak@redhat.com> - 1.1-7
a6d9c8
- Fix path typo in README
a6d9c8
  Related: #1061455
a6d9c8
a6d9c8
* Mon Mar 24 2014 Remi Collet <rcollet@redhat.com> 1.1-6
a6d9c8
- own locale and man directories, #1074337
a6d9c8
a6d9c8
* Wed Feb 12 2014 Remi Collet <rcollet@redhat.com> 1.1-5
a6d9c8
- avoid empty debuginfo subpackage
a6d9c8
- add LICENSE, README and php55.7 man page #1061455
a6d9c8
- add scldevel subpackage #1063357
a6d9c8
a6d9c8
* Mon Jan 20 2014 Remi Collet <rcollet@redhat.com> 1.1-4
a6d9c8
- rebuild with latest scl-utils #1054731
a6d9c8
a6d9c8
* Tue Nov 19 2013 Remi Collet <rcollet@redhat.com> 1.1-2
a6d9c8
- fix scl_package_override
a6d9c8
a6d9c8
* Tue Nov 19 2013 Remi Collet <rcollet@redhat.com> 1.1-1
a6d9c8
- build for RHSCL 1.1
a6d9c8
a6d9c8
* Tue Sep 17 2013 Remi Collet <rcollet@redhat.com> 1-1.5
a6d9c8
- add macros.php55-build for scl_package_override
a6d9c8
a6d9c8
* Fri Aug  2 2013 Remi Collet <rcollet@redhat.com> 1-1
a6d9c8
- initial packaging