Lines 1-7
Link Here
|
1 |
# Copyright 1999-2017 Gentoo Foundation |
1 |
# Copyright 1999-2017 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
3 |
|
4 |
EAPI=5 |
4 |
EAPI=6 |
5 |
|
5 |
|
6 |
inherit depend.apache eutils multilib pax-utils toolchain-funcs user versionator |
6 |
inherit depend.apache eutils multilib pax-utils toolchain-funcs user versionator |
7 |
|
7 |
|
Lines 11-23
Link Here
|
11 |
#SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.tar.gz" |
11 |
#SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}.tar.gz" |
12 |
#S=${WORKDIR}/${PN}-${MY_PV} |
12 |
#S=${WORKDIR}/${PN}-${MY_PV} |
13 |
#SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
13 |
#SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
14 |
SRC_URI="https://github.com/${PN}/${PN}-core/archive/v${PV}/${P}.tar.gz |
14 |
SRC_URI="https://github.com/${PN}/${PN}-core/archive/v${PV}/${P}.tar.gz" |
15 |
https://dev.gentoo.org/~prometheanfire/dist/patches/CVEs/CVE-2015-8010_1.13.3.patch" |
|
|
16 |
S="${WORKDIR}/${PN}-core-${PV}" |
15 |
S="${WORKDIR}/${PN}-core-${PV}" |
17 |
|
16 |
|
18 |
LICENSE="GPL-2" |
17 |
LICENSE="GPL-2" |
19 |
SLOT="0" |
18 |
SLOT="0" |
20 |
KEYWORDS="amd64 ~arm ~hppa ~ppc ~ppc64 x86" |
19 |
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" |
21 |
IUSE="+apache2 contrib eventhandler +idoutils lighttpd +mysql perl +plugins postgres ssl +vim-syntax +web" |
20 |
IUSE="+apache2 contrib eventhandler +idoutils lighttpd +mysql perl +plugins postgres ssl +vim-syntax +web" |
22 |
DEPEND="idoutils? ( dev-db/libdbi-drivers[mysql?,postgres?] ) |
21 |
DEPEND="idoutils? ( dev-db/libdbi-drivers[mysql?,postgres?] ) |
23 |
perl? ( dev-lang/perl:= ) |
22 |
perl? ( dev-lang/perl:= ) |
Lines 45-50
Link Here
|
45 |
|
44 |
|
46 |
src_prepare() { |
45 |
src_prepare() { |
47 |
epatch "${FILESDIR}/fix-prestripped-binaries-1.7.0.patch" |
46 |
epatch "${FILESDIR}/fix-prestripped-binaries-1.7.0.patch" |
|
|
47 |
eapply_user |
48 |
} |
48 |
} |
49 |
|
49 |
|
50 |
src_configure() { |
50 |
src_configure() { |
Lines 100-171
Link Here
|
100 |
src_compile() { |
100 |
src_compile() { |
101 |
tc-export CC |
101 |
tc-export CC |
102 |
|
102 |
|
103 |
emake icinga || die "make failed" |
103 |
emake icinga |
104 |
|
104 |
|
105 |
if use web ; then |
105 |
if use web ; then |
106 |
emake DESTDIR="${D}" cgis || die |
106 |
emake DESTDIR="${D}" cgis |
107 |
fi |
107 |
fi |
108 |
|
108 |
|
109 |
if use contrib ; then |
109 |
if use contrib ; then |
110 |
emake DESTDIR="${D}" -C contrib || die |
110 |
emake DESTDIR="${D}" -C contrib |
111 |
fi |
111 |
fi |
112 |
|
112 |
|
113 |
if use idoutils ; then |
113 |
if use idoutils ; then |
114 |
emake DESTDIR="${D}" idoutils || die |
114 |
emake DESTDIR="${D}" idoutils |
115 |
fi |
115 |
fi |
116 |
} |
116 |
} |
117 |
|
117 |
|
118 |
src_install() { |
118 |
src_install() { |
119 |
dodoc Changelog README UPGRADING || die |
119 |
dodoc Changelog README UPGRADING |
120 |
|
120 |
|
121 |
if ! use web ; then |
121 |
if ! use web ; then |
122 |
sed -i -e '/cd $(SRC_\(CGI\|HTM\))/d' Makefile || die |
122 |
sed -i -e '/cd $(SRC_\(CGI\|HTM\))/d' Makefile |
123 |
fi |
123 |
fi |
124 |
|
124 |
|
125 |
emake DESTDIR="${D}" install{,-config,-commandmode} || die |
125 |
emake DESTDIR="${D}" install{,-config,-commandmode} |
126 |
|
126 |
|
127 |
if use idoutils ; then |
127 |
if use idoutils ; then |
128 |
emake DESTDIR="${D}" install-idoutils || die |
128 |
emake DESTDIR="${D}" install-idoutils |
129 |
fi |
129 |
fi |
130 |
|
130 |
|
131 |
if use contrib ; then |
131 |
if use contrib ; then |
132 |
emake DESTDIR="${D}" -C contrib install || die |
132 |
emake DESTDIR="${D}" -C contrib install |
133 |
fi |
133 |
fi |
134 |
|
134 |
|
135 |
if use eventhandler ; then |
135 |
if use eventhandler ; then |
136 |
emake DESTDIR="${D}" install-eventhandlers || die |
136 |
emake DESTDIR="${D}" install-eventhandlers |
137 |
fi |
137 |
fi |
138 |
|
138 |
|
139 |
newinitd "${FILESDIR}"/icinga-init.d icinga || die |
139 |
newinitd "${FILESDIR}"/icinga-init.d icinga |
140 |
newconfd "${FILESDIR}"/icinga-conf.d icinga || die |
140 |
newconfd "${FILESDIR}"/icinga-conf.d icinga |
141 |
if use idoutils ; then |
141 |
if use idoutils ; then |
142 |
newinitd "${FILESDIR}"/ido2db-init.d ido2db || die |
142 |
newinitd "${FILESDIR}"/ido2db-init.d ido2db |
143 |
newconfd "${FILESDIR}"/ido2db-conf.d ido2db || die |
143 |
newconfd "${FILESDIR}"/ido2db-conf.d ido2db |
144 |
insinto /usr/share/icinga/contrib/db |
144 |
insinto /usr/share/icinga/contrib/db |
145 |
doins -r module/idoutils/db/* || die |
145 |
doins -r module/idoutils/db/* |
146 |
fi |
146 |
fi |
147 |
# Apache Module |
147 |
# Apache Module |
148 |
if use web ; then |
148 |
if use web ; then |
149 |
if use apache2 ; then |
149 |
if use apache2 ; then |
150 |
insinto "${APACHE_MODULES_CONFDIR}" |
150 |
insinto "${APACHE_MODULES_CONFDIR}" |
151 |
newins "${FILESDIR}"/icinga-apache.conf 99_icinga.conf || die |
151 |
newins "${FILESDIR}"/icinga-apache.conf 99_icinga.conf |
152 |
elif use lighttpd ; then |
152 |
elif use lighttpd ; then |
153 |
insinto /etc/lighttpd |
153 |
insinto /etc/lighttpd |
154 |
newins "${FILESDIR}"/icinga-lighty.conf lighttpd_icinga.conf || die |
154 |
newins "${FILESDIR}"/icinga-lighty.conf lighttpd_icinga.conf |
155 |
else |
155 |
else |
156 |
ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver" |
156 |
ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver" |
157 |
ewarn "out-of-the-box. Since you are not using one of them, you" |
157 |
ewarn "out-of-the-box. Since you are not using one of them, you" |
158 |
ewarn "have to configure your webserver accordingly yourself." |
158 |
ewarn "have to configure your webserver accordingly yourself." |
159 |
fi |
159 |
fi |
160 |
fowners -R root:root /usr/$(get_libdir)/icinga || die |
160 |
fowners -R root:root /usr/$(get_libdir)/icinga |
161 |
cd "${D}" || die |
161 |
cd "${D}" |
162 |
find usr/$(get_libdir)/icinga -type d -exec fperms 755 {} + |
162 |
find usr/$(get_libdir)/icinga -type d -exec fperms 755 {} + |
163 |
find usr/$(get_libdir)/icinga/cgi-bin -type f -exec fperms 755 {} + |
163 |
find usr/$(get_libdir)/icinga/cgi-bin -type f -exec fperms 755 {} + |
164 |
fi |
164 |
fi |
165 |
|
165 |
|
166 |
if use eventhandler ; then |
166 |
if use eventhandler ; then |
167 |
dodir /etc/icinga/eventhandlers || die |
167 |
dodir /etc/icinga/eventhandlers |
168 |
fowners icinga:icinga /etc/icinga/eventhandlers || die |
168 |
fowners icinga:icinga /etc/icinga/eventhandlers |
169 |
fi |
169 |
fi |
170 |
|
170 |
|
171 |
keepdir /etc/icinga |
171 |
keepdir /etc/icinga |
Lines 182-192
Link Here
|
182 |
webserver=icinga |
182 |
webserver=icinga |
183 |
fi |
183 |
fi |
184 |
|
184 |
|
185 |
fowners icinga:icinga /var/lib/icinga || die "Failed chown of /var/lib/icinga" |
185 |
fowners icinga:icinga /var/lib/icinga |
186 |
fowners -R icinga:${webserver} /var/lib/icinga/rw || die "Failed chown of /var/lib/icinga/rw" |
186 |
fowners -R icinga:${webserver} /var/lib/icinga/rw |
187 |
|
187 |
|
188 |
fperms 6755 /var/lib/icinga/rw || die "Failed Chmod of ${D}/var/lib/icinga/rw" |
188 |
fperms 6755 /var/lib/icinga/rw |
189 |
fperms 0750 /etc/icinga || die "Failed chmod of ${D}/etc/icinga" |
189 |
|
|
|
190 |
# ensure ownership |
191 |
fowners -R root:root /etc/icinga |
192 |
fperms 0750 /etc/icinga |
193 |
fowners -R root:root /usr/sbin |
194 |
fowners -R root:root /usr/$(get_libdir) |
195 |
fowners -R root:root /usr/share/icinga/htdocs |
190 |
|
196 |
|
191 |
# paxmarks |
197 |
# paxmarks |
192 |
if use idoutils ; then |
198 |
if use idoutils ; then |