2023-01-01 14:48:31 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
TAG=$1
|
|
|
|
ARCH=$2
|
|
|
|
|
|
|
|
[ -z "$TAG" ] && echo "Unknown version" && exit 1
|
|
|
|
[ -z "$ARCH" ] && echo "Unknown architecture" && exit 1
|
|
|
|
|
2023-01-01 15:00:19 +01:00
|
|
|
case $ARCH in
|
|
|
|
amd64|x86_64)
|
|
|
|
archname=amd64
|
|
|
|
;;
|
|
|
|
aarch64|arm64)
|
|
|
|
archname=aarch64
|
|
|
|
;;
|
|
|
|
armv7l|arm)
|
|
|
|
archname=armhf
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unkown architecture"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case $TAG in
|
|
|
|
master)
|
2023-01-01 15:04:19 +01:00
|
|
|
echo "Ignore TAG $TAG"
|
|
|
|
exit 0
|
2023-01-01 15:00:19 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-01-01 14:48:31 +01:00
|
|
|
echo "build ANTOS deb package for version $TAG, architecture $ARCH"
|
|
|
|
|
2023-01-01 15:08:05 +01:00
|
|
|
DIR="build/"
|
2023-01-01 15:00:19 +01:00
|
|
|
FILE="AntOS_${archname}.deb"
|
|
|
|
NAME="AntOS_${TAG}_${archname}"
|
2023-01-01 14:48:31 +01:00
|
|
|
|
|
|
|
[ -d "$NAME" ] && rm -rf "$NAME"
|
|
|
|
mkdir $NAME
|
|
|
|
[ ! -d "$DIR" ] && mkdir -p "$DIR"
|
|
|
|
|
|
|
|
echo "Extract binaries of version $TAG, architecture $ARCH to $NAME"
|
|
|
|
cd $NAME
|
|
|
|
tar xvzf ../antos/build/$TAG/AntOS_$ARCH.tar.gz .
|
|
|
|
mkdir DEBIAN
|
|
|
|
|
|
|
|
cat << EOF >> DEBIAN/control
|
|
|
|
Package: AntOS
|
|
|
|
Version: $TAG
|
2023-01-01 15:00:19 +01:00
|
|
|
Architecture: $archname
|
2023-01-29 23:37:12 +01:00
|
|
|
Depends: libsqlite3-0,zlib1g,libreadline8,libssl1.1,libvncclient1,libjpeg-turbo8 | libturbojpeg0
|
2023-01-01 14:48:31 +01:00
|
|
|
Maintainer: Dany LE <mrsang@iohub.dev>
|
2023-01-01 15:01:43 +01:00
|
|
|
Description: All-in-one AntOS web-desktop system for self hosting.
|
2023-01-01 14:48:31 +01:00
|
|
|
EOF
|
2023-01-01 14:54:07 +01:00
|
|
|
cat DEBIAN/control
|
|
|
|
tree .
|
2023-01-01 14:56:02 +01:00
|
|
|
cd ../
|
|
|
|
dpkg-deb --build $NAME
|
2023-01-01 14:48:31 +01:00
|
|
|
|
2023-01-01 15:08:05 +01:00
|
|
|
mv $NAME.deb $DIR
|
|
|
|
|
|
|
|
tree $DIR
|
2023-01-01 15:04:19 +01:00
|
|
|
|
2023-01-01 14:48:31 +01:00
|
|
|
|