sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / sys-auth / realtime-base / realtime-base-0.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit user
7
8 DESCRIPTION="Sets up realtime scheduling"
9 HOMEPAGE="http://jackaudio.org/faq/linux_rt_config.html"
10 SRC_URI=""
11
12 LICENSE="public-domain"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 s390 sparc x86"
15 IUSE=""
16
17 DEPEND=""
18 RDEPEND="sys-libs/pam"
19
20 S=${WORKDIR}
21
22 limitsdfile=40-${PN}.conf
23 rtgroup=realtime
24
25 pkg_setup() {
26         enewgroup ${rtgroup}
27 }
28
29 src_compile() {
30         einfo "Generating ${limitsdfile}"
31         cat > ${limitsdfile} <<- EOF || die
32                 # Start of ${limitsdfile} from ${P}
33
34                 @${rtgroup}     -       rtprio  99
35                 @${rtgroup}     -       memlock unlimited
36
37                 # End of ${limitsdfile} from ${P}
38         EOF
39 }
40
41 src_install() {
42         insinto /etc/security/limits.d/
43         doins ${limitsdfile}
44 }
45
46 pkg_postinst() {
47         elog "We have added realtime scheduling privileges for users in the ${rtgroup} group."
48         elog "Please make sure users needing such privileges are in that group."
49 }