add: controller
fix: structure in directories
This commit is contained in:
parent
583ea0ac9d
commit
e811f35c84
10 changed files with 122 additions and 1 deletions
46
controller-testing/PKGBUILD
Normal file
46
controller-testing/PKGBUILD
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
# Maintainer: Tobias Reisinger <tobias@msrg.cc>
|
||||||
|
pkgname=emgauwa-controller-testing
|
||||||
|
pkgver=0.0.1
|
||||||
|
pkgrel=1
|
||||||
|
epoch=
|
||||||
|
pkgdesc=""
|
||||||
|
arch=('any')
|
||||||
|
url="https://git.serguzim.me/emgauwa/controller"
|
||||||
|
license=('unknown')
|
||||||
|
groups=()
|
||||||
|
depends=('glibc' 'lmdb')
|
||||||
|
makedepends=('make' 'cmake' 'gcc')
|
||||||
|
conflicts=('emgauwa-controller')
|
||||||
|
backup=('etc/emgauwa/controller.ini')
|
||||||
|
source=("$pkgname-$pkgver.tar.gz::https://ci.serguzim.me/archive/emgauwa-controller-testing/working/$pkgname.tar.gz"
|
||||||
|
"controller.ini"
|
||||||
|
"emgauwa-controller-testing.service"
|
||||||
|
"emgauwa-controller-testing.sysusers"
|
||||||
|
"emgauwa-controller-testing.tmpfiles")
|
||||||
|
sha256sums=("SKIP"
|
||||||
|
"8175d418a57c6fedfaaf9c622b1c714576dc117e920a3426ffe1095d3d87f597"
|
||||||
|
"0bbc44d680be2011800c553ae863663148be0820f08349993578c88e9a23b143"
|
||||||
|
"b9cde58b9e9b0605ca4a1eddd78067c55aa3c8d40f80cde0a25c4da9f6f95798"
|
||||||
|
"5a4ce46c1302546509c0024d4614b5b0d47dde02467b7bf52b28ef6c4ead91e7")
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "$pkgname"
|
||||||
|
mkdir -p "build"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$pkgname/build" || exit 1
|
||||||
|
cmake ..
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
install -Dm755 "${pkgname}/build/controller" "${pkgdir}/usr/bin/emgauwa-controller"
|
||||||
|
|
||||||
|
install -Dm644 "controller.ini" "${pkgdir}/etc/emgauwa/controller.ini"
|
||||||
|
install -Dm644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
|
||||||
|
install -Dm644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
|
||||||
|
install -Dm644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
|
||||||
|
|
||||||
|
install -Ddm644 "${pkgdir}/var/lib/emgauwa/controller"
|
||||||
|
}
|
57
controller-testing/controller.ini
Normal file
57
controller-testing/controller.ini
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
[controller]
|
||||||
|
name = new emgauwa device
|
||||||
|
: 4421 for dev-env; 4420 for testing-env; 4419 for prod-env; 4422 for testing
|
||||||
|
discovery-port = 4420
|
||||||
|
relay-count = 10
|
||||||
|
database = /var/lib/emgauwa/db.lmdb
|
||||||
|
log-level = debug
|
||||||
|
|
||||||
|
[relay-0]
|
||||||
|
driver = piface
|
||||||
|
pin = 0
|
||||||
|
inverted = 0
|
||||||
|
|
||||||
|
[relay-1]
|
||||||
|
driver = piface
|
||||||
|
pin = 1
|
||||||
|
inverted = 0
|
||||||
|
|
||||||
|
[relay-2]
|
||||||
|
driver = gpio
|
||||||
|
pin = 5
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-3]
|
||||||
|
driver = gpio
|
||||||
|
pin = 4
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-4]
|
||||||
|
driver = gpio
|
||||||
|
pin = 3
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-5]
|
||||||
|
driver = gpio
|
||||||
|
pin = 2
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-6]
|
||||||
|
driver = gpio
|
||||||
|
pin = 1
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-7]
|
||||||
|
driver = gpio
|
||||||
|
pin = 0
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-8]
|
||||||
|
driver = gpio
|
||||||
|
pin = 16
|
||||||
|
inverted = 1
|
||||||
|
|
||||||
|
[relay-9]
|
||||||
|
driver = gpio
|
||||||
|
pin = 15
|
||||||
|
inverted = 1
|
12
controller-testing/emgauwa-controller-testing.service
Normal file
12
controller-testing/emgauwa-controller-testing.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Emgauwa Controller [Testing] Launcher
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/var/lib/emgauwa/controller/
|
||||||
|
ExecStart=emgauwa-controller start -c /etc/emgauwa/controller.ini
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
5
controller-testing/emgauwa-controller-testing.tmpfiles
Normal file
5
controller-testing/emgauwa-controller-testing.tmpfiles
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
d /var/lib/emgauwa 0750
|
||||||
|
d /var/lib/emgauwa/controller 0750
|
||||||
|
Z /var/lib/emgauwa - emgauwa emgauwa
|
||||||
|
z /etc/emgauwa 0755 root emgauwa
|
||||||
|
z /etc/emgauwa/controller.ini 0660 root emgauwa
|
|
@ -12,7 +12,7 @@ depends=('glibc' 'sqlite')
|
||||||
makedepends=('make' 'cmake' 'gcc')
|
makedepends=('make' 'cmake' 'gcc')
|
||||||
conflicts=('emgauwa-core')
|
conflicts=('emgauwa-core')
|
||||||
backup=('etc/emgauwa/core.ini')
|
backup=('etc/emgauwa/core.ini')
|
||||||
source=("https://ci.serguzim.me/archive/emgauwa-core/latest/$pkgname.tar.gz"
|
source=("$pkgname-$pkgver.tar.gz::https://ci.serguzim.me/archive/emgauwa-core-testing/working/$pkgname.tar.gz"
|
||||||
"core.ini"
|
"core.ini"
|
||||||
"emgauwa-core-testing.service"
|
"emgauwa-core-testing.service"
|
||||||
"emgauwa-core-testing.sysusers"
|
"emgauwa-core-testing.sysusers"
|
1
core-testing/emgauwa-core-testing.sysusers
Normal file
1
core-testing/emgauwa-core-testing.sysusers
Normal file
|
@ -0,0 +1 @@
|
||||||
|
u emgauwa - "Emgauwa daemon user" /var/lib/emgauwa /bin/bash
|
Reference in a new issue