debmaker/lib/exec_in_chroot.sh

75 lines
1.7 KiB
Bash
Raw Normal View History

2022-02-20 15:02:18 +01:00
#!/bin/bash
2022-08-05 06:12:11 +02:00
2022-08-17 20:35:16 +02:00
base_package_upgrade(){
apt update
2022-08-17 20:35:16 +02:00
apt dist-upgrade -y
apt install -y git wget ca-certificates dpkg fakeroot gnupg2
}
2022-08-17 20:35:16 +02:00
install_package_dependency(){
apt-get install -y --no-install-recommends ${PACKAGE_DEPENDENCY}
}
get_git_source(){
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
2022-08-17 20:35:16 +02:00
if [ "${GIT_VERSION}" = "last" ] ;
then
git clone --depth 1 ${DEPOT} /tmp/${APP}
else
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/${APP}
fi
}
2022-08-05 06:12:11 +02:00
configure_depot_yarn() {
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
2022-08-05 06:12:11 +02:00
}
configure_depot_nodejs() {
NODE_VERSION=16.x
[ ! "$1" == "" ] && NODE_VERSION=$1
grep -q 16.x /etc/apt/sources.list.d/nodesource.list
if [ $? -ne 0 ]
then
wget -qO - https://deb.nodesource.com/setup_${NODE_VERSION} | bash
fi
}
install_go() {
GO_VERSION=1.19
[ ! "$1" == "" ] && GO_VERSION=$1
PATH=$PATH:/usr/local/go/bin
if [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ;
then
rm -rvf /usr/local/go/
wget -qO - https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xz
fi
}
install_rust() {
wget -qO - https://sh.rustup.rs > /tmp/rustup
bash /tmp/rustup -qy
}
2022-09-21 01:59:25 +02:00
install_clojure() {
2022-08-17 20:35:16 +02:00
wget -qO - https://download.clojure.org/install/linux-install-1.11.1.1155.sh | bash
}
minimum_package() {
base_package_upgrade
}
default_prebuild(){
get_git_source
}
2022-09-10 18:11:22 +02:00
source /tmp/src/debmaker
2022-08-05 06:12:11 +02:00
2022-02-20 15:02:18 +01:00
if [ ! "$1" == "" ];
2022-09-10 18:11:22 +02:00
then
2022-02-20 15:02:18 +01:00
FUNC=$1
shift
${FUNC} $*
fi