Blame SPECS/rh-ruby24.spec

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