debian-packages/packages/bin/forgejo-bin/DEBBUILD
leafee98 acef2b6536
All checks were successful
ci/woodpecker/push/build Pipeline was successful
update forgejo-bin to 7.0.0 (to semantic version)
2024-04-25 12:11:54 +08:00

41 lines
1.1 KiB
Bash

#!/usr/bin/env bash
pkgname="forgejo"
arch="amd64"
pkgrel=1
pkgver="7.0.0"
pkgdesc="A painless selfhost git service."
url="https://codeberg.org/forgejo/forgejo"
maintainer="Leafee98 <me@leafee98.com>"
_arch="amd64"
source=(
"forgejo-${pkgver}-linux-${_arch}.xz::https://codeberg.org/forgejo/forgejo/releases/download/v${pkgver}/forgejo-${pkgver}-linux-${_arch}.xz"
"forgejo.service::materials/forgejo.service"
"robots.txt::materials/robots.txt"
)
function package {
install -Dm755 "${srcdir}/forgejo-${pkgver}-linux-${_arch}" "${pkgdir}/usr/bin/forgejo"
install -Dm644 "${srcdir}/forgejo.service" "${pkgdir}/usr/lib/systemd/system/forgejo.service"
install -Dm644 "${srcdir}/robots.txt" "${pkgdir}/etc/forgejo/robots.txt"
}
function debian_postinst {
cat << EOF
#!/usr/bin/env bash
mkdir -p /var/lib/forgejo
mkdir -p /etc/forgejo/conf
touch /etc/forgejo/conf/app.ini
adduser --system --group git
chown -R git:git /var/lib/forgejo
systemctl daemon-reload
if systemctl is-active --quiet forgejo.service ; then
systemctl restart forgejo.service
fi
EOF
}