[arch-commits] Commit in tlsh/repos (4 files)

Felix Yan felixonmars at archlinux.org
Sun Jul 8 08:06:22 UTC 2018


    Date: Sunday, July 8, 2018 @ 08:06:21
  Author: felixonmars
Revision: 354667

archrelease: copy trunk to community-staging-x86_64

Added:
  tlsh/repos/community-staging-x86_64/
  tlsh/repos/community-staging-x86_64/PKGBUILD
    (from rev 354665, tlsh/trunk/PKGBUILD)
  tlsh/repos/community-staging-x86_64/dont-use-rpath.patch
    (from rev 354665, tlsh/trunk/dont-use-rpath.patch)
  tlsh/repos/community-staging-x86_64/install-libraries.patch
    (from rev 354665, tlsh/trunk/install-libraries.patch)

-------------------------+
 PKGBUILD                |   80 ++++++++++++++++++++++++++++++++++++++++++++++
 dont-use-rpath.patch    |   46 ++++++++++++++++++++++++++
 install-libraries.patch |   23 +++++++++++++
 3 files changed, 149 insertions(+)

Copied: tlsh/repos/community-staging-x86_64/PKGBUILD (from rev 354665, tlsh/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2018-07-08 08:06:21 UTC (rev 354667)
@@ -0,0 +1,80 @@
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+
+pkgbase=tlsh
+pkgname=('tlsh' 'python-tlsh' 'python2-tlsh')
+pkgver=3.4.5
+pkgrel=4
+pkgdesc='Fuzzy matching library that generates a hash value which can be used for similarity comparisons'
+url='https://github.com/trendmicro/tlsh'
+arch=('x86_64')
+license=('Apache')
+makedepends=('cmake' 'python' 'python2' 'gcc-libs')
+source=(${pkgname}-${pkgver}.tar.gz::https://github.com/trendmicro/${pkgname}/archive/v${pkgver}.tar.gz
+        dont-use-rpath.patch
+        install-libraries.patch)
+sha512sums=('039f9fb9fb467a9b22f85a621c46069bac1745da039657840e1ff1a53901392fcf29d3c953b0f47d831d022a5e2594925c726d4ff921614418a3bb023a4ebbdc'
+            '6b7d32c24151c6513918875011339990bdf4638a4f03c166b5144efe10a4bb5bf1da0401951f78a75f7e197c81a03b4ae540e22cd3ce9f2f2c99f0436780d510'
+            '448dc550df26c756b8fef7b774d193336d63f7fa2f01683308ddfd042edbe60677adad23c95e27b3d98ce7d6c734110cf218335bbc8bd0ce57dccf3eaa63a065')
+
+prepare() {
+  cd ${pkgbase}-${pkgver}
+  patch -p1 < "${srcdir}/install-libraries.patch"
+  patch -p1 < "${srcdir}/dont-use-rpath.patch"
+  cp -ra py_ext{,-py2}
+  cp Testing/python_test.sh Testing/python2_test.sh
+  sed 's|py_ext|py_ext-py2|g' -i Testing/python2_test.sh
+}
+
+build() {
+  cd ${pkgbase}-${pkgver}
+  mkdir -p build
+  (cd build
+    cmake .. \
+      -DCMAKE_BUILD_TYPE=RELEASE \
+      -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+      -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib
+    make
+  )
+  (cd bin
+    cmake -E create_symlink tlsh_unittest tlsh
+  )
+  (cd py_ext
+    python setup.py build
+  )
+  (cd py_ext-py2
+    python2 setup.py build
+  )
+}
+
+check() {
+  cd ${pkgbase}-${pkgver}
+  (cd build
+    make test
+  )
+  Testing/python_test.sh
+  Testing/python2_test.sh python2
+}
+
+package_tlsh() {
+  depends=('gcc-libs')
+  cd ${pkgbase}-${pkgver}
+  install -Dm 755 bin/tlsh_unittest "${pkgdir}/usr/bin/tlsh_unittest"
+  install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
+  (cd build
+    make DESTDIR="${pkgdir}" install
+  )
+}
+
+package_python-tlsh() {
+  depends=('python')
+  cd ${pkgbase}-${pkgver}/py_ext
+  python setup.py install -O1 --root="${pkgdir}" --skip-build
+}
+
+package_python2-tlsh() {
+  depends=('python2')
+  cd ${pkgbase}-${pkgver}/py_ext-py2
+  python2 setup.py install -O1 --root="${pkgdir}" --skip-build
+}
+
+# vim: ts=2 sw=2 et:

Copied: tlsh/repos/community-staging-x86_64/dont-use-rpath.patch (from rev 354665, tlsh/trunk/dont-use-rpath.patch)
===================================================================
--- community-staging-x86_64/dont-use-rpath.patch	                        (rev 0)
+++ community-staging-x86_64/dont-use-rpath.patch	2018-07-08 08:06:21 UTC (rev 354667)
@@ -0,0 +1,46 @@
+From 7363d0ec5c84e873d86defc8a02533e6debcb4bd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Wed, 27 Jan 2016 17:43:44 +0100
+Subject: [PATCH 1/2] do not set RPATH for tlsh_unittest
+
+Using RPATH leads to problem when linked libraries have their own
+dependencies. See: https://wiki.debian.org/RpathIssue
+---
+ test/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index bc92ffc..8b9181f 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -26,3 +26,4 @@ add_executable(tlsh_unittest tlsh_unittest.cpp)
+ target_link_libraries(tlsh_unittest tlsh_shared)
+ set_target_properties(tlsh_unittest PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
+ set_target_properties(tlsh_unittest PROPERTIES OUTPUT_NAME tlsh_unittest${BUILD_POSTFIX})
++set_target_properties(tlsh_unittest PROPERTIES SKIP_BUILD_RPATH TRUE)
+-- 
+2.7.0
+
+
+From 9f6f94efe8c900a522607e2cbf7f2d443511c3b5 Mon Sep 17 00:00:00 2001
+From: anthraxx <levente at leventepolyak.net>
+Date: Wed, 27 Jan 2016 19:01:12 +0100
+Subject: [PATCH 2/2] set LD_PRELOAD for running tests against local shared
+ library
+
+---
+ Testing/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt
+index 42c739f..c7276b8 100644
+--- a/Testing/CMakeLists.txt
++++ b/Testing/CMakeLists.txt
+@@ -3,3 +3,4 @@
+ # instead
+ add_test(tlsh_unittest_len "${CMAKE_SOURCE_DIR}/Testing/test.sh")
+ add_test(tlsh_unittest_xlen "${CMAKE_SOURCE_DIR}/Testing/test.sh" "-xlen")
++set_tests_properties(tlsh_unittest_len tlsh_unittest_xlen PROPERTIES ENVIRONMENT "LD_PRELOAD=${CMAKE_SOURCE_DIR}/lib/libtlsh.so.0")
+-- 
+2.7.0
+

Copied: tlsh/repos/community-staging-x86_64/install-libraries.patch (from rev 354665, tlsh/trunk/install-libraries.patch)
===================================================================
--- community-staging-x86_64/install-libraries.patch	                        (rev 0)
+++ community-staging-x86_64/install-libraries.patch	2018-07-08 08:06:21 UTC (rev 354667)
@@ -0,0 +1,23 @@
+From fb71fc45992a9adf73b3c8194bdd691391ca34d7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Wed, 27 Jan 2016 17:44:06 +0100
+Subject: [PATCH] install the library in expected directories
+
+We add CMake install directives in order to see the library files installed in
+the expected multiarch compatible locations.
+---
+ src/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b1c92fb..c8d3fd9 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -21,3 +21,7 @@ set_target_properties(tlsh_shared PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SO
+ set_target_properties(tlsh_shared PROPERTIES OUTPUT_NAME tlsh${BUILD_POSTFIX})
+ set_target_properties(tlsh_shared PROPERTIES VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
+                                              SOVERSION "0")
++
++include(GNUInstallDirs)
++install(TARGETS tlsh tlsh_shared DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(FILES ../include/tlsh.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})



More information about the arch-commits mailing list