%global pkgvers 1 %global scdate0 20210526 %global schash0 c278588e34e535f0bb8f00df3880d26928038cad %global branch0 master %global source0 https://github.com/houseroad/foxi.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: foxi Version: 0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: ONNXFI License: BSD URL: https://github.com/houseroad/foxi BuildRequires: cmake gcc-c++ git %global __cmake_in_source_build 1 %description ONNXIFI with Facebook Extension %package devel Summary: Development files Requires: %{name} = %{version}-%{release} %description devel This package contains the development files for %{name}. %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 sed -i 's|"hidden"|"default"|' foxi/onnxifi_loader.h sed -i 's|foxi_loader STATIC|foxi_loader SHARED|' CMakeLists.txt sed -i 's|PROPERTIES C_STANDARD|PROPERTIES SOVERSION 1 VERSION 1.0 C_STANDARD|' CMakeLists.txt sed -i '/add_library(foxi_dummy/,/^endif()/d' CMakeLists.txt sed -i 's|foxi_dummy||g' CMakeLists.txt sed -i '/if (NOT ANDROID AND NOT IOS)/,/^endif()/d' CMakeLists.txt sed -i 's|foxi_wrapper||g' CMakeLists.txt sed -i 's|DESTINATION lib)|DESTINATION %{_lib})|' CMakeLists.txt mkdir build pushd build export ONNX_ML=0 %cmake .. \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo make %{?_smp_mflags} popd %install rm -rf %{buildroot} pushd build make install DESTDIR=%{buildroot} popd %files %license LICENSE %{_libdir}/*.so.* %files devel %license LICENSE %{_includedir}/* %{_libdir}/*.so %changelog * Fri Sep 25 2020 Cristian Balint - github update releases