Skip to content

Commit 0f0a334

Browse files
authored
Merge pull request #46 from smokris/master
Enable munin-node-c to build and run on macOS/Darwin
2 parents 628e8b4 + 8c40a7b commit 0f0a334

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

.travis.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
1+
matrix:
2+
include:
3+
- os: osx
4+
compiler: clang
5+
- os: linux
6+
compiler: gcc
7+
env:
8+
- LDFLAGS=
9+
- os: linux
10+
compiler: gcc
11+
env:
12+
- LDFLAGS=-static
13+
- os: linux
14+
compiler: clang
15+
env:
16+
- LDFLAGS=
17+
- os: linux
18+
compiler: clang
19+
env:
20+
- LDFLAGS=-static
21+
- os: linux
22+
compiler: musl-gcc
23+
env:
24+
- LDFLAGS=
25+
- os: linux
26+
compiler: musl-gcc
27+
env:
28+
- LDFLAGS=-static
29+
130
language: c
2-
compiler:
3-
- gcc
4-
- clang
5-
- musl-gcc
631

732
# Use a container Travis
833
sudo: false
@@ -20,9 +45,6 @@ notifications:
2045
env:
2146
global:
2247
- secure: "CNXrpwGgWHhD9894gMeKqlt/5eeKJ+J764jRV685JWV/5OrHeWqEfAp+onX/B+RUCl5DrFpblyQl2K6IDTABolkY4Vy/kvZHB5Y2XhyXu3U6RzQwdH3xo9olJQ+UcGzNOc1YOqSWzkDG2JbR9HthgyWgMjbvePXn5AKRGUTAasI="
23-
matrix:
24-
- LDFLAGS=-static
25-
- LDFLAGS=
2648

2749
addons:
2850
apt:

common.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ RELEASE="$(shell $(top_srcdir)/getversion)"
33

44
%.1:%.pod
55
$(AM_V_GEN)pod2man --section=1 --release=$(RELEASE) --center=$(MANCENTER) $< > $@
6-
sed -i -e 's#@@pkglibexecdir@@#$(pkglibexecdir)#' -e 's#@@CONFDIR@@#$(sysconfdir)#' $@
6+
sed -i.bak -e 's#@@pkglibexecdir@@#$(pkglibexecdir)#' -e 's#@@CONFDIR@@#$(sysconfdir)#' $@
77

88

99
# vim:ft=make

src/node/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
include $(top_srcdir)/common.am
1212

1313
sbin_PROGRAMS = munin-node-c munin-inetd-c
14-
AM_CPPFLAGS = -DPLUGINDIR=\"$(sysconfdir)/munin/plugins\"
14+
AM_CPPFLAGS = -DPLUGINDIR=\"$(sysconfdir)/munin/plugins\" \
15+
-DPLUGINCONFDIR=\"$(sysconfdir)/munin/plugin-conf.d\"
1516
munin_node_c_SOURCES = node.c
1617
munin_inetd_c_SOURCES = inetd.c
1718
man_MANS = munin-node-c.1

src/node/node.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static char* host = "";
4545
static char* plugin_dir = PLUGINDIR;
4646
static char* spoolfetch_dir = "";
4747
static char* client_ip = "-";
48-
static char* pluginconf_dir = "/etc/munin/plugin-conf.d";
48+
static char* pluginconf_dir = PLUGINCONFDIR;
4949

5050
static int handle_connection();
5151

@@ -416,7 +416,7 @@ static void setenvvars_conf(char* current_plugin_name) {
416416
/* TODO - add plugin conf parsing */
417417
DIR* dirp = opendir(pluginconf_dir);
418418
if (dirp == NULL) {
419-
printf("# Cannot open plugin config dir\n");
419+
printf("# Cannot open plugin config dir '%s'\n", pluginconf_dir);
420420
return;
421421
}
422422

0 commit comments

Comments
 (0)