Gentoo Archives: gentoo-commits

From: Matthew Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/
Date: Wed, 31 Jul 2019 15:37:12
Message-Id: 1564587402.3701f980625f0bd14d28b7509935e293c5027a7c.prometheanfire@gentoo
1 commit: 3701f980625f0bd14d28b7509935e293c5027a7c
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 31 15:32:39 2019 +0000
4 Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 31 15:36:42 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3701f980
7
8 net-analyzer/icinga2: 2.10.6 bump
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>
12
13 net-analyzer/icinga2/Manifest | 1 +
14 net-analyzer/icinga2/icinga2-2.10.6.ebuild | 172 +++++++++++++++++++++++++++++
15 2 files changed, 173 insertions(+)
16
17 diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
18 index 180268e443c..1467cbda0be 100644
19 --- a/net-analyzer/icinga2/Manifest
20 +++ b/net-analyzer/icinga2/Manifest
21 @@ -1 +1,2 @@
22 DIST icinga2-2.10.5.tar.gz 5141193 BLAKE2B 7262e9f0ccb2180faba51b2e04b58964fe6c72782ab61488925c0f6528a80fc1f58afab5f3858f6f696fdca7c8d5546beb8fd374f7f72e452ffd7cd1f1e3ff4a SHA512 c43443d0bbb4ec997d3c5405ef3019ae3b09131bcce2e9d7c7b0e187768335a2f1347fdd382655f12a28b3a29ec8bf644c1b610ea5157f3ee40ae5e0e9253d38
23 +DIST icinga2-2.10.6.tar.gz 5148999 BLAKE2B a155ccb381947854dfd9115575680b7101dc8d01708c76c719d4e6306c5acdf0bf3394128a8937f7d8e03d97c18442ee1b576af28f98fb11e42055b8b4498cce SHA512 ab1440fdbb36217c5e50d8a254d0f1294e412325038fcc02496c606558ab33f4fafda93b1f439ab6e51e956aff6daddee005282b6d529c7e9d9d781af120834d
24
25 diff --git a/net-analyzer/icinga2/icinga2-2.10.6.ebuild b/net-analyzer/icinga2/icinga2-2.10.6.ebuild
26 new file mode 100644
27 index 00000000000..8a9695a5e27
28 --- /dev/null
29 +++ b/net-analyzer/icinga2/icinga2-2.10.6.ebuild
30 @@ -0,0 +1,172 @@
31 +# Copyright 1999-2019 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +if [[ ${PV} != 9999 ]]; then
36 + inherit cmake-utils depend.apache eutils systemd toolchain-funcs user wxwidgets
37 + SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
38 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
39 +else
40 + inherit cmake-utils depend.apache eutils git-r3 systemd toolchain-funcs user wxwidgets
41 + EGIT_REPO_URI="https://github.com/Icinga/icinga2.git"
42 + EGIT_BRANCH="master"
43 + KEYWORDS=""
44 +fi
45 +
46 +DESCRIPTION="Distributed, general purpose, network monitoring engine"
47 +HOMEPAGE="http://icinga.org/icinga2"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +IUSE="classicui console libressl lto mail mariadb minimal +mysql nano-syntax +plugins postgres systemd +vim-syntax"
52 +WX_GTK_VER="3.0"
53 +
54 +CDEPEND="
55 + !libressl? ( dev-libs/openssl:0= )
56 + libressl? ( dev-libs/libressl:0= )
57 + >=dev-libs/boost-1.58-r1
58 + console? ( dev-libs/libedit )
59 + mariadb? ( dev-db/mariadb-connector-c:= )
60 + mysql? ( dev-db/mysql-connector-c:= )
61 + postgres? ( dev-db/postgresql:= )
62 + dev-libs/yajl"
63 +
64 +DEPEND="
65 + ${CDEPEND}
66 + sys-devel/bison
67 + >=sys-devel/flex-2.5.35"
68 +
69 +RDEPEND="
70 + ${CDEPEND}
71 + plugins? ( || (
72 + net-analyzer/monitoring-plugins
73 + net-analyzer/nagios-plugins
74 + ) )
75 + mail? ( virtual/mailx )
76 + classicui? ( net-analyzer/icinga[web] )"
77 +
78 +REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
79 +
80 +want_apache2
81 +
82 +pkg_setup() {
83 + depend.apache_pkg_setup
84 + enewgroup icinga
85 + enewgroup icingacmd
86 + enewgroup nagios # for plugins
87 + enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios"
88 +}
89 +
90 +src_configure() {
91 + sed -i 's/FLAGS\}\ \-g/FLAGS\}\ \-lpthread\ /g' CMakeLists.txt || die
92 + local mycmakeargs=(
93 + -DICINGA2_UNITY_BUILD=FALSE
94 + -DCMAKE_VERBOSE_MAKEFILE=ON
95 + -DCMAKE_BUILD_TYPE=None
96 + -DCMAKE_INSTALL_PREFIX=/usr
97 + -DCMAKE_INSTALL_SYSCONFDIR=/etc
98 + -DCMAKE_INSTALL_LOCALSTATEDIR=/var
99 + -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2
100 + -DICINGA2_PLUGINDIR="/usr/$(get_libdir)/nagios/plugins"
101 + -DICINGA2_USER=icinga
102 + -DICINGA2_GROUP=icingacmd
103 + -DICINGA2_COMMAND_GROUP=icingacmd
104 + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes
105 + -DUSE_SYSTEMD=$(usex systemd ON OFF)
106 + -DLOGROTATE_HAS_SU=ON
107 + )
108 + # default to off if minimal, allow the flags to be set otherwise
109 + if use minimal; then
110 + mycmakeargs+=(
111 + -DICINGA2_WITH_MYSQL=OFF
112 + -DICINGA2_WITH_PGSQL=OFF
113 + )
114 + else
115 + mycmakeargs+=(
116 + -DICINGA2_WITH_PGSQL=$(usex postgres ON OFF)
117 + -DICINGA2_WITH_MYSQL=$(usex mysql ON OFF)
118 + )
119 + fi
120 + # LTO
121 + if use lto; then
122 + mycmakeargs+=(
123 + -DICINGA2_LTO_BUILD=ON
124 + )
125 + else
126 + mycmakeargs+=(
127 + -DICINGA2_LTO_BUILD=OFF
128 + )
129 + fi
130 +
131 + cmake-utils_src_configure
132 +}
133 +
134 +src_install() {
135 + BUILDDIR="${WORKDIR}"/icinga2-${PV}_build
136 + cd "${BUILDDIR}" || die
137 +
138 + emake DESTDIR="${D}" install
139 +
140 + einstalldocs
141 +
142 + newinitd "${FILESDIR}"/icinga2.initd-3 icinga2
143 +
144 + if use mysql ; then
145 + docinto schema
146 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql
147 + docinto schema/upgrade
148 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/*
149 + fi
150 + if use mariadb ; then # same as mysql
151 + docinto schema
152 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql
153 + docinto schema/upgrade
154 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/*
155 + fi
156 + if use postgres ; then
157 + docinto schema
158 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql
159 + docinto schema/upgrade
160 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
161 + fi
162 +
163 + keepdir /etc/icinga2
164 + keepdir /var/lib/icinga2/api/zones
165 + keepdir /var/lib/icinga2/api/repository
166 + keepdir /var/lib/icinga2/api/log
167 + keepdir /var/spool/icinga2/perfdata
168 +
169 + rm -r "${D}/var/run" || die "failed to remove /var/run"
170 + rm -r "${D}/var/cache" || die "failed to remove /var/cache"
171 +
172 + fowners root:icinga /etc/icinga2
173 + fperms 0750 /etc/icinga2
174 + fowners icinga:icinga /var/lib/icinga2
175 + fowners icinga:icinga /var/spool/icinga2
176 + fowners -R icinga:icingacmd /var/lib/icinga2/api
177 + fowners icinga:icinga /var/spool/icinga2/perfdata
178 + fowners icinga:icingacmd /var/log/icinga2
179 +
180 + fperms ug+rwX,o-rwx /etc/icinga2
181 + fperms ug+rwX,o-rwx /var/lib/icinga2
182 + fperms ug+rwX,o-rwx /var/spool/icinga2
183 + fperms ug+rwX,o-rwx /var/log/icinga2
184 +
185 + if use vim-syntax; then
186 + insinto /usr/share/vim/vimfiles
187 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
188 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
189 + fi
190 +
191 + if use nano-syntax; then
192 + insinto /usr/share/nano
193 + doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
194 + fi
195 +}
196 +
197 +pkg_postinst() {
198 + if [[ ${PV} != 9999 && -n ${REPLACING_VERSIONS} && ${REPLACING_VERSIONS} != ${PV} ]]; then
199 + elog "DB IDO schema upgrade may be required required.
200 + https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
201 + fi
202 +}