Lines 6-12
EAPI="5"
Link Here
|
6 |
|
6 |
|
7 |
PYTHON_COMPAT=( python2_7 ) |
7 |
PYTHON_COMPAT=( python2_7 ) |
8 |
|
8 |
|
9 |
inherit eutils toolchain-funcs python-r1 |
9 |
inherit eutils toolchain-funcs python-r1 systemd |
10 |
|
10 |
|
11 |
DESCRIPTION="General purpose Nagios/Icinga plugin for retrieving data" |
11 |
DESCRIPTION="General purpose Nagios/Icinga plugin for retrieving data" |
12 |
HOMEPAGE="http://mathias-kettner.de/check_mk.html" |
12 |
HOMEPAGE="http://mathias-kettner.de/check_mk.html" |
Lines 17-29
MY_PV="${MY_P/check_mk-/}"
Link Here
|
17 |
LICENSE="GPL-2" |
17 |
LICENSE="GPL-2" |
18 |
SLOT="0" |
18 |
SLOT="0" |
19 |
KEYWORDS="~amd64 ~x86" |
19 |
KEYWORDS="~amd64 ~x86" |
20 |
IUSE="agent-only apache_status dmi_sysinfo livestatus logwatch mysql |
20 |
IUSE="agent-only apache_status livestatus logwatch mysql |
21 |
nfsexports oracle postgres smart wato xinetd zypper" |
21 |
nfsexports oracle postgres smart systemd wato xinetd zypper" |
22 |
|
22 |
|
23 |
DEPEND="wato? ( app-admin/sudo ) |
23 |
DEPEND="wato? ( app-admin/sudo ) |
|
|
24 |
livestatus? ( !!net-analyzer/mk-livestatus ) |
24 |
xinetd? ( sys-apps/xinetd ) |
25 |
xinetd? ( sys-apps/xinetd ) |
25 |
!agent-only? ( || ( net-analyzer/nagios-core net-analyzer/icinga ) ) |
26 |
!agent-only? ( || ( net-analyzer/nagios-core net-analyzer/icinga ) ) |
26 |
!agent-only? ( www-servers/apache www-apache/mod_python ) |
27 |
!agent-only? ( www-servers/apache[-apache2_mpms_worker] www-apache/mod_python ) |
27 |
media-libs/libpng:0" |
28 |
media-libs/libpng:0" |
28 |
RDEPEND="${DEPEND}" |
29 |
RDEPEND="${DEPEND}" |
29 |
|
30 |
|
Lines 83-105
src_compile() {
Link Here
|
83 |
|
84 |
|
84 |
# compile waitmax |
85 |
# compile waitmax |
85 |
cd "${S}"/usr/share/check_mk/agents || die "Couldn't cd to ${S}/usr/share/check_mk/agents" |
86 |
cd "${S}"/usr/share/check_mk/agents || die "Couldn't cd to ${S}/usr/share/check_mk/agents" |
86 |
if [[ -f waitmax ]]; then |
87 |
rm -f waitmax |
87 |
rm waitmax || die "Couldn't delete precompiled waitmax file" |
88 |
$(tc-getCC) ${CFLAGS} -o waitmax{,.c} ${LDFLAGS} || die "Couldn't compile waitmax" |
88 |
fi |
|
|
89 |
sed -i -e 's#gcc -s -o waitmax waitmax\.c#gcc -o waitmax waitmax.c#' "${S}"/usr/share/check_mk/agents/Makefile || die "Couldn't modify remove strip from waitmax Makefile" |
90 |
emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" || die "Couldn't compile waitmax" |
91 |
|
89 |
|
92 |
# Fix broken png files |
90 |
# Fix broken png files |
93 |
pngfix -q --out=out.png "${S}/usr/share/check_mk/web/htdocs/images/icons/bookcase.png" |
91 |
pngfix -q --out=out.png "${S}/usr/share/check_mk/web/htdocs/images/icons/bookcase.png" |
94 |
mv -f out.png "${S}/usr/share/check_mk/web/htdocs/images/icons/bookcase.png" || die |
92 |
mv -f out.png "${S}/usr/share/check_mk/web/htdocs/images/icons/bookcase.png" || die |
95 |
pngfix -q --out=out.png "${S}/usr/share/check_mk/web/htdocs/images/icon_auditlog.png" |
|
|
96 |
mv -f out.png "${S}/usr/share/check_mk/web/htdocs/images/icon_auditlog.png" || die |
97 |
pngfix -q --out=out.png "${S}/usr/share/check_mk/web/htdocs/images/button_auditlog_lo.png" |
98 |
mv -f out.png "${S}/usr/share/check_mk/web/htdocs/images/button_auditlog_lo.png" || die |
99 |
} |
93 |
} |
100 |
|
94 |
|
101 |
src_install() { |
95 |
src_install() { |
102 |
if ! use agent-only; then |
96 |
if ! use agent-only; then |
|
|
97 |
# pnp4nagios is installed in /usr/share/pnp and configured in /pnp/ |
98 |
# location in apache; so, some clean up is necessary although aliasing |
99 |
# reverse aliasing the directory will also work. |
100 |
sed 's,/pnp4nagios/,/pnp/,g' -i \ |
101 |
usr/share/check_mk/check_mk_templates.cfg \ |
102 |
usr/share/check_mk/notifications/mail \ |
103 |
usr/share/check_mk/web/htdocs/wato.py \ |
104 |
usr/share/check_mk/web/plugins/{icons/builtin.py,wato/backup_domains.py} |
105 |
|
103 |
# Apache configuration |
106 |
# Apache configuration |
104 |
insinto /etc/apache2/modules.d |
107 |
insinto /etc/apache2/modules.d |
105 |
doins etc/apache2/modules.d/zzz_check_mk.conf |
108 |
doins etc/apache2/modules.d/zzz_check_mk.conf |
Lines 118-124
EOF
Link Here
|
118 |
# check_mk configuration |
121 |
# check_mk configuration |
119 |
keepdir /etc/check_mk |
122 |
keepdir /etc/check_mk |
120 |
insinto /etc/check_mk |
123 |
insinto /etc/check_mk |
121 |
doins etc/check_mk/main.mk |
124 |
doins "${FILESDIR}"/main.mk |
122 |
doins etc/check_mk/main.mk-${MY_PV} |
125 |
doins etc/check_mk/main.mk-${MY_PV} |
123 |
doins etc/check_mk/multisite.mk |
126 |
doins etc/check_mk/multisite.mk |
124 |
doins etc/check_mk/multisite.mk-${MY_PV} |
127 |
doins etc/check_mk/multisite.mk-${MY_PV} |
Lines 155-160
EOF
Link Here
|
155 |
keepdir /var/lib/check_mk/cache |
158 |
keepdir /var/lib/check_mk/cache |
156 |
keepdir /var/lib/check_mk/counters |
159 |
keepdir /var/lib/check_mk/counters |
157 |
keepdir /var/lib/check_mk/logwatch |
160 |
keepdir /var/lib/check_mk/logwatch |
|
|
161 |
keepdir /var/lib/check_mk/log |
158 |
keepdir /var/lib/check_mk/notify |
162 |
keepdir /var/lib/check_mk/notify |
159 |
keepdir /var/lib/check_mk/packages |
163 |
keepdir /var/lib/check_mk/packages |
160 |
insinto /var/lib/check_mk/packages |
164 |
insinto /var/lib/check_mk/packages |
Lines 187-192
EOF
Link Here
|
187 |
fowners -R root:${mydaemon} /var/lib/check_mk/counters |
191 |
fowners -R root:${mydaemon} /var/lib/check_mk/counters |
188 |
fperms 0775 /var/lib/check_mk/notify |
192 |
fperms 0775 /var/lib/check_mk/notify |
189 |
fowners -R root:${mydaemon} /var/lib/check_mk/notify |
193 |
fowners -R root:${mydaemon} /var/lib/check_mk/notify |
|
|
194 |
fperms 0775 /var/lib/check_mk/log |
195 |
fowners -R root:${mydaemon} /var/lib/check_mk/log |
190 |
fperms 0775 /var/lib/check_mk/logwatch |
196 |
fperms 0775 /var/lib/check_mk/logwatch |
191 |
fowners -R root:${mydaemon} /var/lib/check_mk/logwatch |
197 |
fowners -R root:${mydaemon} /var/lib/check_mk/logwatch |
192 |
fperms 0775 /var/lib/check_mk/cache |
198 |
fperms 0775 /var/lib/check_mk/cache |
Lines 205-212
EOF
Link Here
|
205 |
|
211 |
|
206 |
if use xinetd; then |
212 |
if use xinetd; then |
207 |
insinto /etc/xinetd.d |
213 |
insinto /etc/xinetd.d |
208 |
newins usr/share/check_mk/agents/xinetd.conf check_mk |
214 |
newins usr/share/check_mk/agents/cfg_examples/xinetd.conf check_mk |
209 |
fi |
215 |
fi |
|
|
216 |
use systemd && systemd_dounit usr/share/check_mk/agents/cfg_examples/check_mk{.socket,@.service} |
210 |
|
217 |
|
211 |
keepdir /usr/lib/check_mk_agent/local |
218 |
keepdir /usr/lib/check_mk_agent/local |
212 |
keepdir /usr/lib/check_mk_agent/plugins |
219 |
keepdir /usr/lib/check_mk_agent/plugins |
Lines 246-252
EOF
Link Here
|
246 |
# Install the check_mk_agent logwatch plugin |
253 |
# Install the check_mk_agent logwatch plugin |
247 |
if use logwatch; then |
254 |
if use logwatch; then |
248 |
insinto /etc/check_mk |
255 |
insinto /etc/check_mk |
249 |
doins usr/share/check_mk/agents/logwatch.cfg |
256 |
doins usr/share/check_mk/agents/cfg_examples/logwatch.cfg |
250 |
exeinto /usr/lib/check_mk_agent/plugins |
257 |
exeinto /usr/lib/check_mk_agent/plugins |
251 |
doexe usr/share/check_mk/agents/plugins/mk_logwatch |
258 |
doexe usr/share/check_mk/agents/plugins/mk_logwatch |
252 |
fi |
259 |
fi |
Lines 292-303
EOF
Link Here
|
292 |
exeinto /usr/lib/check_mk_agent/plugins |
299 |
exeinto /usr/lib/check_mk_agent/plugins |
293 |
doexe usr/share/check_mk/agents/plugins/nfsexports |
300 |
doexe usr/share/check_mk/agents/plugins/nfsexports |
294 |
fi |
301 |
fi |
295 |
|
|
|
296 |
# Install the check_mk_agent dmi_sysinfo plugin |
297 |
if use dmi_sysinfo; then |
298 |
exeinto /usr/lib/check_mk_agent/plugins |
299 |
doexe usr/share/check_mk/agents/plugins/dmi_sysinfo |
300 |
fi |
301 |
} |
302 |
} |
302 |
|
303 |
|
303 |
pkg_postinst() { |
304 |
pkg_postinst() { |