-- ssh dick@hardpillu --
dick@hardpillU:~$ uname -a
Linux hardpillU 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
dick@hardpillU:~$ curl https://download.dickhardpill.com/a.sh
#!/bin/bash
set -e
if [[ "$OSTYPE" == "darwin"* ]]; then
ESOS="darwin"
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
if [[ $(awk /^ID=/ /etc/os-release) == *"ubuntu" ]]; then
ESOS="ubuntu"
elif [[ $(awk /^ID=/ /etc/os-release) == *"debian" ]]; then
ESOS="debian"
fi
else
echo "can't currently build with this OS"
fi
docker_key="/etc/apt/keyrings/docker.asc"
copd () {
[ -f $HOME/$fname.z64 ] && cp -v $file $HOME/$fname.`printf '%s\n' $HOME/$fname* | wc -l`.z64 || cp -v $file $HOME/$fname.z64
}
make_ROM() {
source $HOME/temp_paths
make -C $p64_D
rm $HOME/temp_paths
}
docker_keys () {
sudo apt update
sudo apt -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/$ESOS/gpg -o $docker_key
sudo chmod a+r $docker_key
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$ESOS \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
}
build_U () (
set -e
[ -f $docker_key ] && sudo mv $docker_key $docker_key.backup && docker_keys || docker_keys
sudo apt -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin make
[ -d $HOME/portal64 ] && git -C $HOME/portal64 pull || git clone https://github.com/mwpenny/portal64-still-alive.git $HOME/portal64
p64_D="$HOME/portal64"
git_tip="$(git -C $p64_D rev-parse --short HEAD)"
echo "the current build as of $(date) is $git_tip"
fname=Portal_$(date +%Y%m%d)\_$git_tip
build_D="$p64_D/build"
vpk_D="$p64_D/vpk"
file="$build_D/portal.z64"
[ -d $p64_D/build ] && sudo make -C $p64_D -f Makefile.docker clean || :
[ -d "$vpk_D/Portal" ] && echo "$vpk_D/Portal exists, not linking" || mv $HOME/Portal $vpk_D/
sed -i 's`[[:space:]]-it[[:space:]]` `g' $p64_D/Makefile.docker
sudo usermod -aG docker $USER
newgrp docker >>EOF
make -C $p64_D -f Makefile.docker image
make -C $p64_D -f Makefile.docker
EOF
copd
)
if [[ "$ESOS" == "darwin" ]]; then
echo "MacOS/Darwin still in development"
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
build_U
else echo "use Debian/Ubuntu"
fi