diff --git a/ntopng/PKGBUILD b/ntopng/PKGBUILD new file mode 100644 index 0000000..4632800 --- /dev/null +++ b/ntopng/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: Giovanni Harting <539@idlegandalf.com> +# Contributor: Barry Smith +# Contributor: jrdemasi +# Contributor: Fernando Manfredi Contributor: Evan Teitelman +# Contributor: Ari Mizrahi +# Contributor: CRT + +validpgpkeys=('EFD9413B17293AFDFE6EA6F1402A088DEDF104CB') +pkgname=ntopng +pkgver=3.6.1 +_ndpiver=2.4 +pkgrel=1 +pkgdesc='The next generation version of the original ntop, a network traffic probe that shows the network usage' +arch=('x86_64' 'i686') +url='http://www.ntop.org/' +license=('GPL3') +depends=('redis' 'geoip' 'glib2' 'curl' 'libmaxminddb' 'libmariadbclient' 'libpcap' 'sqlite' 'json-c') +makedepends=('automake' 'libtool' 'wget' 'libxml2') +source=("https://github.com/ntop/$pkgname/archive/$pkgver.tar.gz" + "https://github.com/ntop/nDPI/archive/$_ndpiver.tar.gz" + "$pkgname.service" + "ntopng" + "mongoose.patch") + +sha512sums=('d4a2d24ab3ba0bd3af571afc5d68fda78d346f835b19d262da82805aca130b597bde6097eb69dcfd4e4a0b62da09e1d54d8db2039d0a0ff5ae50bafc5b768ef1' + '7c746c167ab3ebafbe8646f752c95e32d66237a0a86adeec9ded1ec7e20f62170a9b1c4e5d25594f6459f5c0f616c27c5b393151d936471590f16df3fa3fa884' + '6683760f787eea41d030736d4135f0ec0e48b9c2f2164c4e1a9e89acf80b140ce97b997f62b042861814dd823dee47af1f0456acd28ac7c37dab3695ef7267fb' + '86ab2590463652173f3d7861dfa7e6ba0818eb418c52bc1a7ade873bf5d3ef4ac12d5a35c2f22dea924d5b490eb20ae29bed2d402a82622935a6b3b9406386b7' + '3652880a2b1899950a8d534d57ffded396e4aa3238831993481d29a527a518ca1210c13c20330281d59c9b1c0287aed1a0312b152dc82e7f75aaaf284310a880') + +build() { + # build nDPI + cd $srcdir/nDPI-$_ndpiver + ./autogen.sh + ./configure + make + export NDPI_HOME=$srcdir/nDPI-$_ndpiver + + # build ntopng + cd $srcdir/$pkgname-$pkgver + patch -Np1 -i "${srcdir}/mongoose.patch" + ./autogen.sh + ./configure --prefix=/usr --datadir=/usr/share + make geoip + make +} + +package() { + cd $srcdir/$pkgname-$pkgver + + make install DESTDIR=$pkgdir + + mv $pkgdir/usr/{man,share/} + install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service" + install -Dm644 "$srcdir/$pkgname" "$pkgdir/etc/conf.d/$pkgname" +} + diff --git a/ntopng/mongoose.patch b/ntopng/mongoose.patch new file mode 100644 index 0000000..069cded --- /dev/null +++ b/ntopng/mongoose.patch @@ -0,0 +1,22 @@ +--- ntopng-3.4-old/third-party/mongoose/mongoose.c 2018-06-17 15:30:25.000000000 +0200 ++++ ntopng-3.4/third-party/mongoose/mongoose.c 2018-08-26 07:32:27.632828581 +0200 +@@ -247,7 +247,9 @@ + #define mg_rename(x, y) rename(x, y) + #define mg_sleep(x) usleep((x) * 1000) + #define ERRNO errno ++#ifndef INVALID_SOCKET + #define INVALID_SOCKET (-1) ++#endif + + /* ntop */ + #if ((ULONG_MAX) == (UINT_MAX)) +@@ -270,7 +272,9 @@ + #endif + + //#define INT64_FMT PRId64 ++#ifndef SOCKET + typedef int SOCKET; ++#endif + #define WINCDECL + + #endif // End of Windows and UNIX specific includes diff --git a/ntopng/ntopng b/ntopng/ntopng new file mode 100644 index 0000000..197b48c --- /dev/null +++ b/ntopng/ntopng @@ -0,0 +1,2 @@ +#NTOPNG_COMMAND_OPTS= + diff --git a/ntopng/ntopng.service b/ntopng/ntopng.service new file mode 100644 index 0000000..e4e1364 --- /dev/null +++ b/ntopng/ntopng.service @@ -0,0 +1,11 @@ +[Unit] +Description=ntopng network traffic monitor +Wants=redis.service +After=redis.service + +[Service] +EnvironmentFile=/etc/conf.d/ntopng +ExecStart=/usr/bin/ntopng ${NTOPNG_COMMAND_OPTS} + +[Install] +WantedBy=multi-user.target