diff options
-rw-r--r-- | testing/captagent/APKBUILD | 69 | ||||
-rw-r--r-- | testing/captagent/build.patch | 48 | ||||
-rw-r--r-- | testing/captagent/captagent.initd | 18 | ||||
-rw-r--r-- | testing/captagent/default-config.patch | 11 |
4 files changed, 146 insertions, 0 deletions
diff --git a/testing/captagent/APKBUILD b/testing/captagent/APKBUILD new file mode 100644 index 0000000000..7891635b2a --- /dev/null +++ b/testing/captagent/APKBUILD @@ -0,0 +1,69 @@ +# Contributor: Leonardo Arena <rnalrd@alpinelinux.org> +# Contributor: Natanael Copa <ncopa@alpinelinux.org> +# Maintainer: +pkgname=captagent +pkgver=6.0.1 +pkgrel=0 +pkgdesc="Standalone agent for HOMER, a SIP capture and monitoring system" +url="https://github.com/sipcapture/captagent" +arch="all" +license="GPL3" +depends= +depends_dev= +makedepends="$depends_dev autoconf automake libtool bison libpcap-dev flex + flex-dev flex-libs json-c-dev linux-headers expat-dev" +install= +subpackages="$pkgname-dev" +source="$pkgname-$pkgver.tar.gz::https://github.com/sipcapture/captagent/archive/v$pkgver.tar.gz + build.patch + default-config.patch + captagent.initd + " + + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac + done + ./build.sh +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + install -D -m0664 "$_builddir"/conf/database_hash.xml \ + "$pkgdir"/etc/captagent/database_hash.xml + libtool --finish "$pkgdir"/usr/lib/captagent/modules + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname +} + +md5sums="d4039723cc7ea66c33d911ae1d0f182a captagent-6.0.1.tar.gz +fa80597864c1d0f2078780578cce4e71 build.patch +65c7c46864ebff66ccd25033a6e195fd default-config.patch +e08448976f57ef7dd80c628e1e4866a4 captagent.initd" +sha256sums="88e92a0d71b7d39fcbd52e947a98f42f62a54dc94ad857c68f9b05349b5409ec captagent-6.0.1.tar.gz +7f80b504d6d281d6727ffa65f87dff53a7c36c0144cd6fb0ec37863fee53d091 build.patch +37cce9bed56e29621ab8fdd1f1819744823cfcc6cb155d799b2180e2e0f3b0e3 default-config.patch +a32508e6908f95975571cb471dbc79e64678ef26a06925ffa88bbb3d519a53a3 captagent.initd" +sha512sums="ef78bb2bb0f8c72b54116ec2757e0b604b21010161526c4223c2159b2e37c6526b5ebe8eeea7c553f3550c082797894fe3673381e07e0b927627f70d7ebfbef0 captagent-6.0.1.tar.gz +b7188f5f14aadad7bbbb1819b40c245eb5e5f4cc5b92582771bf9f494630b1e39d5c3cb8e51ef250b55ed40309c3e38d2be8281b0b998b2613ca8a168808a746 build.patch +0808b9a2564618f2a7df695101cb713929ae52a77df4709608d4e6e8e38d3cadb75770575d2275347eda0d0521a695ed71785f833459e838ad73b4525d5a10b0 default-config.patch +ab9055cbaa8fffc9ab7fec3f12438350283ab8f039ada7589bbfa1d07c81dac142a7ee46f11652d2a1fc8c9ecb4eb771dcf3f4cd46c5174f215ac6647c6eaafe captagent.initd" diff --git a/testing/captagent/build.patch b/testing/captagent/build.patch new file mode 100644 index 0000000000..c4976559cc --- /dev/null +++ b/testing/captagent/build.patch @@ -0,0 +1,48 @@ +diff --git a/configure.ac b/configure.ac +index 525738c..4fbfa5b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -147,15 +147,8 @@ fi + AC_CHECK_LIB(expat, XML_ParserCreate, , [AC_MSG_ERROR([captagent requires but cannot find libexpat])]) + AC_CHECK_LIB(pcap, pcap_open_live, ,[AC_CHECK_LIB(wpcap, pcap_open_live, ,[AC_MSG_ERROR([captagent requires but cannot find libpcap])])]) + +-AC_CHECK_LIB(json, json_object_get,[ JSON_LIBS="-ljson" ],[ +-AC_CHECK_LIB(json-c, json_object_get,[ JSON_LIBS="-ljson-c" ],[ +-echo "ERROR: You need libjson to build CaptAgent API module."; +-echo " Verify that you have libjson.a or libjson.so installed"; +-echo " If it is in a different directory, try using"; +-echo " the LDFLAGS to set its proper path."; +-AC_MSG_ERROR([Fatal: libjson not found.])])]) +- +-AC_CHECK_LIB(fl, yywrap, [ FLEX_LIBS="-lfl" ] , [AC_MSG_ERROR([captagent requires but cannot find libfl])]) ++PKG_CHECK_MODULES(JSON, json-c) ++FLEX_LIBS="-lfl" + + AC_SUBST(PTHREAD_LIBS) + AC_SUBST(DL_LIBS) +diff --git a/src/modules/transport/json/Makefile.am b/src/modules/transport/json/Makefile.am +index 5778a67..db5078e 100644 +--- a/src/modules/transport/json/Makefile.am ++++ b/src/modules/transport/json/Makefile.am +@@ -4,7 +4,7 @@ SUBDIRS = . + noinst_HEADERS = transport_json.h + # + transport_json_la_SOURCES = transport_json.c +-transport_json_la_CFLAGS = -Wall ${MODULE_CFLAGS} ++transport_json_la_CFLAGS = -Wall ${MODULE_CFLAGS} ${JSON_CFLAGS} + transport_json_la_LDFLAGS = -module -avoid-version + transport_json_la_LIBADD = ${PTHREAD_LIBS} ${EXPAT_LIBS} ${JSON_LIBS} + transport_json_laconfdir = $(confdir) +diff --git a/src/modules/transport/json/transport_json.c b/src/modules/transport/json/transport_json.c +index 4c7ed4b..c6d3691 100644 +--- a/src/modules/transport/json/transport_json.c ++++ b/src/modules/transport/json/transport_json.c +@@ -41,7 +41,7 @@ + #include <signal.h> + #include <time.h> + #include <pthread.h> +-#include <json/json.h> ++#include <json.h> + + #ifndef __FAVOR_BSD + #define __FAVOR_BSD diff --git a/testing/captagent/captagent.initd b/testing/captagent/captagent.initd new file mode 100644 index 0000000000..0b182e6403 --- /dev/null +++ b/testing/captagent/captagent.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +command=/usr/bin/captagent +pidfile=/var/run/${SVCNAME}.pid +conf=/etc/captagent/${SVCNAME}.xml + +#start_stop_daemon_args="--make-pidfile" + +depend() { + need net + after firewall +} + +start_pre() { + #checkpath --directory ${pidfile%/*} + command_args="-d -f $conf" +} + diff --git a/testing/captagent/default-config.patch b/testing/captagent/default-config.patch new file mode 100644 index 0000000000..00a79a2021 --- /dev/null +++ b/testing/captagent/default-config.patch @@ -0,0 +1,11 @@ +--- a/conf/captagent.xml ++++ b/conf/captagent.xml +@@ -9,7 +9,7 @@ + <param name="daemon" value="false"/> + <param name="syslog" value="false"/> + <param name="pid_file" value="/var/run/captagent.pid"/> +- <param name="module_path" value="/usr/lib64/captagent/modules"/> ++ <param name="module_path" value="/usr/lib/captagent/modules"/> + <param name="config_path" value="/etc/captagent"/> + <param name="capture_plans_path" value="/etc/captagent/captureplans"/> + <param name="backup" value="/etc/captagent/backup"/> |