#! /bin/bash set -e set -x TAG=$1 ARCH=$2 [ -z "$TAG" ] && echo "Unknown version" && exit 1 [ -z "$ARCH" ] && echo "Unknown architecture" && exit 1 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) echo "Ignore TAG $TAG" exit 0 ;; *) ;; esac echo "build ANTOS deb package for version $TAG, architecture $ARCH" DIR="build/" FILE="AntOS_${archname}.deb" NAME="AntOS_${TAG}_${archname}" [ -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 Architecture: $archname Depends: libsqlite3,zlib1g,libreadline,libssl,libjpeg-turbo8,libffi,libvncserver Maintainer: Dany LE Description: All-in-one AntOS web-desktop system for self hosting. EOF cat DEBIAN/control tree . cd ../ dpkg-deb --build $NAME mv $NAME.deb $DIR tree $DIR