Blame SPECS/rh-ror50.spec

2657c2
%global scl_name_prefix rh-
2657c2
%global scl_name_base ror
2657c2
%global scl_name_version 50
2657c2
2657c2
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
2657c2
2657c2
# Fallback to rh-ruby24. rh-ruby24-scldevel is probably not available in
2657c2
# the buildroot.
2657c2
%{!?scl_ruby:%global scl_ruby rh-ruby24}
2657c2
%{!?scl_prefix_ruby:%global scl_prefix_ruby %{scl_ruby}-}
2657c2
2657c2
# Fallback to rh-nodejs6 rh-nodejs6-scldevel is probably not available in
2657c2
# the buildroot.
28e03e
# rh-nodejs6 is no longer supported
28e03e
#%%{!?scl_nodejs:%%global scl_nodejs rh-nodejs6}
28e03e
#%%{!?scl_prefix_nodejs:%%global scl_prefix_nodejs %%{scl_nodejs}-}
2657c2
2657c2
# Fallback to rh-mongodb32. rh-mongodb32-scldevel is probably not available in
2657c2
# the buildroot.
2657c2
%{!?scl_mongodb:%global scl_mongodb rh-mongodb32}
2657c2
%{!?scl_prefix_mongodb:%global scl_prefix_mongodb %{scl_mongodb}-}
2657c2
2657c2
# Do not produce empty debuginfo package.
2657c2
%global debug_package %{nil}
2657c2
2657c2
# Support SCL over NFS.
2657c2
# nfsmountable macro must be defined before defining the scl_package macro
2657c2
%global nfsmountable 1
2657c2
2657c2
%{!?install_scl: %global install_scl 1}
2657c2
2657c2
%scl_package %scl
2657c2
2657c2
Summary: Package that installs %scl
2657c2
Name: %scl_name
2657c2
Version: 5.0
28e03e
Release: 8%{?dist}
2657c2
License: GPLv2+
2657c2
Source0: README
2657c2
Source1: LICENSE
2657c2
2657c2
%if 0%{?install_scl}
2657c2
Requires: %{scl_prefix}rubygem-bcrypt
2657c2
Requires: %{scl_prefix}rubygem-byebug
2657c2
Requires: %{scl_prefix}rubygem-coffee-rails
2657c2
Requires: %{scl_prefix}rubygem-jbuilder
2657c2
Requires: %{scl_prefix}rubygem-jquery-rails
2657c2
Requires: %{scl_prefix}rubygem-listen
2657c2
Requires: %{scl_prefix}rubygem-puma
2657c2
Requires: %{scl_prefix}rubygem-rails
2657c2
Requires: %{scl_prefix}rubygem-sass-rails
2657c2
Requires: %{scl_prefix}rubygem-spring
2657c2
Requires: %{scl_prefix}rubygem-spring-watcher-listen
2657c2
Requires: %{scl_prefix}rubygem-sqlite3
2657c2
Requires: %{scl_prefix}rubygem-turbolinks
2657c2
Requires: %{scl_prefix}rubygem-uglifier
2657c2
Requires: %{scl_prefix}rubygem-web-console
2657c2
Requires: %{scl_prefix_ruby}rubygem-json
28e03e
# rh-nodejs6 is no longer supported
28e03e
#Requires: %%{scl_prefix_nodejs}nodejs
2657c2
%endif
2657c2
BuildRequires: help2man
2657c2
BuildRequires: scl-utils-build
2657c2
BuildRequires: %{scl_prefix_ruby}scldevel
2657c2
BuildRequires: %{scl_prefix_ruby}rubygems-devel
2657c2
2657c2
%description
2657c2
This is the main package for %scl Software Collection.
2657c2
2657c2
%package runtime
2657c2
Summary: Package that handles %scl Software Collection.
2657c2
Requires: scl-utils
2657c2
# enable scriptlet depends on ruby executable.
2657c2
Requires: %{scl_prefix_ruby}ruby
2657c2
2657c2
%description runtime
2657c2
Package shipping essential scripts to work with %scl Software Collection.
2657c2
2657c2
%package build
2657c2
Summary: Package shipping basic build configuration
2657c2
Requires: scl-utils-build
2657c2
Requires: %{scl_runtime}
2657c2
Requires: %{scl_prefix_ruby}scldevel
28e03e
# rh-nodejs6 is no longer supported
28e03e
#Requires: %%{scl_prefix_nodejs}scldevel
2657c2
2657c2
%description build
2657c2
Package shipping essential configuration macros to build %scl Software Collection.
2657c2
2657c2
%package scldevel
2657c2
Summary: Package shipping development files for %scl
2657c2
Provides: scldevel(%{scl_name_base})
2657c2
2657c2
%description scldevel
2657c2
Package shipping development files, especially usefull for development of
2657c2
packages depending on %scl Software Collection.
2657c2
2657c2
%prep
2657c2
%setup -T -c
2657c2
2657c2
# Expand macros used in README file.
2657c2
cat > README << EOF
2657c2
%{expand:%(cat %{SOURCE0})}
2657c2
EOF
2657c2
2657c2
cp %{SOURCE1} .
2657c2
2657c2
%build
2657c2
# Generate a helper script that will be used by help2man.
2657c2
cat > h2m_help << 'EOF'
2657c2
#!/bin/bash
2657c2
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
2657c2
EOF
2657c2
chmod a+x h2m_help
2657c2
2657c2
# Generate the man page from include.h2m and ./h2m_help --help output.
2657c2
help2man -N --section 7 ./h2m_help -o %{scl_name}.7
2657c2
2657c2
%install
2657c2
%scl_install
2657c2
2657c2
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
2657c2
export PATH=%{_bindir}\${PATH:+:\${PATH}}
2657c2
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
2657c2
export MANPATH=%{_mandir}:\${MANPATH}
2657c2
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
2657c2
export GEM_PATH=\${GEM_PATH:=%{gem_dir}:\`scl enable %{scl_ruby} -- ruby -e "print Gem.path.join(':')"\`}
2657c2
2657c2
. scl_source enable %{scl_ruby}
2657c2
EOF
2657c2
2657c2
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
2657c2
%%scl_%{scl_name_base} %{scl}
2657c2
%%scl_prefix_%{scl_name_base} %{scl_prefix}
2657c2
EOF
2657c2
2657c2
# Install generated man page.
2657c2
mkdir -p %{buildroot}%{_mandir}/man7/
2657c2
install -p -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/
2657c2
2657c2
scl enable %{scl_ruby} - << \EOF
2657c2
set -e
2657c2
2657c2
# Fake rh-ror50 SCL environment.
2657c2
# TODO: Is there a way how to leverage the enable scriptlet created above?
2657c2
GEM_PATH=%{gem_dir}:`ruby -e "print Gem.path.join(':')"` \
2657c2
X_SCLS=%{scl} \
2657c2
ruby -rfileutils > rubygems_filesystem.list << \EOR
2657c2
  # Create RubyGems filesystem.
2657c2
  Gem.ensure_gem_subdirectories '%{buildroot}%{gem_dir}'
2657c2
  FileUtils.mkdir_p File.join '%{buildroot}', Gem.default_ext_dir_for('%{gem_dir}')
2657c2
2657c2
  # Output the relevant directories.
2657c2
  puts Gem.default_dirs['%{scl}_system'.to_sym].values
2657c2
EOR
2657c2
EOF
2657c2
28e03e
# Create directory for license files (rhbz#1431083).
28e03e
%{?_licensedir:mkdir -p %{buildroot}%{_licensedir}}
28e03e
2657c2
%files
2657c2
2657c2
%files runtime -f rubygems_filesystem.list
2657c2
%doc README LICENSE
2657c2
%scl_files
28e03e
%{?_licensedir:%dir %{_licensedir}}
2657c2
# Own the manual directories (rhbz#1080036, rhbz#1072319).
2657c2
%dir %{_mandir}/man1
2657c2
%dir %{_mandir}/man5
2657c2
%dir %{_mandir}/man7
2657c2
%{_mandir}/man7/%{scl_name}.*
2657c2
2657c2
%files build
2657c2
%{_root_sysconfdir}/rpm/macros.%{scl}-config
2657c2
2657c2
%files scldevel
2657c2
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
2657c2
2657c2
%changelog
28e03e
* Thu Mar 07 2019 Pavel Valena <pvalena@redhat.com> - 5.0-8
28e03e
- Do not require rh-nodejs6
28e03e
  Resolves: rhbz#1688946
28e03e
28e03e
* Fri Mar 10 2017 Jun Aruga <jaruga@redhat.com> - 5.0-6
28e03e
- Own the license directory.
28e03e
  Resolves: rhbz#1431083
28e03e
2657c2
* Tue Jan 24 2017 Jun Aruga <jaruga@redhat.com> - 5.0-5
2657c2
- Update scl_nodejs to rh-nodejs6.
2657c2
2657c2
* Fri Jan 20 2017 Jun Aruga <jaruga@redhat.com> - 5.0-3
2657c2
- Enable install_scl
2657c2
2657c2
* Wed Jan 04 2017 Jun Aruga <jaruga@redhat.com> - 5.0-2
2657c2
- Remove rubygem-mongo from Requires.
2657c2
2657c2
* Tue Sep 27 2016 Jun Aruga <jaruga@redhat.com> - 5.0-1
2657c2
- Initial metapackage.