# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %global commit d973d2f6a1f03bd4930daec931c1669333ea7353 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: pylikwid Version: 0.1 Release: 1.git%shortcommit%{?dist} Summary: Python interface for the C API of LIKWID License: GPLv2 URL: https://github.com/RRZE-HPC/pylikwid Source0: https://github.com/RRZE-HPC/pylikwid/archive/%commit/%name-%shortcommit.tar.gz BuildRequires: python%python3_pkgversion-devel likwid-devel gcc ExclusiveArch: x86_64 %ix86 armv7hl aarch64 ppc64le %global desc Python interface for the C API of LIKWID. %description %desc %package -n python%python3_pkgversion-likwid Summary: Python interface for the C API of LIKWID %description -n python%python3_pkgversion-likwid %desc %prep %setup -q -n %name-%commit %build LIKWID_PREFIX=%_prefix CFLAGS="%build_cflags" %__python3 setup.py build %install LIKWID_PREFIX=%_prefix %__python3 setup.py install --skip-build --root %buildroot %files -n python%python3_pkgversion-likwid %doc README.rst %license LICENSE %python3_sitearch/* %changelog * Wed Jun 24 2020 Dave Love - 0.1-1.git%(c=%{commit}; echo ${c:0:7})%{?dist} - Initial packaging