aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorprspkt <prspkt@protonmail.com>2018-03-29 20:30:27 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-07-17 20:12:56 +0000
commitafa66c07801b5c2dc97a9c10d7fb38e40bda2c5a (patch)
treecb7514ad1254f889d2ab92d2ea2215dde7b23bbd /testing
parent26e514b99214145d307ae36e9e1753cd19b86b37 (diff)
downloadaports-afa66c07801b5c2dc97a9c10d7fb38e40bda2c5a.tar.bz2
aports-afa66c07801b5c2dc97a9c10d7fb38e40bda2c5a.tar.xz
testing/slurm: new aport
Diffstat (limited to 'testing')
-rw-r--r--testing/slurm/APKBUILD41
-rw-r--r--testing/slurm/fix-includes.patch22
2 files changed, 63 insertions, 0 deletions
diff --git a/testing/slurm/APKBUILD b/testing/slurm/APKBUILD
new file mode 100644
index 0000000000..4b61db8a59
--- /dev/null
+++ b/testing/slurm/APKBUILD
@@ -0,0 +1,41 @@
+# Contributor: prspkt <prspkt@protonmail.com>
+# Maintainer: prspkt <prspkt@protonmail.com>
+pkgname=slurm
+pkgver=0.4.3
+pkgrel=0
+pkgdesc="Yet another network load monitor"
+url="https://github.com/mattthias/slurm"
+arch="all"
+options="!check" # no upstream/available test-suite
+license="GPL-2.0-or-later"
+makedepends="cmake linux-headers ncurses-dev"
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/mattthias/slurm/archive/upstream/$pkgver.tar.gz
+ fix-includes.patch"
+
+builddir="$srcdir/$pkgname-upstream-$pkgver"
+
+build() {
+ cd "$builddir"
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+
+ # Optimizations beyond -O0 result in the binary failing to execute past the help
+ # screen. Upon execution, the failing binary will exit producing the message:
+ # "Illegal instruction"
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_C_FLAGS="${CFLAGS/-Os/-O0} -Wno-aggressive-loop-optimizations" \
+ ${CMAKE_CROSSOPTS}
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -Dm644 slurm.1 "$pkgdir"/usr/share/man/man1/slurm.1
+}
+
+sha512sums="de67d661fbad564f4a3a8f94f1209d466e11a8094b79c25e0beb1b2d07ad680fe2c6f832dc0f8c3a85f7f2d0d02363b4842cbca58ba9d30ca8d7b3133ecc64c9 slurm-0.4.3.tar.gz
+f6cf0d23c9b311b7b9b2384f00a751d091304f518caf8d4882bbf15c95ea5724e8e1c90b55f175d8781cd1edc917bf65ec09f8cf1c7665c2cb1412b0a5f8cba3 fix-includes.patch"
diff --git a/testing/slurm/fix-includes.patch b/testing/slurm/fix-includes.patch
new file mode 100644
index 0000000000..9e933ffc50
--- /dev/null
+++ b/testing/slurm/fix-includes.patch
@@ -0,0 +1,22 @@
+--- a/os.h
++++ b/os.h
+@@ -177,7 +177,7 @@
+ #elif defined (__linux__) /* L I N U X */
+ #include <stdio.h>
+ #include <sys/param.h>
+-#include <sys/sysctl.h>
++#include <linux/sysctl.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <unistd.h>
+@@ -195,8 +195,8 @@
+ #include <netinet/in.h>
+ #include <net/if.h>
+ #include <arpa/inet.h>
+-#include <net/ppp_defs.h>
+-#include <net/if_ppp.h>
++#include <linux/ppp_defs.h>
++#include <linux/if_ppp.h>
+ #elif defined (__Solaris__) /* S O L A R I S */
+ #include <stdio.h>
+ #define NO_CURSES_E 1