2023-08-22 06:56:08 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-03-27 14:27:46 +00:00
|
|
|
|
|
|
|
pkgname="forgejo"
|
2023-08-02 14:30:49 +00:00
|
|
|
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"
|
2023-08-22 06:56:08 +00:00
|
|
|
"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"
|
2023-08-22 06:56:08 +00:00
|
|
|
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
|
2023-07-25 04:59:19 +00:00
|
|
|
mkdir -p /etc/forgejo/conf
|
|
|
|
touch /etc/forgejo/conf/app.ini
|
2023-03-27 14:27:46 +00:00
|
|
|
|
2023-08-18 12:40:34 +00:00
|
|
|
adduser --system git
|
2023-08-22 06:56:08 +00:00
|
|
|
chown -R git:git /var/lib/forgejo
|
2023-03-27 14:27:46 +00:00
|
|
|
|
|
|
|
systemctl daemon-reload
|
2023-12-13 09:19:28 +00:00
|
|
|
if systemctl is-active --quiet forgejo.service ; then
|
|
|
|
systemctl restart forgejo.service
|
|
|
|
fi
|
2023-03-27 14:27:46 +00:00
|
|
|
EOF
|
|
|
|
}
|