upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / tlsh / trunk / PKGBUILD
blobbe6aa6819df80105972b6e57ec0317ec50ab4e9c
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 pkgbase=tlsh
4 pkgname=('tlsh' 'python-tlsh')
5 pkgver=4.8.2
6 pkgrel=2
7 pkgdesc='Fuzzy matching library that generates a hash value which can be used for similarity comparisons'
8 url='https://github.com/trendmicro/tlsh'
9 arch=('x86_64')
10 license=('Apache')
11 makedepends=('cmake' 'python' 'gcc-libs')
12 source=(https://github.com/trendmicro/${pkgbase}/archive/${pkgver}/${pkgbase}-${pkgver}.tar.gz)
13 sha256sums=('0528294fbb1fe3659db564dd0b7b1b27fc41280a8408e4f7abf7e8b27f7b1ac6')
14 sha512sums=('5355c7734f5356a3a7a31ccc078254835871fc0369f1889a34131a0f810735201c68f674eb18e975b6a03a32e5c284899ca9ffdc1f583e42192188c172d2aad0')
16 prepare() {
17   cd ${pkgbase}-${pkgver}
18   # remove garbage
19   sed '/set(CMAKE_EXE_LINKER_FLAGS/d' -i CMakeLists.txt
20   sed '/set(CMAKE_CXX_FLAGS/d' -i CMakeLists.txt
21   sed 's|TLSH_SHARED_LIBRARY 0|TLSH_SHARED_LIBRARY 1|' -i src/CMakeLists.txt
24 build() {
25   cd ${pkgbase}-${pkgver}
26   mkdir -p build
27   (cd build
28     cmake .. \
29       -DCMAKE_BUILD_TYPE=None \
30       -DCMAKE_INSTALL_PREFIX:PATH=/usr \
31       -DCMAKE_CXX_FLAGS="${CXXFLAGS} ${CPPFLAGS}"
32     make
33   )
34   (cd bin
35     cmake -E create_symlink tlsh_unittest tlsh
36   )
37   (cd py_ext
38     python setup.py build
39   )
42 check() {
43   cd ${pkgbase}-${pkgver}
44   (cd build
45     make test
46   )
47   (cd Testing
48     ./test.sh
49   )
52 package_tlsh() {
53   depends=('gcc-libs')
54   provides=('libtlsh.so')
55   cd ${pkgbase}-${pkgver}
56   make -C build DESTDIR="${pkgdir}" install
57   install -Dm 755 bin/tlsh_unittest -t "${pkgdir}/usr/bin"
58   install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
61 package_python-tlsh() {
62   depends=('python')
63   cd ${pkgbase}-${pkgver}/py_ext
64   python setup.py install -O1 --root="${pkgdir}" --skip-build
67 # vim: ts=2 sw=2 et: