%global scl papi60
%scl_package %scl

%global install_scl 1

Summary: Package that installs %scl
Name: %scl_name
Version: 1
Release: 1%{?dist}
License: GPLv2+
Requires: %{scl_prefix}papi
BuildRequires: scl-utils-build environment-modules

%description
This is the main package for %scl Software Collection.
Provide some useful info about this SCL.

%package runtime
Summary: Package that handles %scl Software Collection
Requires: scl-utils
Requires: /usr/bin/scl_source

%description runtime
Package shipping essential scripts to work with %scl Software Collection.

%package build
Summary: Package shipping basic build configuration
Requires: scl-utils-build

%description build
Package shipping essential configuration macros to build %scl Software Collection.

%prep
%setup -T -c

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_scl_scripts}/root
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
export PATH=%{_bindir}\${PATH:+:\${PATH}}
export PATH=%{_sbindir}\${PATH:+:\${PATH}}
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
export MANPATH=%{_mandir}:\${MANPATH}
EOF
mkdir -p %{buildroot}%_root_sysconfdir/modulefiles/papi
/usr/share/Modules/bin/createmodule.sh %{buildroot}%{_scl_scripts}/enable >%{buildroot}%_root_sysconfdir/modulefiles/papi/6.0
%scl_install


%files

%files runtime
%scl_files
%dir %_root_sysconfdir/modulefiles/papi
%_root_sysconfdir/modulefiles/papi/*

%files build
%{_root_sysconfdir}/rpm/macros.%{scl}-config

%changelog
* Thu Jun 25 2020 Dave Love <loveshack@fedoraproject.org> - 1-1
- Initial packaging for papi 6.0