Name: tlsh Version: 3.4.5 Release: 1%{?dist} Summary: Fuzzy text matching library License: ASL 2.0 URL: https://github.com/trendmicro/tlsh Source0: https://github.com/trendmicro/tlsh/archive/v%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: python2-devel BuildRequires: python3-devel #Requires: %global _description TLSH is a fuzzy matching library. Given a byte stream with a minimum \ length of 256 bytes (and a minimum amount of randomness), TLSH \ generates a hash value which can be used for similarity comparisons. \ Similar objects will have similar hash values which allows for the \ detection of similar objects by comparing their hash values. %description %_description %package devel Summary: Development files for TLSH Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary}. %package -n python2-tlsh Summary: Python 2 interface for TLSH %{?python_provide:%python_provide python2-tlsh} %description -n python2-tlsh %_description This package contains the %{summary}. %package -n python3-tlsh Summary: Python 3 interface for TLSH %{?python_provide:%python_provide python3-tlsh} %description -n python3-tlsh %_description This package contains the %{summary}. %prep %autosetup # I'm just loving cmake more every day echo 'set(CMAKE_CXX_FLAGS "%{optflags} -fPIC")' | \ tee -a src/CMakeLists.txt |\ tee -a test/CMakeLists.txt |\ tee -a utils/CMakeLists.txt %build mkdir build pushd build %cmake .. popd %make_build -C build pushd py_ext %py2_build %py3_build popd %install mkdir -p %{buildroot}%{_libdir} %{buildroot}%{_includedir} cp -a lib/libtlsh.so* %{buildroot}%{_libdir}/ cp -a include %{buildroot}%{_includedir}/tlsh pushd py_ext %py2_install %py3_install popd %global _docdir_fmt %{name} %check bin/tlsh_version bin/simple_unittest # just check if we get 0 for identical files, and non-zero for different files bin/tlsh_unittest -c bin/tlsh_unittest -f bin/tlsh_unittest | grep -E '\b0\b' bin/tlsh_unittest -c bin/tlsh_unittest -f bin/simple_unittest | grep -vE '\b0\b' PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} \ -c "import tlsh; print(tlsh.hash(open('LICENSE', 'rb').read()))" PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} \ -c "import tlsh; print(tlsh.hash(open('LICENSE', 'rb').read()))" %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE NOTICE.txt %doc README.md %doc TLSH_CTC_final.pdf %doc TLSH_Introduction.pdf %doc Attacking_LSH_and_Sim_Dig.pdf %_libdir/libtlsh.so.* %files devel %{_includedir}/tlsh %_libdir/libtlsh.so %files -n python2-tlsh %license LICENSE NOTICE.txt %doc README.md %{python2_sitearch}/* %files -n python3-tlsh %license LICENSE NOTICE.txt %doc README.md %{python3_sitearch}/* %changelog * Wed Mar 9 2016 Zbigniew Jędrzejewski-Szmek - 3.4.5-1 - Initial version