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: Wed, 26 Sep 2018 17:49:19
Message-Id: 1537984144.06619d56dacddce51c22193da28bd699b02ce489.prometheanfire@gentoo
1 commit: 06619d56dacddce51c22193da28bd699b02ce489
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 26 17:48:42 2018 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 26 17:49:04 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06619d56
7
8 net-analyzer/icinga2: 2.9.2 bump
9
10 Package-Manager: Portage-2.3.49, Repoman-2.3.11
11
12 net-analyzer/icinga2/Manifest | 1 +
13 net-analyzer/icinga2/icinga2-2.9.2.ebuild | 172 ++++++++++++++++++++++++++++++
14 2 files changed, 173 insertions(+)
15
16 diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
17 index 81abc5d3d4c..497f53e4a70 100644
18 --- a/net-analyzer/icinga2/Manifest
19 +++ b/net-analyzer/icinga2/Manifest
20 @@ -1,2 +1,3 @@
21 DIST icinga2-2.8.4.tar.gz 2510333 BLAKE2B f551a5eadc93d8455612af40e34a0922bc75f41b8064f9989c8f0c28dc2c3fb18963cf9b3272efa29f03973e7cf5824762bebff1bfa1a23c4ba39c93fc29c8e5 SHA512 b2cb5989962ac65da927cbdbac1b3345c913321d507b5113f32dd90bf969b2513478e68d52b9cd4cf255057d74428f9e42067288b7ddc59ad060ca7b84f4f114
22 DIST icinga2-2.9.1.tar.gz 2193190 BLAKE2B 29be491c4b43e218ef8aaa2128822040ccb0989e91d83f033cf7873216e4307cdbc8ee9052d79fd22220c396efeb68759acc97938e3ee596e0820e3f6c8f73bc SHA512 1d69a24f85249386e30ff1625cf522ba58e5f2ab641dbe950bf1764324a6c7516d1532942954e842002566823b0f30383747d5ec8b7bd36705aa5f0ccfa29533
23 +DIST icinga2-2.9.2.tar.gz 2194226 BLAKE2B edf3309711657437439db907f39d9dd04b57ae6b245f4299cfdfc9e8c27d18bdfa704dc5c1459a94d47985103979915a5d2d8594072586cf908e5f8a9d209ee6 SHA512 75a638a37f66a68f47ec161be4bcadbd1ca0e121143528d08d83170209e0b117fa12b1b9a03d1c1550f495bfd0509ca15f4d80be618177f2791b7a1a69308f99
24
25 diff --git a/net-analyzer/icinga2/icinga2-2.9.2.ebuild b/net-analyzer/icinga2/icinga2-2.9.2.ebuild
26 new file mode 100644
27 index 00000000000..e5caea793dd
28 --- /dev/null
29 +++ b/net-analyzer/icinga2/icinga2-2.9.2.ebuild
30 @@ -0,0 +1,172 @@
31 +# Copyright 1999-2018 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-2 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 +}