[arch-commits] Commit in tlsh/repos/community-x86_64 (5 files)

Levente Polyak anthraxx at archlinux.org
Thu Jan 28 13:02:15 UTC 2016


    Date: Thursday, January 28, 2016 @ 14:02:15
  Author: anthraxx
Revision: 159316

archrelease: copy trunk to community-x86_64

Added:
  tlsh/repos/community-x86_64/PKGBUILD
    (from rev 159315, tlsh/trunk/PKGBUILD)
  tlsh/repos/community-x86_64/dont-use-rpath.patch
    (from rev 159315, tlsh/trunk/dont-use-rpath.patch)
  tlsh/repos/community-x86_64/install-libraries.patch
    (from rev 159315, tlsh/trunk/install-libraries.patch)
Deleted:
  tlsh/repos/community-x86_64/PKGBUILD
  tlsh/repos/community-x86_64/fix-python3.patch

-------------------------+
 PKGBUILD                |  151 ++++++++++++++++++++++++----------------------
 dont-use-rpath.patch    |   46 ++++++++++++++
 fix-python3.patch       |   35 ----------
 install-libraries.patch |   23 +++++++
 4 files changed, 149 insertions(+), 106 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2016-01-28 13:02:10 UTC (rev 159315)
+++ PKGBUILD	2016-01-28 13:02:15 UTC (rev 159316)
@@ -1,71 +0,0 @@
-# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
-
-pkgbase=tlsh
-pkgname=('tlsh' 'python-tlsh' 'python2-tlsh')
-pkgver=3.4.4
-pkgrel=1
-pkgdesc='Fuzzy matching library that generates a hash value which can be used for similarity comparisons'
-url='https://github.com/trendmicro/tlsh'
-arch=('i686' '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
-        fix-python3.patch)
-sha512sums=('c4897cf70cfef555638b14e2a77e550fd52dc3c23ca7dd98077d37478d944282b93c0019593c6e13a40df298a439fbdf20d0aa893aa1a78de0ea7b39ef76b572'
-            'aeafea636656fc974d0486acd37d210ffab14cd868c0e621170b5abc45ba68702826cea39cec41e2c8fe286b6ac0b85b3499c92e065abda21ce215a4c0a69bc4')
-
-prepare() {
-  cd ${pkgbase}-${pkgver}
-  patch -p1 < "${srcdir}/fix-python3.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 ..
-    make
-  )
-  (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"
-}
-
-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-x86_64/PKGBUILD (from rev 159315, tlsh/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2016-01-28 13:02:15 UTC (rev 159316)
@@ -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=1
+pkgdesc='Fuzzy matching library that generates a hash value which can be used for similarity comparisons'
+url='https://github.com/trendmicro/tlsh'
+arch=('i686' 'x86_64')
+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_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-x86_64/dont-use-rpath.patch (from rev 159315, tlsh/trunk/dont-use-rpath.patch)
===================================================================
--- dont-use-rpath.patch	                        (rev 0)
+++ dont-use-rpath.patch	2016-01-28 13:02:15 UTC (rev 159316)
@@ -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
+

Deleted: fix-python3.patch
===================================================================
--- fix-python3.patch	2016-01-28 13:02:10 UTC (rev 159315)
+++ fix-python3.patch	2016-01-28 13:02:15 UTC (rev 159316)
@@ -1,35 +0,0 @@
-From 243124159ad0fcbbb1329100c233bbfae40ca0de Mon Sep 17 00:00:00 2001
-From: anthraxx <levente at leventepolyak.net>
-Date: Sat, 5 Dec 2015 21:56:21 +0100
-Subject: [PATCH] convert arg to bytes object before passing to
- PyBytes_AsStringAndSize
-
-this fixes python3 and ensures for both, python2 and python3 that
-the passed argument is a string.
----
- py_ext/tlshmodule.cpp | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/py_ext/tlshmodule.cpp b/py_ext/tlshmodule.cpp
-index 409501b..8ed2335 100644
---- a/py_ext/tlshmodule.cpp
-+++ b/py_ext/tlshmodule.cpp
-@@ -178,6 +178,18 @@ Tlsh_fromTlshStr(tlsh_TlshObject *self, PyObject *args)
-         return PyErr_Format(PyExc_TypeError, "function takes exactly 1 argument (%lu given)", PyTuple_Size(args));
- 
-     arg = PyTuple_GetItem(args, 0);
-+#if PY_MAJOR_VERSION >= 3
-+    if (!PyUnicode_Check(arg) || (arg = PyUnicode_AsASCIIString(arg)) == NULL) {
-+      PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
-+      return NULL;
-+    }
-+#else
-+    if (!PyString_Check(arg)) {
-+      PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
-+      return NULL;
-+    }
-+#endif
-+
-     if (PyBytes_AsStringAndSize(arg, &str, &len) == -1) {
-         PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
-         return NULL;

Copied: tlsh/repos/community-x86_64/install-libraries.patch (from rev 159315, tlsh/trunk/install-libraries.patch)
===================================================================
--- install-libraries.patch	                        (rev 0)
+++ install-libraries.patch	2016-01-28 13:02:15 UTC (rev 159316)
@@ -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