Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/
Date: Tue, 23 Feb 2016 19:58:44
Message-Id: 1456257491.92000a4a8bf0ba9e9e10ffc1637dbefb40ceef64.prometheanfire@gentoo
1 commit: 92000a4a8bf0ba9e9e10ffc1637dbefb40ceef64
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 19:58:11 2016 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 19:58:11 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92000a4a
7
8 net-analyzer/icinga2: bup
9
10 Package-Manager: portage-2.2.26
11
12 net-analyzer/icinga2/Manifest | 1 +
13 net-analyzer/icinga2/icinga2-2.4.2.ebuild | 162 ++++++++++++++++++++++++++++++
14 2 files changed, 163 insertions(+)
15
16 diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
17 index ca44478..894685f 100644
18 --- a/net-analyzer/icinga2/Manifest
19 +++ b/net-analyzer/icinga2/Manifest
20 @@ -1,2 +1,3 @@
21 DIST icinga2-2.3.11.tar.gz 843985 SHA256 b499c46b9371e0046030226f61b9b056bc16e37138f318c88cd9dd2b4edf3152 SHA512 2011b4a8f6aaab90957427dc90c5de49ae7be97ade9f487882c955807e19455a59dc54869c1ca6a0538c6f1e793fc30815438514d78591338af579a50d022dd8 WHIRLPOOL 69622d7848f16c29fb9bba55e8cad09d1d9cb967d4b70941e7df7379d32e85c392be843703255eac884a659fbc46a263ee4e5d6a27659055d72b628d89478277
22 DIST icinga2-2.4.1.tar.gz 1342073 SHA256 0cd3f52ec283fbad1e68fe9c6cf91e870e0161336f1108c2d7ea044c4db934f0 SHA512 53d93d7db090d478d93a4142e495438306582a5bd75fb69242053ba1213cbfefb4bfba560392cccb532623b3885cc1357b0ffdd9259215c34d681dcd072b52f0 WHIRLPOOL 57cbac7586f309373ed1662b3a12398d71318239f4dc70252905c8b770e240425832e9f38414d0a952ae9039db29474643f4d0b50d24e5a97c1af906b896dd20
23 +DIST icinga2-2.4.2.tar.gz 1359694 SHA256 3f51f4aff2bc78d59051c442a5ab984a038e4396cf9f3835b91bd5eb327d353c SHA512 1be13d3e8492ba802e6b5b0e9ed1a54d9a722a35585df1f601761c5f1f33b2b4ac17d6b82ca8a34955b065d84f9b2d57e259809548958096ae1d6178c1903bf5 WHIRLPOOL 58a898f639073a2d20af062f338ce222ee94d247cac71abbfdc5191ae737c30764f9a064958c5ce044eb9829021e1513d9cd74548392d92a914f2c631a8b6932
24
25 diff --git a/net-analyzer/icinga2/icinga2-2.4.2.ebuild b/net-analyzer/icinga2/icinga2-2.4.2.ebuild
26 new file mode 100644
27 index 0000000..3902285
28 --- /dev/null
29 +++ b/net-analyzer/icinga2/icinga2-2.4.2.ebuild
30 @@ -0,0 +1,162 @@
31 +# Copyright 1999-2016 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=5
36 +inherit cmake-utils depend.apache eutils systemd toolchain-funcs user
37 +
38 +DESCRIPTION="Distributed, general purpose, network monitoring engine"
39 +HOMEPAGE="http://icinga.org/icinga2"
40 +SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
41 +
42 +LICENSE="GPL-2"
43 +SLOT="0"
44 +KEYWORDS="~amd64 ~x86"
45 +IUSE="+mysql postgres classicui console lto mail minimal nano-syntax +plugins studio +vim-syntax"
46 +
47 +CDEPEND="
48 + dev-libs/openssl:0
49 + >=dev-libs/boost-1.41
50 + console? ( dev-libs/libedit )
51 + mysql? ( virtual/mysql )
52 + postgres? ( dev-db/postgresql:= )"
53 +
54 +DEPEND="
55 + ${CDEPEND}
56 + sys-devel/bison
57 + >=sys-devel/flex-2.5.35"
58 +
59 +RDEPEND="
60 + ${CDEPEND}
61 + plugins? ( || (
62 + net-analyzer/monitoring-plugins
63 + net-analyzer/nagios-plugins
64 + ) )
65 + mail? ( virtual/mailx )
66 + classicui? ( net-analyzer/icinga[web] )
67 + studio? ( x11-libs/wxGTK:2.9 )"
68 +
69 +REQUIRED_USE="!minimal? ( || ( mysql postgres ) )"
70 +
71 +want_apache2
72 +
73 +pkg_setup() {
74 + depend.apache_pkg_setup
75 + enewgroup icinga
76 + enewgroup icingacmd
77 + enewgroup nagios # for plugins
78 + enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios"
79 +}
80 +
81 +src_configure() {
82 + sed -i 's/FLAGS\}\ \-g/FLAGS\}\ \-lpthread\ /g' CMakeLists.txt || die
83 + local mycmakeargs=(
84 + -DICINGA2_UNITY_BUILD=FALSE
85 + -DCMAKE_VERBOSE_MAKEFILE=ON
86 + -DCMAKE_BUILD_TYPE=None
87 + -DCMAKE_INSTALL_PREFIX=/usr
88 + -DCMAKE_INSTALL_SYSCONFDIR=/etc
89 + -DCMAKE_INSTALL_LOCALSTATEDIR=/var
90 + -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2
91 + -DICINGA2_USER=icinga
92 + -DICINGA2_GROUP=icingacmd
93 + -DICINGA2_COMMAND_USER=icinga
94 + -DICINGA2_COMMAND_GROUP=icingacmd
95 + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes
96 + )
97 + # default to off if minimal, allow the flags to be set otherwise
98 + if use minimal; then
99 + mycmakeargs+=(
100 + -DICINGA2_WITH_MYSQL=OFF
101 + -DICINGA2_WITH_PGSQL=OFF
102 + )
103 + else
104 + mycmakeargs+=(
105 + -DICINGA2_WITH_PGSQL=$(usex postgres ON OFF)
106 + -DICINGA2_WITH_MYSQL=$(usex mysql ON OFF)
107 + )
108 + fi
109 + # LTO
110 + if use lto; then
111 + mycmakeargs+=(
112 + -DICINGA2_LTO_BUILD=ON
113 + )
114 + else
115 + mycmakeargs+=(
116 + -DICINGA2_LTO_BUILD=OFF
117 + )
118 + fi
119 + # STUDIO
120 + if use studio; then
121 + mycmakeargs+=(
122 + -DICINGA2_WITH_STUDIO=ON
123 + )
124 + else
125 + mycmakeargs+=(
126 + -DICINGA2_WITH_STUDIO=OFF
127 + )
128 + fi
129 +
130 + cmake-utils_src_configure
131 +}
132 +
133 +src_install() {
134 + BUILDDIR="${WORKDIR}"/icinga2-${PV}_build
135 + cd "${BUILDDIR}" || die
136 +
137 + emake DESTDIR="${D}" install
138 +
139 + einstalldocs
140 +
141 + newinitd "${FILESDIR}"/icinga2.initd icinga2
142 + newconfd "${FILESDIR}"/icinga2.confd 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 + elif use postgres ; then
150 + docinto schema
151 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql
152 + docinto schema/upgrade
153 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
154 + fi
155 +
156 + keepdir /etc/icinga2
157 + keepdir /var/lib/icinga2/api/zones
158 + keepdir /var/lib/icinga2/api/repository
159 + keepdir /var/lib/icinga2/api/log
160 + keepdir /var/spool/icinga2/perfdata
161 +
162 + rm -r "${D}/var/run" || die "failed to remove /var/run"
163 + rm -r "${D}/var/cache" || die "failed to remove /var/cache"
164 +
165 + fowners icinga:icinga /etc/icinga2
166 + fowners icinga:icinga /var/lib/icinga2
167 + fowners icinga:icinga /var/spool/icinga2
168 + fowners icinga:icingacmd /var/lib/icinga2/api
169 + fowners icinga:icinga /var/spool/icinga2/perfdata
170 + fowners icinga:icingacmd /var/log/icinga2
171 +
172 + fperms ug+rwX,o-rwx /etc/icinga2
173 + fperms ug+rwX,o-rwx /var/lib/icinga2
174 + fperms ug+rwX,o-rwx /var/spool/icinga2
175 + fperms ug+rwX,o-rwx /var/log/icinga2
176 +
177 + if use vim-syntax; then
178 + insinto /usr/share/vim/vimfiles
179 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
180 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
181 + fi
182 +
183 + if use nano-syntax; then
184 + insinto /usr/share/nano
185 + doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
186 + fi
187 +}
188 +
189 +pkg_postinst() {
190 + elog "DB IDO schema upgrade required. http://docs.icinga.org/icinga2/snapshot/chapter-2.html#upgrading-the-mysql-database"
191 + elog "You will need to update your configuration files, see https://dev.icinga.org/issues/5909"
192 +}