Files
BMLFS/build-scripts/bubblewrap.build
2024-02-08 20:43:27 -06:00

67 lines
2.4 KiB
Bash

#! /bin/bash
# Bubblewrap
# Source: https://github.com/containers/bubblewrap/releases/download/v0.8.0/bubblewrap-0.8.0.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
# If optimizing with GCC:
export CFLAGS="-march=native -pipe "
export CFLAGS+="-fno-lto -fstack-protector-strong -fzero-call-used-regs=used "
export CXXFLAGS=$CFLAGS
unset LDFLAGS
meson setup --prefix=/usr --buildtype=release OUT
read -p "Compile?" && ninja -C OUT -j2 &&
sudo -S DESTDIR=$BUILD ninja -C OUT install &&
sudo -S mkdir -pv /BMAN/install && \
sudo -S mkdir -pv /BMAN/usr && \
sudo -S mv $BUILD/usr/share /BMAN/usr/ && \
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------------------------------------------------------|
bubblewrap: bubblewrap (unprivileged sandboxing tool)
bubblewrap:
bubblewrap: Many container runtimes focus on providing infrastructure for
bubblewrap: system administrators and orchestration tools to run containers.
bubblewrap:
bubblewrap: Bubblewrap provides container runtime for unprivileged users, which
bubblewrap: reduces the surface area for privilege escalation.
bubblewrap:
bubblewrap:
bubblewrap:
bubblewrap:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/bubblewrap-0.8.0-$PSUFFIX &&
cd /BMAN && \
cat > /tmp/slack-desc << "EOF"
bubblewrap-doc: Manuals for (unprivileged sandboxing tool)
bubblewrap-doc:
bubblewrap-doc: Many container runtimes focus on providing infrastructure for
bubblewrap-doc: system administrators and orchestration tools to run containers.
bubblewrap-doc:
bubblewrap-doc: Bubblewrap provides container runtime for unprivileged users, which
bubblewrap-doc: reduces the surface area for privilege escalation.
bubblewrap-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/bubblewrap-doc-0.8.0-$NOPSUFFIX && \
sudo -S rm -rf ${BUILD}/* /BMAN/*