summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 326c6eb9407635b9e5db401cb62247a229b29382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer:  Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: Gatien Bovyn <gatien.bovyn@gmail.com>
# Contributor: Guy Martin <gmsoft@tuxicoman.be>

# TODO: A systemd service
# TODO: How to fix registry: Configuration "startup" not found in the database

# This package functions as a server only.
# To use you must install the console or the webui interface

set -u
_pkgname='pom-ng'
pkgname="${_pkgname}-git"
pkgver=0.0.19.r0.g48da973
pkgrel=1
pkgdesc='Packet-o-Matic real time network packet capture forensic tool'
arch=('i686' 'x86_64')
url='http://www.packet-o-matic.org/'
license=('GPL')
depends=('libxml2' 'libmicrohttpd' 'xmlrpc-c' 'lua51' 'uthash' 'file' 'libpcap' 'zlib' 'libexif' 'sqlite')
optdepends=(
  'libjpeg: analyze jpeg images'
  'libexif: parse exif data from jpeg images'
  "${_pkgname}-webui: view and manage from a browser"
  "${_pkgname}-console: view and manage from a console"
  "${_pkgname}-addons"
  #'postgresql: store configurations and other (pick one)' # These will be enabled when postgre is supported. For now sqlite is required.
  #'sqlite: store configurations and other (pick one)'
)
makedepends=('git' 'gcc' 'binutils' 'make' 'libtool' 'pkg-config')
provides=("${_pkgname}=${pkgver%%.r*}")
conflicts=("${_pkgname}")
_srcdir="${pkgname^^}"
_giturl="https://github.com/gmsoft-tuxicoman/${_pkgname}"
_verwatch=("${_giturl}/releases.atom" '\s\+<title>v\([^<]\+\).*' 'f') # RSS
source=("${_srcdir}::${_giturl//https:/git:}.git")
sha256sums=('SKIP')

pkgver () {
  set -u
  cd "${_srcdir}"
  git describe --long --tags | sed -e 's:^v::g' -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g'
  set +u
}

prepare() {
  set -u
  cd "${_srcdir}"
  autoreconf -f -i
  lua_CFLAGS="$(pkg-config --cflags lua51)" \
  lua_LIBS="$(pkg-config --libs lua51)" \
  ./configure --prefix='/usr'
  #cp -p '/usr/include/libexif/exif-data.h' .
  set +u
}

build() {
  set -u
  cd "${_srcdir}"
  if [ ! -z "${MAKEFLAGS:-}" ] && [ "${MAKEFLAGS}" != "${MAKEFLAGS//-j/}" ]; then
    nice make -s
  else
    local _nproc="$(lscpu -p | grep '^[0-9]' | cut -d',' -f2-3 | sort -u | wc -l)"; _nproc=$((_nproc>4?4:_nproc))
    nice make -s -j "${_nproc}"
  fi
  set +u
}

package() {
  set -u
  cd "${_srcdir}"
  make -j1 DESTDIR="${pkgdir}" install
  install -d "${pkgdir}/usr/share/${_pkgname}/addons"
  set +u
}
set +u