%global pkgvers 0 %global scdate0 20221222 %global schash0 90435ba1cab15701633a031a94bfaa19b5fb5ddb %global branch0 main %global source0 https://github.com/CyberAgentAILab/cmaes.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: python-cmaes Version: 0.9.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Covariance Matrix Adaptation Evolution Strategy License: MIT BuildArch: noarch URL: https://github.com/CyberAgentAILab/cmaes BuildRequires: git python3-devel python3-setuptools python3-numpy %description Covariance Matrix Adaptation Evolution Strategy implementation. %package -n python3-cmaes Summary: %{summary} Provides: python-cmaes %description -n python3-cmaes Covariance Matrix Adaptation Evolution Strategy implementation. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %build echo '[metadata]' > setup.cfg echo ' name = cmaes' >> setup.cfg echo ' version = attr: cmaes.__version__' >> setup.cfg echo '[options]' >> setup.cfg echo '[mypy]' >> setup.cfg %py3_build %install %py3_install # workaround install (older setuptools) if [ ! -d %{buildroot}/%{python3_sitelib}/cmaes ]; then mkdir %{buildroot}/%{python3_sitelib}/cmaes install -m644 cmaes/*.py %{buildroot}/%{python3_sitelib}/cmaes/ fi %files -n python3-cmaes %license LICENSE %doc README.md %{python3_sitelib}/cmaes/ %{python3_sitelib}/cmaes-%{version}-py%{python3_version}.egg-info/ %changelog * Fri Mar 29 2019 Balint Cristian - github update releases