aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
Diffstat (limited to 'community')
-rw-r--r--community/captagent/0001-Define-PATH_MAX-if-not-defined.patch30
-rw-r--r--community/captagent/APKBUILD36
-rw-r--r--community/captagent/ac-fix.patch12
-rw-r--r--community/captagent/captagent.initd13
-rw-r--r--community/homer-api/APKBUILD61
-rw-r--r--community/homer-api/homer_db_init24
-rw-r--r--community/homer-api/rotation-ini-path.patch28
-rw-r--r--community/homer-ui/APKBUILD37
8 files changed, 241 insertions, 0 deletions
diff --git a/community/captagent/0001-Define-PATH_MAX-if-not-defined.patch b/community/captagent/0001-Define-PATH_MAX-if-not-defined.patch
new file mode 100644
index 0000000000..27de02c9aa
--- /dev/null
+++ b/community/captagent/0001-Define-PATH_MAX-if-not-defined.patch
@@ -0,0 +1,30 @@
+From 15fc71cc82f2dc93321b60d557efdc968f5d9433 Mon Sep 17 00:00:00 2001
+From: Breno Leitao <breno.leitao@gmail.com>
+Date: Tue, 9 May 2017 16:54:49 +0000
+Subject: [PATCH] Define PATH_MAX if not defined
+
+On systems without glibc, you might lack definition of PATH_MAX.
+Defining it as already defined it for interface_http.c as defined in
+civetweb.c.
+---
+ src/modules/interface/http/interface_http.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/modules/interface/http/interface_http.c b/src/modules/interface/http/interface_http.c
+index 5c71e8e..4686c89 100644
+--- a/src/modules/interface/http/interface_http.c
++++ b/src/modules/interface/http/interface_http.c
+@@ -53,6 +53,10 @@
+ #include <json.h>
+ #endif
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ #include <captagent/globals.h>
+ #include <captagent/api.h>
+ #include <captagent/structure.h>
+--
+2.12.2
+
diff --git a/community/captagent/APKBUILD b/community/captagent/APKBUILD
new file mode 100644
index 0000000000..a3bfcb13e8
--- /dev/null
+++ b/community/captagent/APKBUILD
@@ -0,0 +1,36 @@
+# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+pkgname=captagent
+pkgver=6.1.0.20
+pkgrel=3
+pkgdesc="HEP Capture Agent for HOMER"
+url="https://github.com/sipcapture/captagent"
+arch="all"
+license="GPL3"
+makedepends="autoconf automake bison expat-dev flex flex-dev json-c-dev libtool libpcap-dev linux-headers"
+source="$pkgname-$pkgver.tar.gz::https://github.com/sipcapture/captagent/archive/$pkgver.tar.gz
+ $pkgname.initd
+ 0001-Define-PATH_MAX-if-not-defined.patch
+ ac-fix.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir" && ./build.sh && ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc &&
+ make
+}
+
+package() {
+ cd "$builddir" && make install DESTDIR="$pkgdir" && \
+ install -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname && \
+ rm "$pkgdir"/usr/lib/$pkgname/modules/*.a
+}
+
+sha512sums="b867a41dfe98015f01fa8c67e57214754231eeec40d0685983fca9aacf53cc5287c2c9959f4752c80004ad5abc2e8a96058797b6b7cdc259a48443c1a909b609 captagent-6.1.0.20.tar.gz
+750326291fc65fa9a3568f6961f2d6b950baa715e75ad7fc8263956cc91c50445e2e041d8f73675a350ba0d55786908564b439396376d8105fb69332e8aefc27 captagent.initd
+f7c04f5e273dd362f09fd1e6a605f56dcaf64c71cd0d6ba16dadaca5e005b1f29dccd81b186c3727d2fc7872bd684ca4ddc8fc7a2a36fd83956592a134ea6a37 0001-Define-PATH_MAX-if-not-defined.patch
+c0bbbbf2f96c7644b154e71b672af5a0d7c209dd5b309b6f6b35915a04f30a33ff4fc18e408e3f1641d4ca6ae51430f9ac0189984f828353263fb52e985b47c1 ac-fix.patch"
diff --git a/community/captagent/ac-fix.patch b/community/captagent/ac-fix.patch
new file mode 100644
index 0000000000..cbd049c11e
--- /dev/null
+++ b/community/captagent/ac-fix.patch
@@ -0,0 +1,12 @@
+diff -ru captagent-6.1.0.20/configure.ac captagent-6.1.0.20.alpine/configure.ac
+--- captagent-6.1.0.20/configure.ac 2016-06-01 14:42:19.000000000 +0300
++++ captagent-6.1.0.20.alpine/configure.ac 2017-02-03 22:06:46.098797592 +0200
+@@ -181,7 +181,7 @@
+ 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])])
++FLEX_LIBS="-lfl"
+
+ AC_SUBST(PTHREAD_LIBS)
+ AC_SUBST(DL_LIBS)
diff --git a/community/captagent/captagent.initd b/community/captagent/captagent.initd
new file mode 100644
index 0000000000..4d5d8b9eb7
--- /dev/null
+++ b/community/captagent/captagent.initd
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+
+# init.d file for captagent
+# Copyright (c) 2017 Kaarle Ritvanen
+
+name=captagent
+command=/usr/bin/$name
+command_args=-d
+pidfile=/var/run/$name.pid
+
+depend() {
+ need net
+}
diff --git a/community/homer-api/APKBUILD b/community/homer-api/APKBUILD
new file mode 100644
index 0000000000..4e702e52fb
--- /dev/null
+++ b/community/homer-api/APKBUILD
@@ -0,0 +1,61 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+pkgname=homer-api
+pkgver=5.0.6
+pkgrel=9
+pkgdesc="HOMER API"
+url="https://github.com/sipcapture/homer-api"
+arch="noarch"
+license="GPL"
+depends="homer-db php7-ctype php7-json php7-pdo_mysql php7-session"
+makedepends="$depends_dev"
+options="!check"
+subpackages="$pkgname-doc homer-db"
+source="$pkgname-$pkgver.tar.gz::https://github.com/sipcapture/homer-api/archive/$pkgver.tar.gz
+ homer_db_init
+ rotation-ini-path.patch"
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ return 0
+}
+
+package() {
+ cd "$builddir"
+ local file
+ local appdir=$pkgdir/usr/share/webapps/homer
+
+ mkdir -p "$appdir" \
+ "$pkgdir"/etc/homer \
+ "$pkgdir"/usr/share/doc/homer-api
+
+ mv api "$appdir"
+
+ for file in configuration preferences; do
+ mv "$appdir"/api/${file}_example.php "$pkgdir"/etc/homer/$file.php
+ ln -s /etc/homer/$file.php "$appdir"/api
+ done
+
+ cp -R examples "$pkgdir"/usr/share/doc/homer-api
+}
+
+db() {
+ depends="mariadb-client perl perl-dbi perl-dbd-mysql"
+
+ cd "$builddir"
+ mkdir -p \
+ "$subpkgdir"/etc/periodic/daily \
+ "$subpkgdir"/usr/share/homer-db
+
+ install -D -m 644 scripts/rotation.ini \
+ "$subpkgdir"/etc/homer/rotation.ini
+ cp -pr sql/* "$subpkgdir"/usr/share/homer-db
+
+ install -D "$srcdir"/homer_db_init "$subpkgdir"/usr/bin/homer_db_init
+ cp -p scripts/homer_* "$subpkgdir"/usr/bin
+ ln -s /usr/bin/homer_rotate "$subpkgdir"/etc/periodic/daily
+}
+
+sha512sums="620185c19bd348ba68bad3a1992b7d673d29dcfb8a0aeea437a2d31e90f0a21cf6f46a43f0041a583a14d9403e1d8574c6040da1dba397ec2d955b8aba9010d8 homer-api-5.0.6.tar.gz
+e305af57a8445b45cb1e894aa34ceea3aeedb60740a636229d470d872f9ebb835e03985faeb685180a3e2c1eae29b49c841f8cbdb4236dbf0323f905a30b0bbb homer_db_init
+0328c4f645601be150f877a31a8c245908da9d9972bed6e1af50f2c43055c9f47376da30c666b6eaa0310637414f65906b88f9a339a1dfa14e1864c70b36fa77 rotation-ini-path.patch"
diff --git a/community/homer-api/homer_db_init b/community/homer-api/homer_db_init
new file mode 100644
index 0000000000..c80328ac6a
--- /dev/null
+++ b/community/homer-api/homer_db_init
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+
+# HOMER database setup script
+# Copyright (c) 2017 Kaarle Ritvanen
+
+exec_sql() {
+ mysql $2 < /usr/share/homer-db/$1.sql
+}
+
+exec_sql homer_databases
+exec_sql homer_user
+
+for db in configuration data statistic; do
+ exec_sql schema_$db homer_$db
+done
+
+homer_rotate
+
+[ "$1" = -r ] || exit 0
+
+mysql <<EOF
+CREATE USER 'homer_user' IDENTIFIED BY 'homer_password';
+GRANT SELECT ON homer_data.* TO 'homer_user';
+EOF
diff --git a/community/homer-api/rotation-ini-path.patch b/community/homer-api/rotation-ini-path.patch
new file mode 100644
index 0000000000..52d42f7b09
--- /dev/null
+++ b/community/homer-api/rotation-ini-path.patch
@@ -0,0 +1,28 @@
+--- homer-api-5.0.6/scripts/homer_partremove
++++ homer-api-5.0.6.alpine/scripts/homer_partremove
+@@ -3,9 +3,8 @@
+ # Set correct bin path if we are running as a cron job
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+-bin_dir=`dirname $0`
+-programm="$bin_dir/homer_mysql_remove_partitions.pl"
+-config="$bin_dir/rotation.ini"
++programm="homer_mysql_remove_partitions.pl"
++config=/etc/homer/rotation.ini
+
+ $programm $config
+
+--- homer-api-5.0.6/scripts/homer_rotate
++++ homer-api-5.0.6.alpine/scripts/homer_rotate
+@@ -3,9 +3,8 @@
+ # Set correct bin path if we are running as a cron job
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+-bin_dir=`dirname $0`
+-programm="$bin_dir/homer_mysql_rotate.pl"
+-config="$bin_dir/rotation.ini"
++programm="homer_mysql_rotate.pl"
++config=/etc/homer/rotation.ini
+
+ if [ $# -ne 0 ]
+ then
diff --git a/community/homer-ui/APKBUILD b/community/homer-ui/APKBUILD
new file mode 100644
index 0000000000..0dc31c5cb5
--- /dev/null
+++ b/community/homer-ui/APKBUILD
@@ -0,0 +1,37 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=homer-ui
+pkgver=5.0.6
+pkgrel=2
+pkgdesc="HOMER User-Interface"
+url="https://github.com/sipcapture/homer-ui"
+arch="noarch"
+license="AGPL3"
+depends="homer-api"
+depends_dev=
+makedepends="$depends_dev"
+install=
+subpackages=
+pkggroups="www-data"
+source="$pkgname-$pkgver.tar.gz::https://github.com/sipcapture/homer-ui/archive/${pkgver}.tar.gz"
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ return 0
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/usr/share/webapps/homer "$pkgdir"/etc/homer
+ mv "$builddir"/* "$pkgdir"/usr/share/webapps/homer
+ chown -R :www-data "$pkgdir"/usr/share/webapps/homer/store/dashboard
+ chmod 775 "$pkgdir"/usr/share/webapps/homer/store/dashboard
+ chmod 664 "$pkgdir"/usr/share/webapps/homer/store/dashboard/*
+ mv "$pkgdir"/usr/share/webapps/homer/store/dashboard "$pkgdir"/etc/homer/ || return 1
+ ln -s /etc/homer/dashboard "$pkgdir"/usr/share/webapps/homer/store/dashboard || return 1
+}
+
+md5sums="5394aef2d72a8624178d08a048db215f homer-ui-5.0.6.tar.gz"
+sha256sums="8fe40079b888eb7e485d2faa369329edd217695a451869411034987f5be1deb2 homer-ui-5.0.6.tar.gz"
+sha512sums="14fe5b7064be94c01fdc1a498b635fca23df03310a5ec0fa28b7c395971286749f3b4b1abda56f1c3ebaf6d6fd9c99db317f00dead07efc999e8aa11645406ec homer-ui-5.0.6.tar.gz"