add package plik-bin

This commit is contained in:
leafee98 2023-06-30 22:02:31 +08:00
parent 82201d6c37
commit c1b9fb3617
2 changed files with 50 additions and 0 deletions

34
plik-bin/DEBBUILD Normal file
View file

@ -0,0 +1,34 @@
#/usr/bin/env bash
pkgname="plik-bin"
pkgrel=2
pkgver="1.3.7"
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/1.3.7/${_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
useradd --system plik
systemctl daemon-reload
EOF
}

View file

@ -0,0 +1,16 @@
[Unit]
Description=Plik is a temporary file upload system (Wetransfer like) in Go.
After=network.target apache2.service
[Service]
User=plik
# Start program here, plik needs webapp, clients and changelog to
# host changelog and provide download of clients
WorkingDirectory=/usr/lib/plik/
ExecStart=/usr/bin/plikd --config /etc/plik/plikd.cfg
Restart=on-failure
[Install]
WantedBy=multi-user.target