debian-packages/packages/bin/forgejo-bin/DEBBUILD
leafee98 39b75dfe92
All checks were successful
ci/woodpecker/push/build Pipeline was successful
update forgejo-bin to 1.21.7-0
2024-03-06 20:07:09 +08:00

41 lines
1.1 KiB
Bash

#!/usr/bin/env bash
pkgname="forgejo"
arch="amd64"
pkgrel=1
pkgver="1.21.7-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
}