debian-packages/packages/bin/filebrowser-bin/DEBBUILD
leafee98 389458615e
All checks were successful
ci/woodpecker/push/build Pipeline was successful
add/update service restart postinst
added/updated for dufs-bin, filebrowser-bin, forgejo-bin, plik-bin,
remark42-bin
2023-12-13 17:19:28 +08:00

41 lines
1.1 KiB
Plaintext

#/usr/bin/env bash
pkgname="filebrowser"
arch="amd64"
pkgver="2.26.0"
pkgrel=2
pkgdesc="Web File Browser"
maintainer="Leafee98 <me@leafee98.com>"
url="https://github.com/filebrowser/filebrowser"
_architecture="linux-amd64"
_tar_name="${_architecture}-filebrowser"
source=(
"${_tar_name}.tar.gz::https://github.com/filebrowser/filebrowser/releases/download/v${pkgver}/${_tar_name}.tar.gz"
"filebrowser.service::materials/filebrowser.service"
)
function package {
install -Dm755 ${srcdir}/filebrowser ${pkgdir}/usr/bin/filebrowser
install -Dm644 ${srcdir}/CHANGELOG.md ${pkgdir}/usr/share/filebrowser/CHANGELOG.md
install -Dm644 ${srcdir}/LICENSE ${pkgdir}/usr/share/filebrowser/LICENSE
install -Dm644 ${srcdir}/README.md ${pkgdir}/usr/share/filebrowser/README.md
install -Dm644 ${srcdir}/filebrowser.service ${pkgdir}/usr/lib/systemd/system/filebrowser.service
}
function debian_postinst {
cat << EOF
#!/usr/bin/env bash
adduser --system filebrowser
systemctl daemon-reload
if systemctl is-active --quiet filebrowser.service ; then
systemctl restart filebrowser.service
fi
EOF
}