# Define the full and short commit hashes for easy updating %global commit eb126aaadff4359614fe676f782f47b79c0877a7 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: fastnoise Version: 0.9.0 # The release field clearly indicates a git snapshot build Release: 1.git%{shortcommit}%{?dist} Summary: FastNoise, a comprehensive noise generation library (git snapshot) License: MIT URL: https://github.com/Auburn/FastNoise # URL points to the tarball of the specific commit Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ %description A comprehensive noise generation library that supports various noise types. This package is built from git commit %{shortcommit}. %prep # Use the -n flag to specify the directory name from the tarball %setup -q -n %{name}-%{commit} %build %cmake . %cmake_build %install %cmake_install %files %{_libdir}/libFastNoise.so %{_includedir}/FastNoise.h