debmaker/ressources/mautrix-syncproxy/debmaker

33 lines
713 B
Bash
Executable File

#!/bin/bash
APP=mautrix-syncproxy
VERSION=last
GIT_VERSION=$VERSION
DEB_VERSION=0.1-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=2
DEPOT=https://github.com/mautrix/syncproxy.git
STEP="base_package_upgrade envinit get_git_source build makedeb"
envinit() {
apt install -y --no-install-recommends build-essential
install_go
}
build() {
cd /tmp/${APP}
PATH=$PATH:/usr/local/go/bin
go build -o mautrix-syncproxy
}
makedeb(){
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/src/rootfs
cp /tmp/mautrix-syncproxy/mautrix-syncproxy ${PATH_DEB}/usr/bin/mautrix-syncproxy
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}