Files
BMLFS/build-scripts/earlyoom.build

45 lines
1.7 KiB
Bash

#! /bin/bash
# Earlyoom
# Source: https://github.com/rfjakob/earlyoom/archive/refs/tags/v1.7.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: pandoc
read -p "Compile?" && make PREFIX=/usr -j2 &&
# install rule installs for non-systemd(sysv-init) or systemd systems,
# so no "make install" or "make install-initscript"
sudo -S make DESTDIR=$BUILD PREFIX=/usr install-bin && \
sudo -S mkdir -pv $BUILD/etc/earlyoom && \
sudo -S cp -v earlyoom.default $BUILD/etc/earlyoom/default && \
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
earlyoom: Early OOM Daemon for Linux (earlyoom)
earlyoom:
earlyoom: It checks the amount of available memory and free swap up to 10
earlyoom: times a second (less often if there is a lot of free memory). By
earlyoom: default if both are below 10%, it will kill the largest process
earlyoom: (highest oom_score).
earlyoom:
earlyoom: https://github.com/rfjakob/earlyoom
earlyoom:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/earlyoom-1.7-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*