debmaker/ressources/element-web/debmaker

44 lines
998 B
Bash
Executable File

#!/bin/bash
VERSION=1.11.2
[ -e ./lib/function.sh ] && source ./lib/function.sh
APP=element-web
DEPOT=https://github.com/vector-im/element-web.git
GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=4
STEP="envinit prebuild build makedeb"
envinit() {
minimum_package
configure_depot_yarn
configure_depot_nodejs
apt-get update
apt-get dist-upgrade -y
apt install -y --no-install-recommends yarn nodejs
}
prebuild(){
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/${APP}
}
build() {
cd /tmp/${APP}
yarn install
yarn dist
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
tar -zxf /tmp/${APP}/dist/element-${GIT_VERSION}.tar.gz --strip-components=1 -C ${PATH_DEB}/usr/share/element-web/
cp /tmp/${APP}/config.sample.json ${PATH_DEB}/etc/element-web/config.json
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}