-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=3
+EAPI=6
inherit user
DEPEND=""
RDEPEND="virtual/pam"
+S=${WORKDIR}
+
limitsdfile=40-${PN}.conf
rtgroup=realtime
-S=${WORKDIR}
-
pkg_setup() {
enewgroup ${rtgroup}
}
-print_limitsdfile() {
- printf "# Start of ${limitsdfile} from ${P}\n\n"
- printf "@${rtgroup}\t-\trtprio\t99\n"
- printf "@${rtgroup}\t-\tmemlock\tunlimited\n"
- printf "\n# End of ${limitsdfile} from ${P}\n"
-}
-
src_compile() {
einfo "Generating ${limitsdfile}"
- print_limitsdfile > "${S}/${limitsdfile}"
+ cat > ${limitsdfile} <<- EOF || die
+ # Start of ${limitsdfile} from ${P}
+
+ @${rtgroup} - rtprio 99
+ @${rtgroup} - memlock unlimited
+
+ # End of ${limitsdfile} from ${P}
+ EOF
}
src_install() {
insinto /etc/security/limits.d/
- doins "${S}/${limitsdfile}" || die
+ doins ${limitsdfile}
}
pkg_postinst() {