packaging

This commit is contained in:
Alex Janka 2024-02-25 11:44:17 +11:00
parent 8b8049df2f
commit 4940ced069
3 changed files with 50 additions and 0 deletions

View file

@ -2,6 +2,15 @@
name = "homekit-exporter"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "Prometheus exporter for HomeKit sensors"
authors = ["Alex Janka"]
[package.metadata.deb]
maintainer-scripts = "packaging/service/"
systemd-units = { enable = false }
depends = ""
assets = [["target/release/homekit-exporter", "usr/bin/", "755"]]
[dependencies]
tokio = { version = "1.36", features = ["full"] }

View file

@ -0,0 +1,26 @@
# Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=homekit-logger
pkgver=0.1.0
pkgrel=1
pkgdesc="Prometheus exporter for HomeKit sensors"
arch=('x86_64' 'aarch64')
url="https://git.alexjanka.com/alex/homekit-logger"
license=('custom')
depends=('gcc-libs')
makedepends=('cargo')
source=("homekit-logger::git+https://git.alexjanka.com/alex/homekit-logger")
sha512sums=('SKIP')
build() {
cd "homekit-logger"
cargo build --release --locked
}
package() {
cd "homekit-logger"
install -Dm755 "target/release/homekit-exporter" "$pkgdir/usr/bin/homekit-exporter"
install -D -m 0644 packaging/service/service "${pkgdir}/usr/lib/systemd/system/homekit-exporter.service"
}

View file

@ -0,0 +1,15 @@
[Unit]
Description=HomeKit Logger
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=10s
Environment="RUST_LOG=error,warn"
Environment="LOG_TIMESTAMP=false"
ExecStart=/usr/bin/homekit-logger
[Install]
WantedBy=multi-user.target