1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

net-mgmt/check_mk_agent: Update to 1.5.0p21

- Use patches to have better control over future changes in the agent
  script.
- Update the software name in pkg-message.
- Break long lines.

Reported by:	Repology
This commit is contained in:
Mateusz Piotrowski 2019-09-06 10:27:43 +00:00
parent 02937f0380
commit d76ddd8d0e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=511292
4 changed files with 53 additions and 11 deletions

View File

@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= check_mk_agent
DISTVERSION= 1.5.0p20
DISTVERSION= 1.5.0p21
CATEGORIES= net-mgmt
MASTER_SITES= https://mathias-kettner.de/support/${DISTVERSION}/
DISTNAME= check-mk-raw-${DISTVERSION}.cre
@ -16,7 +16,7 @@ RUN_DEPENDS= bash>0:shells/bash
USES= shebangfix
SHEBANG_FILES= agents/${PORTNAME}.freebsd
SHEBANG_FILES= agents/${CHECKMK_AGENT}
NO_ARCH= yes
NO_BUILD= yes
@ -30,16 +30,27 @@ PORTDOCS= README.FreeBSD
OPTIONS_DEFINE= DOCS
CHECKMK_AGENT= ${PORTNAME}.freebsd
CHECKMK_LIBDIR= ${LOCALBASE}/lib/check_mk_agent
CHECKMK_CONFDIR=${LOCALBASE}/etc/check_mk
CHECKMK_TMPDIR= /var/run/check_mk
post-patch:
${REINPLACE_CMD} -E -e 's|^(export MK_CONFDIR=")|\1${PREFIX}|' \
-e 's|/usr/local/bin/bash|${LOCALBASE}/bin/bash|g' \
${WRKSRC}/agents/${PORTNAME}.freebsd
@${REINPLACE_CMD} \
-e 's|%%CHECKMK_LIBDIR%%|${CHECKMK_LIBDIR}|' \
-e 's|%%CHECKMK_CONFDIR%%|${CHECKMK_CONFDIR}|' \
-e 's|%%CHECKMK_TMPDIR%%|${CHECKMK_TMPDIR}|' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%BASH%%|${LOCALBASE}/bin/bash|' \
${WRKSRC}/agents/${CHECKMK_AGENT}
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/agents/${PORTNAME}.freebsd ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_SCRIPT} ${WRKSRC}/agents/${CHECKMK_AGENT} \
${STAGEDIR}${PREFIX}/bin/${PORTNAME}
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/agents/README.FreeBSD ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/agents/README.FreeBSD \
${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1564401961
SHA256 (check-mk-raw-1.5.0p20.cre.tar.gz) = b8c4e93cb2ae8cb7040082e929adfd6f7c6f9ad95644f3a1c0f102cdbc0d1994
SIZE (check-mk-raw-1.5.0p20.cre.tar.gz) = 386024878
TIMESTAMP = 1567764056
SHA256 (check-mk-raw-1.5.0p21.cre.tar.gz) = 270f5422adbbda151edf102bdd8665ff1b5ee96b2aec04a899114a5238381869
SIZE (check-mk-raw-1.5.0p21.cre.tar.gz) = 386037040

View File

@ -0,0 +1,31 @@
--- agents/check_mk_agent.freebsd.orig 2019-09-06 10:22:12 UTC
+++ agents/check_mk_agent.freebsd
@@ -41,15 +41,15 @@
export LC_ALL=C
unset LANG
-export MK_LIBDIR="/usr/local/lib/check_mk_agent"
-export MK_CONFDIR="/etc/check_mk"
-export MK_TMPDIR="/var/run/check_mk"
+export MK_LIBDIR="%%CHECKMK_LIBDIR%%"
+export MK_CONFDIR="%%CHECKMK_CONFDIR%%"
+export MK_TMPDIR="%%CHECKMK_TMPDIR%%"
# Optionally set a tempdir for all subsequent calls
#export TMPDIR=
# Make sure, locally installed binaries are found
-PATH=$PATH:/usr/local/bin:/usr/local/sbin
+PATH=$PATH:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
# All executables in PLUGINSDIR will simply be executed and their
# ouput appended to the output of the agent. Plugins define their own
@@ -102,7 +102,7 @@ function run_cached() {
# Cache file outdated and new job not yet running? Start it
if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
- echo "$CMDLINE" | daemon /usr/local/bin/bash -o noclobber > $CACHEFILE.new && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new &
+ echo "$CMDLINE" | daemon %%BASH%% -o noclobber > $CACHEFILE.new && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new &
fi
}

View File

@ -1,7 +1,7 @@
[
{ type: install
message: <<EOM
Check_MK may collect additional data if the following ports are installed:
Checkmk may collect additional data if the following ports are installed:
- devel/libstatgrab
- sysutils/ipmitool
- sysutils/megacli