40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
# Maintainer: Rajnish Mishra <contact.rajnishmishra@gmail.com>
|
|
|
|
pkgname=raspmgr-git
|
|
_pkgname=Rasp-Manager
|
|
pkgver=1.0.0.r11.1901188
|
|
pkgrel=1
|
|
pkgdesc="A simple server manager for local network (especially for Raspberry Pi)"
|
|
arch=('any')
|
|
url="https://github.com/PiyushXCoder/${_pkgname}"
|
|
license=('GPL3')
|
|
makedepends=('git' 'cargo')
|
|
source=("git+https://github.com/darajnish/Rasp-Manager.git")
|
|
md5sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd "${_pkgname}"
|
|
v=$(grep -R -A3 '^version =' Cargo.toml | grep 'version =' | cut -d\" -f2)
|
|
printf "$v.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd "${_pkgname}"
|
|
sed -i 's/port = 8080/port = 80/g;s/\".\/static\"/\"\/var\/lib\/rasp_mgr\/static\"/g' Config.toml
|
|
}
|
|
|
|
build() {
|
|
cd "${_pkgname}"
|
|
cargo build --release
|
|
}
|
|
|
|
package() {
|
|
cd "${_pkgname}"
|
|
install -Dm755 "target/release/rasp_mgr" "${pkgdir}/usr/bin/rasp_mgr"
|
|
install -Dm644 "Config.toml" "${pkgdir}/etc/rasp_mgr/Config.toml"
|
|
install -Dm644 "rasp_mgr.service" "${pkgdir}/usr/lib/systemd/system/rasp_mgr.service"
|
|
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/rasp_mgr/LICENSE"
|
|
mkdir -p "${pkgdir}/var/lib/rasp_mgr/"
|
|
cp -r "static" "${pkgdir}/var/lib/rasp_mgr/"
|
|
}
|