%global scl_name_prefix rh- %global scl_name_base maven %global scl_name_version 36 %global scl %{scl_name_prefix}%{scl_name_base}%{scl_name_version} %scl_package %scl %global debug_package %{nil} Name: %scl_name Version: 1 Release: 1%{?dist} Summary: Package that installs %scl License: GPLv2+ Source4: README Source5: LICENSE Source6: macros.build BuildRequires: help2man BuildRequires: python-devel BuildRequires: scl-utils-build BuildRequires: %{name}-javapackages-tools Requires: %{name}-runtime = %{version}-%{release} Requires: %{scl_name}-maven %description This is the main package for the %scl Software Collection. %package runtime Summary: Package that handles %scl Software Collection. Requires: scl-utils Requires: java-openjdk-headless Requires: %{scl_name}-javapackages-tools %description runtime Package shipping essential scripts to work with the %scl Software Collection. %package build Summary: Build support tools for the %scl Software Collection. Requires: scl-utils-build Requires: java-1.8.0-openjdk-devel Requires: %{name}-scldevel = %{version}-%{release} %description build Package shipping essential configuration marcros/files in order to be able to build %scl Software Collection. %package scldevel Summary: Package shipping development files for %scl Requires: %{name}-runtime = %{version}-%{release} %description scldevel Package shipping development files, especially useful for development of packages depending on %scl Software Collection. %prep %setup -c -T #===================# # SCL enable script # #===================# cat <enable # Generic variables export PATH="%{_bindir}:\${PATH:-/bin:/usr/bin}" export MANPATH="%{_mandir}:\${MANPATH}" export PYTHONPATH="%{_scl_root}%{python_sitelib}\${PYTHONPATH:+:}\${PYTHONPATH:-}" export JAVACONFDIRS="%{_sysconfdir}/java\${JAVACONFDIRS:+:}\${JAVACONFDIRS:-}" export XDG_CONFIG_DIRS="%{_sysconfdir}/xdg:\${XDG_CONFIG_DIRS:-/etc/xdg}" export XDG_DATA_DIRS="%{_datadir}:\${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" EOF # This section generates README file from a template and creates man page # from that file, expanding RPM macros in the template file. cat >README <<'EOF' %{expand:%(cat %{SOURCE4})} EOF # copy the license file so %%files section sees it cp %{SOURCE5} . cat >macros.%{scl_name} <h2m_helper <<'EOF' #!/bin/bash [ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README EOF chmod a+x h2m_helper # generate the man page help2man -N --section 7 ./h2m_helper -o %{scl_name}.7 # Fix single quotes in man page. sed -i "s/'/\\\\(aq/g" %{scl_name}.7 %install %scl_install cat %{SOURCE6} >>%{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config install -d -m 755 %{buildroot}%{_scl_scripts} install -p -m 755 enable %{buildroot}%{_scl_scripts}/ # install rpm magic install -Dpm0644 macros.%{scl_name} %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_prefix}%{scl_name_base}-scldevel # install dirs used by some deps install -dm0755 %{buildroot}%{_scl_root}%{python_sitelib} install -dm0755 %{buildroot}%{_defaultlicensedir} # install generated man page install -m 755 -d %{buildroot}%{_mandir}/man1 install -m 755 -d %{buildroot}%{_mandir}/man7 install -m 644 %{scl_name}.7 %{buildroot}%{_mandir}/man7/%{scl_name}.7 %files # empty main package %files runtime %doc README LICENSE %{scl_files} %{_mandir}/* %{_prefix}/lib/python2.* %{_defaultlicensedir} %files build %{_root_sysconfdir}/rpm/macros.%{scl}-config %files scldevel %{_root_sysconfdir}/rpm/macros.%{scl_name_prefix}%{scl_name_base}-scldevel %changelog * Wed Sep 04 2019 Mikolaj Izdebski - 1-2 - Initial version