Blame SPECS/rh-ruby25.spec

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