summaryrefslogtreecommitdiff
blob: d42f123b88a5c93e012b617cbfc8f07b91c501b4 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit java-utils-2 systemd tmpfiles

MY_PN=${PN%-bin}
MY_P=${MY_PN}-${PV}

DESCRIPTION="An autosuspend and wakeup daemon"
HOMEPAGE="https://gitlab.com/Flow/sandmann"
SRC_URI="https://geekplace.eu/projects/${MY_PN}/archive/${MY_P}.tar.xz"
KEYWORDS="amd64"

LICENSE="GPL-3+ LGPL-3"
SLOT="0"

# >=java-config-2.3.2 to get the libdir fix.
RDEPEND="
	acct-user/sandmann
	>=dev-java/java-config-2.3.2
	sys-apps/systemd
	sys-auth/polkit
	|| (
		virtual/jre:17
		virtual/jre:21
	)
"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	default
	sed -i \
		-e 's|^ExecStart=.*|ExecStart=/usr/bin/sandmann|' \
		sandmann.service || die
}

src_compile() {
	:
}

src_install() {
	local my_emake_args=(
		DESTDIR="${D}"
		SYSTEMD_SYSTEM_UNIT_DIR="$(systemd_get_systemunitdir)"
		TARGET_BINARY=
		SOURCELESS_INSTALL=true
	)

	emake ${my_emake_args[@]} install

	java-pkg_newjar out/main/assembly.dest/out.jar sandmann.jar
	java-pkg_dolauncher sandmann

	dodoc README.md
}

pkg_postinst() {
	tmpfiles_process sandmann.conf
}