#!/bin/bash VERSION=1.20.3-0 APP=forgejo DEPOT=https://codeberg.org/forgejo/forgejo GIT_VERSION=v${VERSION} DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEBIAN_VERSION_CODENAME=bookworm IMAGE_SIZE=6 PACKAGE_DEPENDENCY="build-essential nodejs golang" main() { base_package_upgrade configure_depot_nodejs 18 install_package_dependency # install_go get_git_source build makedeb } build() { cd /tmp/${APP}/ PATH=$PATH:/usr/local/go/bin TAGS="bindata sqlite sqlite_unlock_notify" make build } makedeb(){ PATH_DEB=/tmp/src/rootfs mkdir -p \ ${PATH_DEB}/etc/${APP}/ \ ${PATH_DEB}/usr/bin/ \ ${PATH_DEB}/usr/lib/systemd/system/ \ ${PATH_DEB}/var/lib/forgejo/ cp ${PATH_DEB}/forgejo.service ${PATH_DEB}/usr/lib/systemd/system/ cp /tmp/${APP}/gitea ${PATH_DEB}/usr/bin/ ln -s /usr/bin/gitea ${PATH_DEB}/usr/bin/forgejo cp /tmp/${APP}/custom/conf/app.example.ini ${PATH_DEB}/etc/${APP}/app.ini sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist }