dev-python/mpmath: Bump to 1.4.0_alpha4
[gentoo/gentoo.git] / sys-block / zram-init / zram-init-9999.ebuild
blob605e0486adaa1b1eeb01684a144a27684e0511a4
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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
12         inherit git-r3
13         EGIT_REPO_URI="https://github.com/vaeth/${PN}.git"
14 else
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"
19 LICENSE="GPL-2"
20 SLOT="0"
21 RESTRICT="binchecks strip test"
23 BDEPEND="sys-devel/gettext"
25 RDEPEND="
26         >=app-shells/push-2.0
27         virtual/libintl
28         || ( sys-apps/openrc sys-apps/openrc-navi sys-apps/systemd )
31 DISABLE_AUTOFORMATTING=true
32 DOC_CONTENTS="\
33 To use zram-init, activate it in your kernel and add it to the default
34 runlevel:
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
41 the boot runlevel:
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\""
47 src_prepare() {
48         default
50         hprefixify "${S}/man/${PN}.8"
52         hprefixify -e "s%(}|:)(/(usr/)?sbin)%\1${EPREFIX}\2%g" \
53                 "${S}/sbin/${PN}.in"
55         hprefixify -e "s%( |=)(/tmp)%\1${EPREFIX}\2%g" \
56                 "${S}/systemd/system"/* \
57                 "${S}/openrc"/*/*
60 src_compile() {
61         emake PREFIX="${EPREFIX}/usr" MODIFY_SHEBANG=FALSE
64 src_install() {
65         einstalldocs
66         readme.gentoo_create_doc
68         emake DESTDIR="${ED}" PREFIX="/usr" BINDIR="${ED}/sbin" SYSCONFDIR="/etc" \
69                 SYSTEMDDIR="${ED}/lib/systemd/system" install
72 pkg_postinst() {
73         readme.gentoo_print_elog