testing/sigar: new aport

System Information Gatherer And Reporter
http://sigar.hyperic.com/
This commit is contained in:
Natanael Copa 2016-05-02 12:50:17 +02:00
parent 8294c4a24b
commit 66b8335359
4 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 9f63c2048e6933cb02c7d2fa19fd069ed511750d Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 14 Mar 2016 14:14:30 +0000
Subject: [PATCH 1/3] fix compilation with musl libc
the HZ define is not exposed by musl libc.
(cherry picked from commit 5e09cdb086a77314dfbff5dc0a18359bac965111)
---
src/os/linux/linux_sigar.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c
index 0a44623..592df9f 100644
--- a/src/os/linux/linux_sigar.c
+++ b/src/os/linux/linux_sigar.c
@@ -45,6 +45,10 @@
#define PROC_PARTITIONS PROC_FS_ROOT "partitions"
#define PROC_DISKSTATS PROC_FS_ROOT "diskstats"
+#ifndef HZ
+#define HZ 100
+#endif
+
/*
* /proc/self/stat fields:
* 1 - pid
--
2.8.1

View File

@ -0,0 +1,29 @@
From c8f2ab95adb2553741bec8c38b1517c092439f9e Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 14 Mar 2016 14:17:29 +0000
Subject: [PATCH 2/3] only enable the GNU libc strerror_r on GNU libc
We don't want use the non-standard GNU libc variant of strerror_r on
musl libc, or any libc other than GNU.
(cherry picked from commit e78f794c22e7825374d1d9bda37f649ed2f725d3)
---
src/os/linux/sigar_os.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/os/linux/sigar_os.h b/src/os/linux/sigar_os.h
index 29a2ba3..7e1ead7 100644
--- a/src/os/linux/sigar_os.h
+++ b/src/os/linux/sigar_os.h
@@ -70,7 +70,7 @@ struct sigar_t {
};
#define HAVE_STRERROR_R
-#ifndef __USE_XOPEN2K
+#if !defined(__USE_XOPEN2K) && defined(__GLIBC__)
/* use gnu version of strerror_r */
#define HAVE_STRERROR_R_GLIBC
#endif
--
2.8.1

View File

@ -0,0 +1,34 @@
From 71115bc6e70254cc857fb75739b97112b9015eff Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 23 Mar 2016 16:01:32 +0100
Subject: [PATCH 3/3] build with libtirpc and gcc5
This is a workaround to build library with libtirpc and gcc5
---
bindings/java/hyperic_jni/jni-build.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bindings/java/hyperic_jni/jni-build.xml b/bindings/java/hyperic_jni/jni-build.xml
index d4556c3..eeb95ff 100644
--- a/bindings/java/hyperic_jni/jni-build.xml
+++ b/bindings/java/hyperic_jni/jni-build.xml
@@ -324,6 +324,8 @@
<compilerarg value="-O2" if="jni.optim"/>
<compilerarg value="-g" if="jni.debug"/>
<compilerarg value="-Wall"/>
+ <compilerarg value="-std=gnu89"/>
+ <compilerarg value="-I/usr/include/tirpc"/>
<compilerarg value="-Werror" if="jni.werror"/>
<compilerarg value="${jni.gccm}" if="jni.gccm"/>
<defineset>
@@ -341,6 +343,7 @@
dir="${jni.dmalloc}/lib"
libs="dmallocth"/>
<linkerarg value="${jni.gccm}" if="jni.gccm"/>
+ <libset libs="tirpc "/>
</linker>
<!-- Darwin -->
--
2.8.1

43
testing/sigar/APKBUILD Normal file
View File

@ -0,0 +1,43 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sigar
pkgver=1.6.4
pkgrel=0
pkgdesc="System Information Gatherer And Reporter"
url="http://sigar.hyperic.com/"
arch="all"
license="ASL 2.0"
depends=""
depends_dev=""
makedepends="$depends_dev libtirpc-dev apache-ant"
install=""
subpackages=""
source="https://github.com/hyperic/sigar/archive/sigar-$pkgver.tar.gz
0001-fix-compilation-with-musl-libc.patch
0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
0003-build-with-libtirpc-and-gcc5.patch
"
builddir="$srcdir"/sigar-sigar-$pkgver
build() {
cd "$builddir"/bindings/java
ant
}
package() {
cd "$builddir"/bindings/java
mkdir -p "$pkgdir"/usr/lib
install ./sigar-bin/lib/libsigar-*.so "$pkgdir"/usr/lib/
}
md5sums="b4a5e195755fa084feec3cdadcd964d1 sigar-1.6.4.tar.gz
6e519321a995126f66995d5d961b5463 0001-fix-compilation-with-musl-libc.patch
9c739f71c0f9bd0cba16e7d85fc49271 0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
ec4b6b987330d01fdfa94f7f3e62c8f6 0003-build-with-libtirpc-and-gcc5.patch"
sha256sums="179b04c1eb7e10e50632e1f8c8d25c1bc4d35259f2976bc72686ecfa79a0052e sigar-1.6.4.tar.gz
be24452bf5960adbe6d7b422ca101d015d52ac0dfabcf0ca973883cab56b6d18 0001-fix-compilation-with-musl-libc.patch
234551e9b9dd03345bacd589c3b9e66f90d6730db9ddca4d692cf8d779c83009 0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
8d68f10a9a14c54c17276e7d48fb6cf82919ad473f2fdf475cfcab6ca9678a96 0003-build-with-libtirpc-and-gcc5.patch"
sha512sums="0515f3501a51357d6ac01dc5e3ecffae10995f347b98c66928adff247b86e52112d2bf9cf78b2633941eb9c7fb23f019f4885c41348fe461239e4eebd147253e sigar-1.6.4.tar.gz
577f10add8dfe3f1e97375aba06fdecb4ae9d64d75246107cde2183a9efee5eeb8f2c00c072397e2ac4bba2dc49e67c5efef141c609f84a6128d03f3f5187d05 0001-fix-compilation-with-musl-libc.patch
12f68a3c3449b98a45458aa189a633d32ccc9adab83e04e84c8e496c1e0545a58ecc86fdcb68d55b162f5717244f69a48f0a13241b672c909993dc13643c8c64 0002-only-enable-the-GNU-libc-strerror_r-on-GNU-libc.patch
1896f8deb1945dd18283cb391528791b7554b2a4d56c0bc02a58d36a6af2a333782486a508e4d756b558d522d9a759bb3eefe12f0fd1720a9b83426d2b9bf469 0003-build-with-libtirpc-and-gcc5.patch"