summaryrefslogtreecommitdiffstats
path: root/net/sngrep/Makefile
blob: 3630f9fba8d9bae61f050a9d7a1f7775860f30d3 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=sngrep

PKG_VERSION:=1.6.0
PKG_RELEASE:=1

PKG_MAINTAINER:=
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:irontec:sngrep

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/irontec/sngrep/releases/download/v$(PKG_VERSION)
PKG_HASH:=fd80964d6560f2ff57b4f5bef2353d1a6f7c48d2f1a5f0a167c854bd2e801999

PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1

PKG_CONFIG_DEPENDS:= \
	CONFIG_IPV6 \
	CONFIG_SNGREP_ENABLE_EEP \
	CONFIG_SNGREP_WITH_PCRE \
	CONFIG_SNGREP_WITH_ZLIB

include $(INCLUDE_DIR)/package.mk

define Package/sngrep
  SECTION:=utils
  CATEGORY:=Utilities
  SUBMENU:=Telephony
  DEPENDS:= \
	  +libncursesw \
	  +libopenssl \
	  +libpcap \
	  +SNGREP_WITH_PCRE:libpcre2 \
	  +SNGREP_WITH_ZLIB:zlib
  TITLE:=Ncurses SIP messages flow viewer
  URL:=https://github.com/irontec/sngrep
endef

define Package/sngrep/description
sngrep is a tool for displaying SIP calls message flows from terminal.

It supports live capture to display realtime SIP packets and can also be
used as PCAP viewer.
endef

define Package/sngrep/conffiles
/etc/sngreprc
endef

define Package/sngrep/config
  menu "sngrep configuration"
    depends on PACKAGE_sngrep

    config SNGREP_ENABLE_EEP
      bool "EEP/HEP support"
      default y
      help
        Enable EEP/HEP support

    config SNGREP_WITH_PCRE
      bool "PCRE support"
      default y
      help
        Enable Perl compatible regular expressions

    config SNGREP_WITH_ZLIB
      bool "zlib support"
      default y
      help
        Add support for opening gzip compressed input files
  endmenu
endef

CONFIGURE_ARGS += \
	--$(if $(CONFIG_SNGREP_ENABLE_EEP),en,dis)able-eep \
	--$(if $(CONFIG_IPV6),en,dis)able-ipv6 \
	--enable-unicode \
	--with-openssl \
	--without-pcre \
	--with$(if $(CONFIG_SNGREP_WITH_PCRE),,out)-pcre2 \
	--with$(if $(CONFIG_SNGREP_WITH_ZLIB),,out)-zlib

define Package/sngrep/install
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/sngreprc $(1)/etc
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sngrep $(1)/usr/bin
endef

$(eval $(call BuildPackage,sngrep))