# If the build is running on copr %if 0%{?copr_username:1} %global scl_name_prefix %{copr_username} %global scl_name_short %{copr_projectname} %global scl %{copr_username}-%{copr_projectname} # Otherwise, set defaults %else %global scl_name_prefix ufven %global scl_name_base netbox %global scl_name_version 25 %global scl_name_short %{scl_name_base}%{scl_name_version} %global scl %{scl_name_prefix}-%{scl_name_base}%{scl_name_version} %endif %global _scl_prefix /opt/%{scl_name_prefix} %global nfsmountable 1 %scl_package %scl # Defaults for the values for the rh-python36 Software Collection. These # will be used when rh-python36-scldevel is not in the build root. %{!?scl_python:%global scl_python rh-python36} %{!?scl_no_vendor:%global scl_no_vendor python36} %{!?scl_prefix_python:%global scl_prefix_python %{scl_python}-} %global __os_install_post %{%{scl_no_vendor}_os_install_post} %global __python_requires %{%{scl_no_vendor}_python_requires} # The directory for site packages for this Software Collection. %global netbox_sitelib %(echo %{python36python_sitelib} | sed -e 's|%{scl_python}|%{scl}|' -e 's|^/opt/rh|%{_scl_prefix}|') %global netbox_sitearch %(echo %{python36python_sitearch} | sed -e 's|%{scl_python}|%{scl}|' -e 's|^/opt/rh|%{_scl_prefix}|') Name: %{scl_name} Version: 1 Release: 2%{?dist} Summary: Package that installs %{scl} License: ASL 2.0 BuildRequires: %{scl_prefix_python}scldevel BuildRequires: %{scl_prefix_python}python-devel BuildRequires: scl-utils-build %description This is the main package for %{scl} Software Collection. %package runtime Summary: Package that handles %{scl} Software Collection Requires: scl-utils Requires: %{scl_prefix_python}runtime %description runtime Package shipping essential scripts to work with %{scl} Software Collection. %package build Summary: Package shipping basic build configuration Requires: scl-utils-build Requires: %{scl_prefix_python}scldevel %description build Package shipping essential configuration macros to build %{scl} Software Collection. %prep %setup -c -T %build %install %scl_install cat >> %{buildroot}%{_scl_scripts}/enable << EOF . scl_source enable %{scl_python} export PATH="%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}" export PYTHONPATH="%{netbox_sitelib}:%{netbox_sitearch}\${PYTHONPATH:+:\${PYTHONPATH}}" EOF mkdir -p %{buildroot}%{netbox_sitelib} mkdir -p %{buildroot}%{netbox_sitearch} cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF %%scl_package_override() %%{expand:%{?python36_os_install_post:%%global __os_install_post %%python36_os_install_post} %%global __python_requires %%python36_python_requires %%global __python_provides %%python36_python_provides %%global __python %python36__python %%global __python3 %python36__python3 %%global python_sitelib %netbox_sitelib %%global python_sitearch %netbox_sitearch %%global python3_sitelib %netbox_sitelib %%global python3_sitearch %netbox_sitearch } %%scl_%{scl_name_short} %{scl} %%scl_prefix_%{scl_name_short} %{scl_prefix} %%_scl_prefix %{_scl_prefix} EOF %files %files runtime -f filelist %{scl_files} %{netbox_sitelib} %files build %{_root_sysconfdir}/rpm/macros.%{scl}-config %changelog * Tue Dec 18 2018 Daniel Uvehag 1-2 - Added missing PATH environment variable - Added missing platlib path to PYTHONPATH * Wed Nov 14 2018 Daniel Uvehag 1-1 - Initial package