Skip to content
Snippets Groups Projects
Commit e01acd2d authored by Jakub Jirutka's avatar Jakub Jirutka :flag_ua:
Browse files

testing/java-sigar: new aport

https://github.com/hyperic/sigar/
System Information Gatherer And Reporter
parent 230a84ab
No related branches found
No related tags found
No related merge requests found
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=java-sigar
_pkgname=sigar
pkgver=1.6.4
pkgrel=0
pkgdesc="System Information Gatherer And Reporter"
url="https://github.com/hyperic/sigar/"
arch="all"
license="Apache-2.0"
depends="$pkgname-native=$pkgver-r$pkgrel"
subpackages="$pkgname-native"
makedepends="apache-ant libtirpc-dev linux-headers openjdk8 perl"
source="https://github.com/hyperic/$_pkgname/archive/$_pkgname-$pkgver.tar.gz
musl-compat-HZ.patch
musl-compat-strerror_r.patch
tirpc.patch
fix-inlined-functions-definition.patch
"
builddir="$srcdir/$_pkgname-$_pkgname-$pkgver"
build() {
cd "$builddir"/bindings/java
ant build
}
package() {
cd "$builddir"/bindings/java
install -m 644 -D sigar-bin/lib/sigar.jar \
"$pkgdir"/usr/share/java/$_pkgname-$pkgver.jar
ln -s $_pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$_pkgname.jar
}
native() {
pkgdesc="$pkgdesc (native library)"
depends=""
cd "$builddir"/bindings/java
install -m 755 -D sigar-bin/lib/libsigar-amd64-linux.so \
"$subpkgdir"/usr/lib/libsigar.so
}
sha512sums="0515f3501a51357d6ac01dc5e3ecffae10995f347b98c66928adff247b86e52112d2bf9cf78b2633941eb9c7fb23f019f4885c41348fe461239e4eebd147253e sigar-1.6.4.tar.gz
bfb4f6f945207be652c58cfc8d3a552c84424d0ca9a3c0bf4177f4caa24c65a44ed3342b28d6d80d82a3e61d72f61d9c4194902bafa5372710db71f85e713f0f musl-compat-HZ.patch
ea85154edc0ca2b15d556bbfe4fa61b37d2a53befa969b4c91d976b502f14ce138b0dbbd7d46985aa809a490df97b6ef388f3f16820e1e14b52fc85851342527 musl-compat-strerror_r.patch
c6bda65e389a62495951a908f675fbe4aa24b3b819e8e4bc9fee87e9e59ca5533b9ad738737d42f7d7665cc077a3bbc868420aa281536d0673a62e94b165488c tirpc.patch
ff313c86155c6c6e827cca1ea092308fce3f57eff88fb097e7f2f125ce42b44e45de57f7f45dd0b440fae854a169fad3e2ebe9d2fc9f2c7406413928ed081e15 fix-inlined-functions-definition.patch"
From d5c7a43eba53a421908bfcc5d84419fbab1b2528 Mon Sep 17 00:00:00 2001
From: AlexYaruki <alexyaruki@gmail.com>
Date: Fri, 2 Sep 2016 12:45:46 +0200
Subject: [PATCH] Fix to inlined functions definition
Fixes:
Error relocating bindings/java/sigar-bin/lib/libsigar-amd64-linux.so: sigar_skip_multiple_token: symbol not found
Error relocating bindings/java/sigar-bin/lib/libsigar-amd64-linux.so: sigar_skip_token: symbol not found
diff --git a/include/sigar_util.h b/include/sigar_util.h
index b3c4dd7d..9545d0f6 100644
--- a/include/sigar_util.h
+++ b/include/sigar_util.h
@@ -75,11 +75,11 @@ int sigar_inet_ntoa(sigar_t *sigar,
struct hostent *sigar_gethostbyname(const char *name,
sigar_hostent_t *data);
-SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
+extern SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
-SIGAR_INLINE char *sigar_skip_token(char *p);
+extern SIGAR_INLINE char *sigar_skip_token(char *p);
-SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
+extern SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
char *sigar_getword(char **line, char stop);
The HZ define is not exposed by musl libc.
--- a/src/os/linux/linux_sigar.c
+++ b/src/os/linux/linux_sigar.c
@@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <sys/times.h>
#include <sys/utsname.h>
+#include <linux/param.h>
#include "sigar.h"
#include "sigar_private.h"
From e78f794c22e7825374d1d9bda37f649ed2f725d3 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 14 Mar 2016 14:17:29 +0000
Subject: [PATCH] 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.
---
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 29a2ba32..7e1ead7d 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
--- a/bindings/java/build.xml
+++ b/bindings/java/build.xml
@@ -223,6 +223,7 @@
<path location="../../src/os/${jni.src}"/>
<path location="${build}/src"/>
<path location="src/jni"/>
+ <path location="/usr/include/tirpc"/>
</path>
<!-- extra solaris libs -->
@@ -243,6 +243,14 @@
<condition property="jni.libset.libs" value="odm,cfg,perfstat,pthreads">
<isset property="aix"/>
</condition>
+
+ <condition property="jni.libset.dir" value="/usr/lib">
+ <isset property="linux"/>
+ </condition>
+
+ <condition property="jni.libset.libs" value="tirpc">
+ <isset property="linux"/>
+ </condition>
</target>
<target name="copy-includes">
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment