osi-tools/osi-mk.d/libretools.sh

36 lines
1021 B
Bash
Raw Normal View History

#!/hint/bash -euE
2018-08-18 18:42:42 +00:00
# Copyright (C) 2018 Luke Shumaker
# SPDX-License-Identifier: AGPL-3.0-or-later
2018-08-06 00:09:42 +00:00
2018-08-06 04:02:37 +00:00
load_module "$(dirname -- "${BASH_SOURCE[0]}")/testuser.sh"
2018-08-06 00:09:42 +00:00
packages+=(
sudo
libretools
)
2018-08-09 19:21:56 +00:00
cache_packages+=(
base-devel
)
2018-08-06 00:09:42 +00:00
2018-08-06 01:49:45 +00:00
post_install+=(10:libretools:post_install)
2018-08-06 00:09:42 +00:00
libretools:post_install() {
local arg_mountpoint=$1
cat <<-'EOT' > "${arg_mountpoint}/etc/sudoers.d/10-libretools"
# SUDO_USERS HOSTS=(AS_USER) TAGS COMMANDS
%users ALL=(ALL) NOPASSWD: SETENV: /usr/bin/librechroot, /usr/bin/libremakepkg
EOT
2018-08-11 22:46:04 +00:00
mkdir -p -- "${arg_mountpoint}/home/testuser/.config/pacman"
cat <<-'EOT' > "${arg_mountpoint}/home/testuser/.config/pacman/makepkg.conf"
2018-08-06 00:09:42 +00:00
#!/hint/bash
PKGDEST="${LIBREHOME:-$HOME}/packages/pkgdest"
SRCDEST="${LIBREHOME:-$HOME}/packages/srcdest"
SRCPKGDEST="${LIBREHOME:-$HOME}/packages/srcpkgdest"
LOGDEST="${LIBREHOME:-$HOME}/packages/logdest"
PACKAGER="Test User <testuser@example.com>"
EOT
2018-08-10 00:22:41 +00:00
mkdir -- "$arg_mountpoint"/home/testuser/packages/{,pkgdest,srcdest,srcpkgdest,logdest}
2018-08-06 00:09:42 +00:00
}