%global pkgvers 2 %global scdate0 20210323 %global schash0 7d63ba85d2e146859e95be6ff66a9816e67ebc2c %global branch0 fixup_python_packaging %global source0 https://github.com/litghost/rapidyaml.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: rapidyaml Version: 0.1.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Rapid YAML License: BSD URL: https://github.com/litghost/rapidyaml BuildRequires: cmake gcc-c++ swig ninja-build git BuildRequires: python3-devel python3-setuptools python3-cmake-build-extension %global debug_package %{nil} %description Rapid YAML %package python3 Summary: Rapid YAML %description python3 Rapid YAML %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 submodule update --init --recursive git log --format=fuller %build rm -rf .git rm -rf ext/c4core/bm rm -rf ext/c4core/test sed -i '/if(RYML_BUILD_TESTS/,/^endif/d' CMakeLists.txt sed -i '/VERSION_FILE/,/\}/d' setup.py sed -i '/_c4_get_platform_tag(platform_tag)/d' ext/c4core/cmake/c4Project.cmake sed -i 's|set(Python3_FIND_VIRTUALENV "FIRST")|set(Python3_LIBRARY "%{_libdir}")|' api/CMakeLists.txt sed -i 's|REQUIRED||' api/CMakeLists.txt sed -i 's|-DRYML_BUILD_API:BOOL=ON|-DRYML_BUILD_API:BOOL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo|' setup.py %ifarch ppc64le echo '#define C4_UNIX' > ext/c4core/src/c4/platform.hpp echo '#define C4_POSIX' > ext/c4core/src/c4/platform.hpp %endif %py3_build %install %py3_install %files python3 %license LICENSE.txt %doc README.md %{python3_sitearch}/* %changelog * Fri Jul 02 2021 Cristian Balint - github upstream releases