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

41 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
2023-03-27 14:27:46 +00:00
pkgname="forgejo"
arch="amd64"
pkgrel=1
2024-07-06 15:17:46 +00:00
pkgver="7.0.5"
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 --group 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
}