debian-packages/packages/bin/forgejo-bin/DEBBUILD

41 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2023-03-27 14:27:46 +00:00
pkgname="forgejo"
arch="amd64"
2023-12-24 04:53:24 +00:00
pkgrel=0
2024-01-17 03:49:32 +00:00
pkgver="1.21.4-0"
2023-03-27 14:27:46 +00:00
pkgdesc="A painless selfhost git service."
url="https://codeberg.org/forgejo/forgejo"
maintainer="Leafee98 <me@leafee98.com>"
2023-07-25 04:09:56 +00:00
_arch="amd64"
2023-03-27 14:27:46 +00:00
source=(
2023-07-25 04:09:56 +00:00
"forgejo-${pkgver}-linux-${_arch}.xz::https://codeberg.org/forgejo/forgejo/releases/download/v${pkgver}/forgejo-${pkgver}-linux-${_arch}.xz"
2023-03-27 14:27:46 +00:00
"forgejo.service::materials/forgejo.service"
"robots.txt::materials/robots.txt"
2023-03-27 14:27:46 +00:00
)
function package {
2023-07-25 04:09:56 +00:00
install -Dm755 "${srcdir}/forgejo-${pkgver}-linux-${_arch}" "${pkgdir}/usr/bin/forgejo"
2023-03-27 14:27:46 +00:00
install -Dm644 "${srcdir}/forgejo.service" "${pkgdir}/usr/lib/systemd/system/forgejo.service"
install -Dm644 "${srcdir}/robots.txt" "${pkgdir}/etc/forgejo/robots.txt"
2023-03-27 14:27:46 +00:00
}
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
2023-03-27 14:27:46 +00:00
adduser --system git
chown -R git:git /var/lib/forgejo
2023-03-27 14:27:46 +00:00
systemctl daemon-reload
if systemctl is-active --quiet forgejo.service ; then
systemctl restart forgejo.service
fi
2023-03-27 14:27:46 +00:00
EOF
}