mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-25 15:31:07 +00:00
69aec6bfe5
- Ostinato .apk building script generalized to use it for any package - Reset terminal mode using /etc/motd
35 lines
876 B
Bash
Executable File
35 lines
876 B
Bash
Executable File
#!/bin/sh
|
|
|
|
package=$1
|
|
version=$2
|
|
if [ -z "$package" ]; then
|
|
echo "Usage: docker-apk-build <package> [<alpine version>]" >&2
|
|
exit 1
|
|
fi
|
|
[ -z "$version" ] && version="latest"
|
|
|
|
mkdir -p "$package"
|
|
docker run --rm -i -v "$PWD/$package:/package" -e "package=$package" alpine:$version << 'EOF'
|
|
apk add alpine-sdk
|
|
|
|
adduser -D builder
|
|
addgroup builder abuild
|
|
mkdir -p /var/cache/distfiles
|
|
|
|
su - builder << END_OF_SU
|
|
mkdir -p .abuild
|
|
echo 'PACKAGER="GNS3 Packer <packer@gns3-registry>"' > .abuild/abuild.conf
|
|
abuild-keygen -a -n -q
|
|
|
|
git clone --depth 1 git://git.alpinelinux.org/aports
|
|
cd aports/*/"$package"
|
|
abuild -r
|
|
END_OF_SU
|
|
|
|
alpine_version=$(cat /etc/alpine-release)
|
|
alpine_version=${alpine_version%.*}
|
|
mkdir -p "/package/${alpine_version}"
|
|
cp -p /home/builder/packages/*/*/*.apk "/package/${alpine_version}"
|
|
chown -R $(stat -c '%u:%g' /package) "/package/${alpine_version}"
|
|
EOF
|