From eb08c765202688c58192e035ff13fddeab1e3744 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Mon, 27 Mar 2023 21:56:56 +0800 Subject: [PATCH] Add package dufs --- dufs/DEBBUILD | 32 ++++++++++++++++++++++++++++++++ dufs/materials/dufs.service | 13 +++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 dufs/DEBBUILD create mode 100644 dufs/materials/dufs.service diff --git a/dufs/DEBBUILD b/dufs/DEBBUILD new file mode 100644 index 0000000..57ff22d --- /dev/null +++ b/dufs/DEBBUILD @@ -0,0 +1,32 @@ +#/usr/bin/env bash + +pkgname="dufs" +pkgver="0.33.0" +pkgrel=1 +pkgdesc="A file server that supports static serving, uploading, searching, accessing control, webdav..." +url="https://github.com/sigoden/dufs" +maintainer="Leafee98 " + +arch="x86_64" +platform="unknown-linux-musl" + + +source=( + "dufs-v${pkgver}-${arch}-${platform}.tar.gz::https://github.com/sigoden/dufs/releases/download/v${pkgver}/dufs-v${pkgver}-${arch}-${platform}.tar.gz" + "dufs.service::materials/dufs.service" +) + +function package { + install -Dm755 "${srcdir}/dufs" "${pkgdir}/usr/local/bin/dufs" + install -Dm644 "${srcdir}/dufs.service" "${pkgdir}/usr/lib/systemd/system/dufs.service" +} + +function debian_postinst { + cat << EOF +#!/usr/bin/env bash +useradd --system dufs +mkdir -p /srv/dufs +chown dufs:dufs -R /srv/dufs +systemctl daemon-reload +EOF +} diff --git a/dufs/materials/dufs.service b/dufs/materials/dufs.service new file mode 100644 index 0000000..652316e --- /dev/null +++ b/dufs/materials/dufs.service @@ -0,0 +1,13 @@ +[Unit] +Description=A simple file server support webdav +After=network.target + +[Service] +Type=simple +User=dufs +Group=dufs +ExecStart=/usr/local/bin/dufs --auth /@dufs:dufs /srv/dufs +Restart=on-failure + +[Install] +WantedBy=multi-user.target