From d658653b67f4a06b667dbc518a6b7dcefa0c4082 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Mon, 27 Mar 2023 22:27:46 +0800 Subject: [PATCH] Add package forgejo --- forgejo/DEBBUILD | 33 +++++++++++++++++++++++++++++++ forgejo/materials/forgejo.service | 13 ++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 forgejo/DEBBUILD create mode 100644 forgejo/materials/forgejo.service diff --git a/forgejo/DEBBUILD b/forgejo/DEBBUILD new file mode 100644 index 0000000..50761d5 --- /dev/null +++ b/forgejo/DEBBUILD @@ -0,0 +1,33 @@ +#/usr/bin/env bash + +pkgname="forgejo" +pkgrel=1 +pkgver="1.19.0-2" +pkgdesc="A painless selfhost git service." +url="https://codeberg.org/forgejo/forgejo" +maintainer="Leafee98 " + +source=( + "forgejo-${pkgver}-linux-amd64.xz::https://codeberg.org/attachments/5f7f9d36-b85e-40db-b390-9bf39acbbbc5" + "forgejo.service::materials/forgejo.service" +) + +function package { + install -Dm755 "${srcdir}/forgejo-${pkgver}-linux-amd64" "${pkgdir}/usr/bin/forgejo" + install -Dm644 "${srcdir}/forgejo.service" "${pkgdir}/usr/lib/systemd/system/forgejo.service" +} + +function debian_postinst { + cat << EOF +#!/usr/bin/env bash + +mkdir -p /var/lib/forgejo +mkdir -p /etc/forgejo +touch /etc/forgejo/app.ini + +useradd --system git +chown -R git:git /var/lib/forgejo /etc/forgejo /etc/forgejo/app.ini + +systemctl daemon-reload +EOF +} diff --git a/forgejo/materials/forgejo.service b/forgejo/materials/forgejo.service new file mode 100644 index 0000000..16dd55e --- /dev/null +++ b/forgejo/materials/forgejo.service @@ -0,0 +1,13 @@ +[Unit] +Description=A painless self Git service + +[Service] +Type=simple + +User=git +Group=git + +ExecStart=/usr/bin/forgejo --custom-path /etc/forgejo --config /etc/forgejo/app.ini --work-path /var/lib/forgejo + +[Install] +WantedBy=multi-user.target