1 |
commit: ecce4c9a716054dfdee2e5cc938d1b0dff1a4669 |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 22 15:24:17 2018 +0000 |
4 |
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 22 15:25:25 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecce4c9a |
7 |
|
8 |
net-analyzer/icinga2: 2.8.2 bup |
9 |
|
10 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
11 |
|
12 |
net-analyzer/icinga2/Manifest | 1 + |
13 |
net-analyzer/icinga2/icinga2-2.8.2.ebuild | 176 ++++++++++++++++++++++++++++++ |
14 |
2 files changed, 177 insertions(+) |
15 |
|
16 |
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest |
17 |
index b71de2bd5a1..0b6e9f882e7 100644 |
18 |
--- a/net-analyzer/icinga2/Manifest |
19 |
+++ b/net-analyzer/icinga2/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST icinga2-2.8.1.tar.gz 2501182 BLAKE2B a32e60f8888d43eacedaee3cb33b719e2e405a6123710f7806b6c82eccb80eeb0ab0318a34302a5f3b310b258702214148f34719f166b3a3807ef2c9d4b28fa0 SHA512 27dcd2de1a9fa81327fa9cf25f25171e471715b4506dfd312bcd6c10408520cef86d260762f4340a00aaa7824c8ab65baadf541b7e104bd378204667dc92f762 |
22 |
+DIST icinga2-2.8.2.tar.gz 2507304 BLAKE2B 0f2cc58fff6d9f648b302c3af07e24fcf20e0c10c140d4052991477e1dbf5c158157f0c64e8d3aa26a6fadc46db25eb26d7b5d5c791a8a7d91445be10f0cecea SHA512 55a9791fa14d0e3e559b3083ec83ad301b62a677a1b56ad30227b1a3591612e2fe536a34a25705fb935a6ca8e42f45ff006f9856b47103da054db15582455579 |
23 |
|
24 |
diff --git a/net-analyzer/icinga2/icinga2-2.8.2.ebuild b/net-analyzer/icinga2/icinga2-2.8.2.ebuild |
25 |
new file mode 100644 |
26 |
index 00000000000..4108f14e414 |
27 |
--- /dev/null |
28 |
+++ b/net-analyzer/icinga2/icinga2-2.8.2.ebuild |
29 |
@@ -0,0 +1,176 @@ |
30 |
+# Copyright 1999-2018 Gentoo Foundation |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=6 |
34 |
+if [[ ${PV} != 9999 ]]; then |
35 |
+ inherit cmake-utils depend.apache eutils systemd toolchain-funcs user wxwidgets |
36 |
+ SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
37 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" |
38 |
+else |
39 |
+ inherit cmake-utils depend.apache eutils git-r3 systemd toolchain-funcs user wxwidgets |
40 |
+ EGIT_REPO_URI="https://github.com/Icinga/icinga2.git" |
41 |
+ EGIT_BRANCH="master" |
42 |
+ KEYWORDS="" |
43 |
+fi |
44 |
+ |
45 |
+DESCRIPTION="Distributed, general purpose, network monitoring engine" |
46 |
+HOMEPAGE="http://icinga.org/icinga2" |
47 |
+ |
48 |
+LICENSE="GPL-2" |
49 |
+SLOT="0" |
50 |
+IUSE="+mysql postgres classicui console libressl lto mail minimal nano-syntax +plugins studio +vim-syntax" |
51 |
+WX_GTK_VER="3.0" |
52 |
+ |
53 |
+CDEPEND=" |
54 |
+ !libressl? ( dev-libs/openssl:0= ) |
55 |
+ libressl? ( dev-libs/libressl:0= ) |
56 |
+ >=dev-libs/boost-1.58-r1 |
57 |
+ console? ( dev-libs/libedit ) |
58 |
+ mysql? ( virtual/mysql ) |
59 |
+ postgres? ( dev-db/postgresql:= )" |
60 |
+ |
61 |
+DEPEND=" |
62 |
+ ${CDEPEND} |
63 |
+ sys-devel/bison |
64 |
+ >=sys-devel/flex-2.5.35" |
65 |
+ |
66 |
+RDEPEND=" |
67 |
+ ${CDEPEND} |
68 |
+ plugins? ( || ( |
69 |
+ net-analyzer/monitoring-plugins |
70 |
+ net-analyzer/nagios-plugins |
71 |
+ ) ) |
72 |
+ mail? ( virtual/mailx ) |
73 |
+ classicui? ( net-analyzer/icinga[web] ) |
74 |
+ studio? ( x11-libs/wxGTK:3.0 )" |
75 |
+ |
76 |
+REQUIRED_USE="!minimal? ( || ( mysql postgres ) )" |
77 |
+ |
78 |
+want_apache2 |
79 |
+ |
80 |
+pkg_setup() { |
81 |
+ depend.apache_pkg_setup |
82 |
+ if use studio ; then |
83 |
+ setup-wxwidgets |
84 |
+ fi |
85 |
+ enewgroup icinga |
86 |
+ enewgroup icingacmd |
87 |
+ enewgroup nagios # for plugins |
88 |
+ enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios" |
89 |
+} |
90 |
+ |
91 |
+src_configure() { |
92 |
+ sed -i 's/FLAGS\}\ \-g/FLAGS\}\ \-lpthread\ /g' CMakeLists.txt || die |
93 |
+ local mycmakeargs=( |
94 |
+ -DICINGA2_UNITY_BUILD=FALSE |
95 |
+ -DCMAKE_VERBOSE_MAKEFILE=ON |
96 |
+ -DCMAKE_BUILD_TYPE=None |
97 |
+ -DCMAKE_INSTALL_PREFIX=/usr |
98 |
+ -DCMAKE_INSTALL_SYSCONFDIR=/etc |
99 |
+ -DCMAKE_INSTALL_LOCALSTATEDIR=/var |
100 |
+ -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2 |
101 |
+ -DICINGA2_PLUGINDIR="/usr/$(get_libdir)/nagios/plugins" |
102 |
+ -DICINGA2_USER=icinga |
103 |
+ -DICINGA2_GROUP=icingacmd |
104 |
+ -DICINGA2_COMMAND_GROUP=icingacmd |
105 |
+ -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes |
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 |
+ # STUDIO |
131 |
+ if use studio; then |
132 |
+ mycmakeargs+=( |
133 |
+ -DICINGA2_WITH_STUDIO=ON |
134 |
+ ) |
135 |
+ else |
136 |
+ mycmakeargs+=( |
137 |
+ -DICINGA2_WITH_STUDIO=OFF |
138 |
+ ) |
139 |
+ fi |
140 |
+ |
141 |
+ cmake-utils_src_configure |
142 |
+} |
143 |
+ |
144 |
+src_install() { |
145 |
+ BUILDDIR="${WORKDIR}"/icinga2-${PV}_build |
146 |
+ cd "${BUILDDIR}" || die |
147 |
+ |
148 |
+ emake DESTDIR="${D}" install |
149 |
+ |
150 |
+ einstalldocs |
151 |
+ |
152 |
+ newinitd "${FILESDIR}"/icinga2.initd icinga2 |
153 |
+ |
154 |
+ if use mysql ; then |
155 |
+ docinto schema |
156 |
+ newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql |
157 |
+ docinto schema/upgrade |
158 |
+ dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/* |
159 |
+ elif use postgres ; then |
160 |
+ docinto schema |
161 |
+ newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql |
162 |
+ docinto schema/upgrade |
163 |
+ dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/* |
164 |
+ fi |
165 |
+ |
166 |
+ keepdir /etc/icinga2 |
167 |
+ keepdir /var/lib/icinga2/api/zones |
168 |
+ keepdir /var/lib/icinga2/api/repository |
169 |
+ keepdir /var/lib/icinga2/api/log |
170 |
+ keepdir /var/spool/icinga2/perfdata |
171 |
+ |
172 |
+ rm -r "${D}/var/run" || die "failed to remove /var/run" |
173 |
+ rm -r "${D}/var/cache" || die "failed to remove /var/cache" |
174 |
+ |
175 |
+ fowners root:icinga /etc/icinga2 |
176 |
+ fperms 0750 /etc/icinga2 |
177 |
+ fowners icinga:icinga /var/lib/icinga2 |
178 |
+ fowners icinga:icinga /var/spool/icinga2 |
179 |
+ fowners -R icinga:icingacmd /var/lib/icinga2/api |
180 |
+ fowners icinga:icinga /var/spool/icinga2/perfdata |
181 |
+ fowners icinga:icingacmd /var/log/icinga2 |
182 |
+ |
183 |
+ fperms ug+rwX,o-rwx /etc/icinga2 |
184 |
+ fperms ug+rwX,o-rwx /var/lib/icinga2 |
185 |
+ fperms ug+rwX,o-rwx /var/spool/icinga2 |
186 |
+ fperms ug+rwX,o-rwx /var/log/icinga2 |
187 |
+ |
188 |
+ if use vim-syntax; then |
189 |
+ insinto /usr/share/vim/vimfiles |
190 |
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect |
191 |
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax |
192 |
+ fi |
193 |
+ |
194 |
+ if use nano-syntax; then |
195 |
+ insinto /usr/share/nano |
196 |
+ doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc |
197 |
+ fi |
198 |
+} |
199 |
+ |
200 |
+pkg_postinst() { |
201 |
+ if [[ ${PV} != 9999 && -n ${REPLACING_VERSIONS} && ${REPLACING_VERSIONS} != ${PV} ]]; then |
202 |
+ elog "DB IDO schema upgrade may be required required. |
203 |
+ http://docs.icinga.org/icinga2/snapshot/doc/module/icinga2/chapter/upgrading-icinga-2" |
204 |
+ fi |
205 |
+} |