1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit prefix readme.gentoo-r1
8 DESCRIPTION="Scripts to support compressed swap devices or ramdisks with zRAM"
9 HOMEPAGE="https://github.com/vaeth/zram-init/"
11 if [[ ${PV} == *9999 ]]; then
13 EGIT_REPO_URI="https://github.com/vaeth/${PN}.git"
15 SRC_URI="https://github.com/vaeth/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
21 RESTRICT="binchecks strip test"
23 BDEPEND="sys-devel/gettext"
28 || ( sys-apps/openrc sys-apps/openrc-navi sys-apps/systemd )
31 DISABLE_AUTOFORMATTING=true
33 To use zram-init, activate it in your kernel and add it to the default
35 rc-update add zram-init default
36 If you use systemd enable zram_swap, zram_tmp, and/or zram_var_tmp with
37 systemctl. You might need to modify the following file depending on the number
38 of devices that you want to create:
39 /etc/modprobe.d/zram.conf.
40 If you use the \$TMPDIR as zram device with OpenRC, you should add zram-init to
42 rc-update add zram-init boot
43 Still for the same case, you should add in the OpenRC configuration file for
44 the services using \$TMPDIR the following line:
45 rc_need=\"zram-init\""
50 hprefixify "${S}/man/${PN}.8"
52 hprefixify -e "s%(}|:)(/(usr/)?sbin)%\1${EPREFIX}\2%g" \
55 hprefixify -e "s%( |=)(/tmp)%\1${EPREFIX}\2%g" \
56 "${S}/systemd/system"/* \
61 emake PREFIX="${EPREFIX}/usr" MODIFY_SHEBANG=FALSE
66 readme.gentoo_create_doc
68 emake DESTDIR="${ED}" PREFIX="/usr" BINDIR="${ED}/sbin" SYSCONFDIR="/etc" \
69 SYSTEMDDIR="${ED}/lib/systemd/system" install
73 readme.gentoo_print_elog