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