# This flag prevents internal links %undefine _ld_as_needed %global post_release 1 %if 0%{?post_release} %global commit 6e7951358fd896e2abed7887196b6871aac9f2f8 %global date 20250705git %global shortcommit %(c=%{commit}; echo ${c:0:7}) %else %global commit %{nil} %global date %{nil} %global shortcommit %{nil} %endif Name: GKlib Version: 5.1.1 Release: %autorelease -s %{date}git%{shortcommit} Summary: A library of various helper routines and frameworks License: ASL 2.0 URL: https://github.com/KarypisLab/GKlib %if 0%{?post_release} Source0: https://github.com/KarypisLab/GKlib/archive/%{commit}/%{name}-%{commit}.tar.gz %else Source0: https://github.com/KarypisLab/GKlib/archive/%{version}/%{name}-%{version}.tar.gz %endif BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: pcre-devel BuildRequires: valgrind-devel %description A library of various helper routines and frameworks used by many of the lab's software. %package devel Summary: GKlib headers and development-related files Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Header and development library files of GKlib. %prep %autosetup -p1 -n %{name}-%{commit} sed -e 's|lib/cmake/GKlib|lib${LIB_SUFFIX}/cmake/GKlib|g' -i CMakeLists.txt %build PCRE_LDFLAGS=-lpcreposix %cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DOPENMP:BOOL=ON \ -DPCRE:BOOL=ON \ -DSHARED:BOOL=ON \ -DVALGRIND:BOOL=ON \ -DCMAKE_C_FLAGS:STRING="%{optflags} -pthread" \ -DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} $PCRE_LDFLAGS" \ -DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} $PCRE_LDFLAGS" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ %ifnarch %{?x86} -DNO_X86:BOOL=ON %endif %cmake_build %install %cmake_install # Remove win32 files rm -rf %{buildroot}%{_includedir}/win32 %files %license LICENSE.txt %{_bindir}/csrcnv %{_libdir}/lib%{name}.so.0 %{_libdir}/lib%{name}.so.0.0.1 %{_libdir}/cmake/GKlib/ %files devel %{_libdir}/lib%{name}.so %{_includedir}/gk*.h %{_includedir}/GKlib.h %changelog %autochangelog