%global commit fa871ecba4333ffe9a96b0a662b9d77089cf69b7 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: libnitrokey Version: 3.0 Release: 0.2.20171007git.%{shortcommit}%{?dist} Summary: Communicate with Nitrokey stick devices in a clean and easy manner License: LGPLv3+ URL: https://github.com/Nitrokey/libnitrokey Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: cmake >= 3.1 BuildRequires: gcc-c++ BuildRequires: hidapi-devel BuildRequires: catch-devel %description Libnitrokey is a project to communicate with Nitrokey Pro and Storage devices in a clean and easy manner. %package devel Summary: Development libraries and header files for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} # Headers have #include for hidapi.h Requires: hidapi-devel%{?_isa} %description devel This package contains development libraries and header files are needed to develop using libnitrokey. %prep %autosetup -n %{name}-%{commit} -p1 # Remove inttypes.h rm -vrf include/inttypes.h sed -i -e "/inttypes.h/d" CMakeLists.txt # Remove catch rm -vrf unittest/Catch sed -i -e "/#include/s|catch\.hpp|catch/catch.hpp|" unittest/*.cpp unittest/*.cc # Remove hidapi rm -vrf hidapi include/hidapi %build mkdir -p %{_target_platform} pushd %{_target_platform} %cmake \ -DLIBNITROKEY_STATIC=FALSE \ .. popd %make_build -C %{_target_platform} %install %make_install -C %{_target_platform} %check pushd %{_target_platform} ctest -VV popd %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE %doc README.md %{_libdir}/libnitrokey.so.* %{_libdir}/libnitrokey-log.so.* %files devel %{_libdir}/libnitrokey.so %{_libdir}/libnitrokey-log.so %{_includedir}/libnitrokey/ %changelog * Sat Oct 07 2017 Igor Gnatenko - 3.0-0.2.20171007git.fa871ec - Update to latest snapshot * Sat Oct 07 2017 Igor Gnatenko - 3.0-0.1.20171007git.544f69c - Initial package