summaryrefslogtreecommitdiff
blob: 912caa1bb080f58661a8dbc39b5d42e036949870 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit systemd

DESCRIPTION="The leading open source automation server"
HOMEPAGE="https://jenkins.io/"
SRC_URI="https://get.jenkins.io/war/${PV}/${PN/-bin/}.war -> ${P}.war"
S="${WORKDIR}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux"

DEPEND="acct-group/jenkins
	acct-user/jenkins"

RDEPEND="acct-group/jenkins
	acct-user/jenkins
	media-fonts/dejavu
	media-libs/freetype
	!dev-util/jenkins-bin:lts
	|| ( virtual/jre:21 virtual/jre:17 )"

src_install() {
	local JENKINS_DIR=/var/lib/jenkins

	keepdir /var/log/jenkins ${JENKINS_DIR}/backup ${JENKINS_DIR}/home

	insinto /opt/jenkins
	newins "${DISTDIR}"/${P}.war ${PN/-bin/}.war

	insinto /etc/logrotate.d
	newins "${FILESDIR}"/${PN}-r3.logrotate ${PN/-bin/}

	newinitd "${FILESDIR}"/${PN}-r3.init jenkins
	newconfd "${FILESDIR}"/${PN}-r1.confd jenkins

	systemd_newunit "${FILESDIR}"/${PN}-r5.service jenkins.service

	fowners jenkins:jenkins /var/log/jenkins ${JENKINS_DIR} ${JENKINS_DIR}/home ${JENKINS_DIR}/backup
}