|
|
7a345b |
%global scl_name_prefix rh-
|
|
|
7a345b |
%global scl_name_base maven
|
|
|
7a345b |
%global scl_name_version 36
|
|
|
7a345b |
%global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version}
|
|
|
7a345b |
%scl_package %scl
|
|
|
7a345b |
|
|
|
7a345b |
%global debug_package %{nil}
|
|
|
7a345b |
|
|
|
7a345b |
|
|
|
7a345b |
Name: %scl_name
|
|
|
7a345b |
Version: 1
|
|
|
7a345b |
Release: 1%{?dist}
|
|
|
7a345b |
Summary: Package that installs %scl
|
|
|
7a345b |
|
|
|
7a345b |
License: GPLv2+
|
|
|
7a345b |
Source4: README
|
|
|
7a345b |
Source5: LICENSE
|
|
|
7a345b |
Source6: macros.build
|
|
|
7a345b |
|
|
|
7a345b |
BuildRequires: help2man
|
|
|
7a345b |
BuildRequires: python-devel
|
|
|
7a345b |
BuildRequires: scl-utils-build
|
|
|
7a345b |
BuildRequires: %{name}-javapackages-tools
|
|
|
7a345b |
|
|
|
7a345b |
Requires: %{name}-runtime = %{version}-%{release}
|
|
|
7a345b |
Requires: %{scl_name}-maven
|
|
|
7a345b |
|
|
|
7a345b |
%description
|
|
|
7a345b |
This is the main package for the %scl Software Collection.
|
|
|
7a345b |
|
|
|
7a345b |
%package runtime
|
|
|
7a345b |
Summary: Package that handles %scl Software Collection.
|
|
|
7a345b |
Requires: scl-utils
|
|
|
7a345b |
Requires: java-openjdk-headless
|
|
|
7a345b |
Requires: %{scl_name}-javapackages-tools
|
|
|
7a345b |
|
|
|
7a345b |
%description runtime
|
|
|
7a345b |
Package shipping essential scripts to work with the %scl Software Collection.
|
|
|
7a345b |
|
|
|
7a345b |
%package build
|
|
|
7a345b |
Summary: Build support tools for the %scl Software Collection.
|
|
|
7a345b |
Requires: scl-utils-build
|
|
|
7a345b |
Requires: java-1.8.0-openjdk-devel
|
|
|
7a345b |
Requires: %{name}-scldevel = %{version}-%{release}
|
|
|
7a345b |
|
|
|
7a345b |
%description build
|
|
|
7a345b |
Package shipping essential configuration marcros/files in order to be able
|
|
|
7a345b |
to build %scl Software Collection.
|
|
|
7a345b |
|
|
|
7a345b |
%package scldevel
|
|
|
7a345b |
Summary: Package shipping development files for %scl
|
|
|
7a345b |
Requires: %{name}-runtime = %{version}-%{release}
|
|
|
7a345b |
|
|
|
7a345b |
%description scldevel
|
|
|
7a345b |
Package shipping development files, especially useful for development of
|
|
|
7a345b |
packages depending on %scl Software Collection.
|
|
|
7a345b |
|
|
|
7a345b |
%prep
|
|
|
7a345b |
%setup -c -T
|
|
|
7a345b |
#===================#
|
|
|
7a345b |
# SCL enable script #
|
|
|
7a345b |
#===================#
|
|
|
7a345b |
cat <<EOF >enable
|
|
|
7a345b |
# Generic variables
|
|
|
7a345b |
export PATH="%{_bindir}:\${PATH:-/bin:/usr/bin}"
|
|
|
7a345b |
export MANPATH="%{_mandir}:\${MANPATH}"
|
|
|
7a345b |
export PYTHONPATH="%{_scl_root}%{python_sitelib}\${PYTHONPATH:+:}\${PYTHONPATH:-}"
|
|
|
7a345b |
|
|
|
7a345b |
export JAVACONFDIRS="%{_sysconfdir}/java\${JAVACONFDIRS:+:}\${JAVACONFDIRS:-}"
|
|
|
7a345b |
export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}"
|
|
|
7a345b |
export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
|
|
7a345b |
EOF
|
|
|
7a345b |
|
|
|
7a345b |
# This section generates README file from a template and creates man page
|
|
|
7a345b |
# from that file, expanding RPM macros in the template file.
|
|
|
7a345b |
cat >README <<'EOF'
|
|
|
7a345b |
%{expand:%(cat %{SOURCE4})}
|
|
|
7a345b |
EOF
|
|
|
7a345b |
|
|
|
7a345b |
# copy the license file so %%files section sees it
|
|
|
7a345b |
cp %{SOURCE5} .
|
|
|
7a345b |
|
|
|
7a345b |
cat >macros.%{scl_name} <
|
|
|
7a345b |
# SCL configuration
|
|
|
7a345b |
%%scl_maven %scl
|
|
|
7a345b |
%%scl_prefix_maven %scl_prefix
|
|
|
7a345b |
%%_scl_prefix_maven %_scl_prefix
|
|
|
7a345b |
%%_scl_scripts_maven %_scl_scripts
|
|
|
7a345b |
%%_scl_root_maven %_scl_root
|
|
|
7a345b |
# Generic paths inside SCL root
|
|
|
7a345b |
%%_bindir_maven %_bindir
|
|
|
7a345b |
%%_datadir_maven %_datadir
|
|
|
7a345b |
%%_defaultdocdir_maven %_defaultdocdir
|
|
|
7a345b |
%%_docdir_maven %_docdir
|
|
|
7a345b |
%%_exec_prefix_maven %_exec_prefix
|
|
|
7a345b |
%%_includedir_maven %_includedir
|
|
|
7a345b |
%%_infodir_maven %_infodir
|
|
|
7a345b |
%%_libdir_maven %_libdir
|
|
|
7a345b |
%%_libexecdir_maven %_libexecdir
|
|
|
7a345b |
%%_localstatedir_maven %_localstatedir
|
|
|
7a345b |
%%_mandir_maven %_mandir
|
|
|
7a345b |
%%_prefix_maven %_prefix
|
|
|
7a345b |
%%_sbindir_maven %_sbindir
|
|
|
7a345b |
%%_sharedstatedir_maven %_sharedstatedir
|
|
|
7a345b |
%%_sysconfdir_maven %_sysconfdir
|
|
|
7a345b |
# Java-specific paths inside SCL root
|
|
|
7a345b |
%%_ivyxmldir_maven %_ivyxmldir
|
|
|
7a345b |
%%_javaconfdir_maven %_javaconfdir
|
|
|
7a345b |
%%_javadir_maven %_javadir
|
|
|
7a345b |
%%_javadocdir_maven %_javadocdir
|
|
|
7a345b |
%%_jnidir_maven %_jnidir
|
|
|
7a345b |
%%_jvmcommondatadir_maven %_jvmcommondatadir
|
|
|
7a345b |
%%_jvmcommonlibdir_maven %_jvmcommonlibdir
|
|
|
7a345b |
%%_jvmcommonsysconfdir_maven %_jvmcommonsysconfdir
|
|
|
7a345b |
%%_jvmdatadir_maven %_jvmdatadir
|
|
|
7a345b |
%%_jvmdir_maven %_jvmdir
|
|
|
7a345b |
%%_jvmlibdir_maven %_jvmlibdir
|
|
|
7a345b |
%%_jvmprivdir_maven %_jvmprivdir
|
|
|
7a345b |
%%_jvmsysconfdir_maven %_jvmsysconfdir
|
|
|
7a345b |
%%_mavenpomdir_maven %_mavenpomdir
|
|
|
7a345b |
EOF
|
|
|
7a345b |
|
|
|
7a345b |
|
|
|
7a345b |
%build
|
|
|
7a345b |
# generate a helper script that will be used by help2man
|
|
|
7a345b |
cat >h2m_helper <<'EOF'
|
|
|
7a345b |
#!/bin/bash
|
|
|
7a345b |
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
|
|
|
7a345b |
EOF
|
|
|
7a345b |
chmod a+x h2m_helper
|
|
|
7a345b |
|
|
|
7a345b |
# generate the man page
|
|
|
7a345b |
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
|
|
|
7a345b |
# Fix single quotes in man page.
|
|
|
7a345b |
sed -i "s/'/\\\\(aq/g" %{scl_name}.7
|
|
|
7a345b |
|
|
|
7a345b |
%install
|
|
|
7a345b |
%scl_install
|
|
|
7a345b |
cat %{SOURCE6} >>%{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
|
|
|
7a345b |
|
|
|
7a345b |
install -d -m 755 %{buildroot}%{_scl_scripts}
|
|
|
7a345b |
install -p -m 755 enable %{buildroot}%{_scl_scripts}/
|
|
|
7a345b |
|
|
|
7a345b |
# install rpm magic
|
|
|
7a345b |
install -Dpm0644 macros.%{scl_name} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_prefix}%{scl_name_base}-scldevel
|
|
|
7a345b |
|
|
|
7a345b |
# install dirs used by some deps
|
|
|
7a345b |
install -dm0755 %{buildroot}%{_scl_root}%{python_sitelib}
|
|
|
7a345b |
install -dm0755 %{buildroot}%{_defaultlicensedir}
|
|
|
7a345b |
|
|
|
7a345b |
# install generated man page
|
|
|
7a345b |
install -m 755 -d %{buildroot}%{_mandir}/man1
|
|
|
7a345b |
install -m 755 -d %{buildroot}%{_mandir}/man7
|
|
|
7a345b |
install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7
|
|
|
7a345b |
|
|
|
7a345b |
%files
|
|
|
7a345b |
# empty main package
|
|
|
7a345b |
|
|
|
7a345b |
%files runtime
|
|
|
7a345b |
%doc README LICENSE
|
|
|
7a345b |
%{scl_files}
|
|
|
7a345b |
%{_mandir}/*
|
|
|
7a345b |
%{_prefix}/lib/python2.*
|
|
|
7a345b |
%{_defaultlicensedir}
|
|
|
7a345b |
|
|
|
7a345b |
%files build
|
|
|
7a345b |
%{_root_sysconfdir}/rpm/macros.%{scl}-config
|
|
|
7a345b |
|
|
|
7a345b |
%files scldevel
|
|
|
7a345b |
%{_root_sysconfdir}/rpm/macros.%{scl_name_prefix}%{scl_name_base}-scldevel
|
|
|
7a345b |
|
|
|
7a345b |
%changelog
|
|
|
7a345b |
* Wed Sep 04 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1-2
|
|
|
7a345b |
- Initial version
|