Add pkgfile and system service file

This commit is contained in:
Michael Huebner 2022-07-19 09:40:23 +02:00
parent ceff1ce385
commit e63b2176f5
3 changed files with 45 additions and 2 deletions

View file

@ -5,11 +5,11 @@ authors = ["hodasemi <michaelh.95@t-online.de>"]
edition = "2018" edition = "2018"
[[bin]] [[bin]]
name = "service" name = "macroboard_service"
path = "src/service.rs" path = "src/service.rs"
[[bin]] [[bin]]
name = "gui" name = "macroboard_gui"
path = "src/gui.rs" path = "src/gui.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

33
PKGBUILD Normal file
View file

@ -0,0 +1,33 @@
# Maintainer: tdolega <tymoteusz.dolega at gmail dot com>
_pkgbase=MacroBoard-rs
pkgname="${_pkgbase}"
pkgver=0.1
pkgrel=1
pkgdesc="Gui and service for Arduino based MacroBoard"
arch=('x86_64')
url="http://gavania.de:80/hodasemi/${_pkgbase}"
license=('GPL-3.0')
makedepends=('rust')
depends=('gtk3')
conflicts=("${_pkgbase}")
source=("git+${url}")
md5sums=(SKIP)
prepare() {
cd ${_pkgbase}
}
build() {
# build binaries
cargo build --release --bin macroboard_service
cargo build --release --bin macroboard_gui
}
package() {
# copy binaries
install -Dm744 ${_pkgbase}/target/release/macroboard_service "${pkgdir}"/usr/bin/macroboard_service
install -Dm744 ${_pkgbase}/target/release/macroboard_gui "${pkgdir}"/usr/bin/macroboard_gui
# copy systemd file
install -Dm644 ${_pkgbase}/macroboard.service "${pkgdir}"/usr/lib/systemd/system/macroboard.service
}

10
macroboard.service Normal file
View file

@ -0,0 +1,10 @@
[Unit]
Description=MacroBoard listener that handles incoming events and executes macros
[Service]
Type=simple
ExecStart=/usr/bin/macroboard_service
Restart=on-failure
[Install]
WantedBy=multi-user.target