pentoo-overlay/dev-util/sonarqube-bin/sonarqube-bin-8.7.0.41497.ebuild
2025-01-06 10:56:50 +08:00

74 lines
1.8 KiB
Bash

# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PV="${PV/_alpha/M}"
MY_PV="${MY_PV/_rc/-RC}"
MY_P="sonarqube-${MY_PV}"
inherit systemd java-pkg-2
DESCRIPTION="SonarQube Community Edition is an open platform to manage code quality"
HOMEPAGE="https://www.sonarqube.org/"
LICENSE="LGPL-3"
SRC_URI="https://binaries.sonarsource.com/Distribution/sonarqube/${MY_P}.zip"
RESTRICT="mirror"
SLOT="0"
KEYWORDS="~amd64"
IUSE="systemd"
#java-pkg-2 sets java based on RDEPEND so the java slot in rdepend is used to build
RDEPEND="virtual/jdk:11"
DEPEND="acct-group/sonar
acct-user/sonar
app-arch/unzip"
INSTALL_DIR="/opt/sonar"
QA_FLAGS_IGNORED="/opt/sonar/bin/linux-x86-64/wrapper
/opt/sonar/bin/linux-x86-64/lib/libwrapper.so"
S="${WORKDIR}/${MY_P}"
src_unpack() {
unpack ${A}
# TODO remove unneeded files
}
src_install() {
insinto ${INSTALL_DIR}
doins -r bin conf data elasticsearch extensions lib logs temp web COPYING
insinto ${INSTALL_DIR}/bin
doins "${FILESDIR}"/linux-multiarch.sh
newconfd "${FILESDIR}/sonar.conf" sonar
newinitd "${FILESDIR}/sonar.init" sonar
if use systemd; then
systemd_dounit "${FILESDIR}"/sonar.service
fi
fowners -R sonar:sonar ${INSTALL_DIR}
# fperms 755 "${INSTALL_DIR}/bin/linux-x86-32/sonar.sh"
# fperms 755 "${INSTALL_DIR}/bin/linux-x86-32/wrapper"
fperms 755 "${INSTALL_DIR}/bin/linux-x86-64/sonar.sh"
fperms 755 "${INSTALL_DIR}/bin/linux-x86-64/wrapper"
fperms 755 "${INSTALL_DIR}/bin/linux-multiarch.sh"
fperms -R 755 "${INSTALL_DIR}/elasticsearch"
# Protect Sonar conf on upgrade
echo "CONFIG_PROTECT=\"${INSTALL_DIR}/conf\"" > "${T}/25sonar" || die
doenvd "${T}/25sonar"
}
pkg_postinst() {
einfo "Please complete the upgrade using the following guideline:"
einfo "https://docs.sonarqube.org/display/SONAR/Upgrading"
}