debian-packages/packages/bin/plik-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

40 lines
1.1 KiB
Plaintext

#/usr/bin/env bash
pkgname="plik-bin"
arch="amd64"
pkgrel=4
pkgver="1.3.8"
pkgdesc="Plik is a temporary file upload system (Wetransfer like) in Go."
_arch="amd64"
url="https://github.com/root-gg/plik/"
maintainer="Leafee98 <me@leafee98.com>"
_pkgname_base="plik-${pkgver}-linux-${_arch}"
_pkgname="${_pkgname_base}.tar.gz"
source=(
"${_pkgname}::https://github.com/root-gg/plik/releases/download/${pkgver}/${_pkgname}"
"plikd.service::materials/plikd.service"
)
function package {
install -Dm755 ${srcdir}/${_pkgname_base}/server/plikd ${pkgdir}/usr/bin/plikd
install -Dm644 ${srcdir}/${_pkgname_base}/server/plikd.cfg ${pkgdir}/etc/plik/plikd-sample.cfg
mkdir -p ${pkgdir}/usr/lib/plik
cp -r ${srcdir}/${_pkgname_base}/{changelog,clients,webapp} ${pkgdir}/usr/lib/plik
install -Dm755 ${srcdir}/plikd.service ${pkgdir}/usr/lib/systemd/system/plikd.service
}
function debian_postinst {
cat << EOF
#!/usr/bin/env bash
adduser --system plik
systemctl daemon-reload
if systemctl is-active --quiet plik.service ; then
systemctl restart plik.service
fi
EOF
}