From e63b2176f529bc3dabce7e96e778c1bc45ea0ac1 Mon Sep 17 00:00:00 2001 From: Michael Huebner Date: Tue, 19 Jul 2022 09:40:23 +0200 Subject: [PATCH] Add pkgfile and system service file --- Cargo.toml | 4 ++-- PKGBUILD | 33 +++++++++++++++++++++++++++++++++ macroboard.service | 10 ++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 PKGBUILD create mode 100644 macroboard.service diff --git a/Cargo.toml b/Cargo.toml index b7cef6c..fa37205 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,11 +5,11 @@ authors = ["hodasemi "] edition = "2018" [[bin]] -name = "service" +name = "macroboard_service" path = "src/service.rs" [[bin]] -name = "gui" +name = "macroboard_gui" path = "src/gui.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..1b35e9b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: tdolega +_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 +} \ No newline at end of file diff --git a/macroboard.service b/macroboard.service new file mode 100644 index 0000000..933afd5 --- /dev/null +++ b/macroboard.service @@ -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 \ No newline at end of file