Blame SPECS/rh-ruby27.spec

35c5e3
%global scl_name_prefix rh-
35c5e3
%global scl_name_base ruby
35c5e3
%global scl_name_version 27
35c5e3
35c5e3
# Do not produce empty debuginfo package.
35c5e3
%global debug_package %{nil}
35c5e3
35c5e3
# Support SCL over NFS.
35c5e3
%global nfsmountable 1
35c5e3
35c5e3
# nfsmountable macro must be defined before defining the %%scl_package macro
35c5e3
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
35c5e3
%scl_package %scl
35c5e3
35c5e3
%{!?install_scl: %global install_scl 1}
35c5e3
35c5e3
Summary: Package that installs %scl
35c5e3
Name: %scl_name
35c5e3
Version: 2.7
35c5e3
Release: 2%{?dist}
35c5e3
License: GPLv2+
35c5e3
Source0: README
35c5e3
Source1: LICENSE
35c5e3
%if 0%{?install_scl}
35c5e3
Requires: %{scl_prefix}ruby
35c5e3
%endif
35c5e3
BuildRequires: help2man
35c5e3
BuildRequires: scl-utils-build
35c5e3
35c5e3
%description
35c5e3
This is the main package for %scl Software Collection.
35c5e3
35c5e3
%package runtime
35c5e3
Summary: Package that handles %scl Software Collection.
35c5e3
Requires: scl-utils
35c5e3
35c5e3
%description runtime
35c5e3
Package shipping essential scripts to work with %scl Software Collection.
35c5e3
35c5e3
%package build
35c5e3
Summary: Package shipping basic build configuration
35c5e3
Requires: scl-utils-build
35c5e3
35c5e3
%description build
35c5e3
Package shipping essential configuration macros to build %scl Software Collection.
35c5e3
35c5e3
%package scldevel
35c5e3
Summary: Package shipping development files for %scl
35c5e3
35c5e3
%description scldevel
35c5e3
Package shipping development files, especially usefull for development of
35c5e3
packages depending on %scl Software Collection.
35c5e3
35c5e3
%prep
35c5e3
%setup -T -c
35c5e3
35c5e3
# Expand macros used in README file.
35c5e3
cat > README << EOF
35c5e3
%{expand:%(cat %{SOURCE0})}
35c5e3
EOF
35c5e3
35c5e3
cp %{SOURCE1} .
35c5e3
35c5e3
%build
35c5e3
# Generate a helper script that will be used by help2man.
35c5e3
cat > h2m_help << 'EOF'
35c5e3
#!/bin/bash
35c5e3
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
35c5e3
EOF
35c5e3
chmod a+x h2m_help
35c5e3
35c5e3
# Generate the man page from include.h2m and ./h2m_help --help output.
35c5e3
help2man -N --section 7 ./h2m_help -o %{scl_name}.7
35c5e3
35c5e3
%install
35c5e3
%scl_install
35c5e3
35c5e3
# Fix: install gem binaries to SCL PATH
35c5e3
# https://bugzilla.redhat.com/show_bug.cgi?id=1225496
35c5e3
perl -e 'while (<>) { if (/^([^=]*=["'\'']?)([^\$]*)(.*)/) { $pre = $1 ; $path = $2 ;
35c5e3
  $post = $3 ; ($newpath = $path) =~ s/usr/usr\/local/ ; $newpath =~ s/://g ;
35c5e3
  print "$pre$newpath:$path$post\n" }}' <<EOF >>%{buildroot}%{_scl_scripts}/enable
35c5e3
export PATH=%{_bindir}\${PATH:+:\${PATH}}
35c5e3
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
35c5e3
export MANPATH=%{_mandir}:\$MANPATH
35c5e3
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
35c5e3
# For SystemTap.
35c5e3
export XDG_DATA_DIRS=%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
35c5e3
EOF
35c5e3
35c5e3
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
35c5e3
%%scl_%{scl_name_base} %{scl}
35c5e3
%%scl_prefix_%{scl_name_base} %{scl_prefix}
35c5e3
EOF
35c5e3
35c5e3
# Install generated man page.
35c5e3
mkdir -p %{buildroot}%{_mandir}/man7/
35c5e3
install -p -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/
35c5e3
35c5e3
# Create directory for pkgconfig files, originally provided by pkgconfig
35c5e3
# package, but not for SCL.
35c5e3
mkdir -p %{buildroot}%{_libdir}/pkgconfig
35c5e3
35c5e3
# Create directory for license files (rhbz#1420233).
35c5e3
%{?_licensedir:mkdir -p %{buildroot}%{_licensedir}}
35c5e3
35c5e3
%files
35c5e3
35c5e3
%files runtime
35c5e3
%doc README LICENSE
35c5e3
%scl_files
35c5e3
%{?_licensedir:%dir %{_licensedir}}
35c5e3
# Own the manual directories (rhbz#1073458, rhbz#1072319).
35c5e3
%dir %{_mandir}/man1
35c5e3
%dir %{_mandir}/man5
35c5e3
%dir %{_mandir}/man7
35c5e3
%dir %{_libdir}/pkgconfig
35c5e3
%{_mandir}/man7/%{scl_name}.*
35c5e3
35c5e3
%files build
35c5e3
%{_root_sysconfdir}/rpm/macros.%{scl}-config
35c5e3
35c5e3
%files scldevel
35c5e3
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
35c5e3
35c5e3
%changelog
35c5e3
* Thu Jan 30 2020 Jun Aruga <jaruga@redhat.com> - 2.7-2
35c5e3
- Update to 2.7.
35c5e3
35c5e3
* Mon Jan 07 2019 Vít Ondruch <vondruch@redhat.com> - 2.6-1
35c5e3
- Update to 2.6.
35c5e3
35c5e3
* Fri Jan 05 2018 Jun Aruga <jaruga@redhat.com> - 2.5-2
35c5e3
- Update to 2.5.
35c5e3
35c5e3
* Tue Feb 28 2017 Vít Ondruch <vondruch@redhat.com> - 2.4-2
35c5e3
- Own the license directory.
35c5e3
  Resolves: rhbz#1420233
35c5e3
35c5e3
* Tue Dec 13 2016 Vít Ondruch <vondruch@redhat.com> - 2.4-1
35c5e3
- Initial package