-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd43255
commit dd3bca9
Showing
12 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
cd content | ||
|
||
# copy files to debian package structure | ||
cp -v ../../kaifareader.py usr/lib/kaifareader/ | ||
cp -v ../../meter_template.json etc/kaifareader/ | ||
cp -v ../../systemd/kaifareader.service lib/systemd/system/ | ||
|
||
dpkg-buildpackage -uc -us | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error creating debian package" | ||
exit 1 | ||
fi | ||
|
||
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kaifareader (0.1) unstable; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- <16918854+tirolerstefan@users.noreply.github.com> Sun, 29 Aug 2021 09:01:26 +0200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Source: kaifareader | ||
Priority: optional | ||
Maintainer: Stefan Felkel <16918854+tirolerstefan@users.noreply.github.com> | ||
Standards-Version: 4.5.1 | ||
Homepage: https://github.com/tirolerstefan/kaifa | ||
|
||
Package: kaifareader | ||
Architecture: all | ||
Depends: ${misc:Depends}, ${shlibs:Depends}, python3, python3-serial, python3-pycryptodome | ||
Description: Read out Kaifa M309 using serial connection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
etc/kaifareader/meter_template.json | ||
lib/systemd/system/kaifareader.service | ||
usr/lib/kaifareader/kaifareader.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# summary of how this script can be called: | ||
# * <postinst> `configure' <most-recently-configured-version> | ||
# * <old-postinst> `abort-upgrade' <new version> | ||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package> | ||
# <new-version> | ||
# * <postinst> `abort-remove' | ||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | ||
# <failed-install-package> <version> `removing' | ||
# <conflicting-package> <version> | ||
# for details, see http://www.debian.org/doc/debian-policy/ or | ||
# the debian-policy package | ||
|
||
case "$1" in | ||
configure) | ||
# Adapt permissions of working directory | ||
mkdir -p /var/run/kaifareader | ||
chmod 777 /var/run/kaifareader | ||
|
||
mkdir -p /var/log/kaifareader | ||
chmod 777 /var/log/kaifareader | ||
;; | ||
|
||
abort-upgrade|abort-remove|abort-deconfigure) | ||
;; | ||
|
||
*) | ||
echo "postinst called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Automatically added by dh_installsystemd/12.1.1 | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
# This will only remove masks created by d-s-h on package removal. | ||
deb-systemd-helper unmask 'kaifareader.service' >/dev/null || true | ||
|
||
# was-enabled defaults to true, so new installations run enable. | ||
if deb-systemd-helper --quiet was-enabled 'kaifareader.service'; then | ||
# Enables the unit on first installation, creates new | ||
# symlinks on upgrades if the unit file has changed. | ||
deb-systemd-helper enable 'kaifareader.service' >/dev/null || true | ||
else | ||
# Update the statefile to add new symlinks (if any), which need to be | ||
# cleaned up on purge. Also remove old symlinks. | ||
deb-systemd-helper update-state 'kaifareader.service' >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section | ||
|
||
# Automatically added by dh_installsystemd/12.1.1 | ||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
if [ -n "$2" ]; then | ||
_dh_action=restart | ||
else | ||
_dh_action=start | ||
fi | ||
deb-systemd-invoke $_dh_action 'kaifareader.service' >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Automatically added by dh_installsystemd/12.1.1 | ||
if [ -d /run/systemd/system ]; then | ||
systemctl --system daemon-reload >/dev/null || true | ||
fi | ||
# End automatically added section | ||
|
||
# Automatically added by dh_installsystemd/12.1.1 | ||
if [ "$1" = "remove" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper mask 'kaifareader.service' >/dev/null || true | ||
fi | ||
fi | ||
|
||
if [ "$1" = "purge" ]; then | ||
if [ -x "/usr/bin/deb-systemd-helper" ]; then | ||
deb-systemd-helper purge 'kaifareader.service' >/dev/null || true | ||
deb-systemd-helper unmask 'kaifareader.service' >/dev/null || true | ||
fi | ||
fi | ||
# End automatically added section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/make -f | ||
# See debhelper(7) (uncomment to enable) | ||
# output every command that modifies files on the build system. | ||
#DH_VERBOSE = 1 | ||
|
||
%: | ||
dh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
{ | ||
"loglevel": "logging.DEBUG", | ||
"logfile": "/var/log/kaifa.log", | ||
"logfile": "/var/log/kaifareader/kaifa.log", | ||
"port": "/dev/ttyUSB0", | ||
"baudrate": 2400, | ||
"parity": "serial.PARITY_NONE", | ||
"stopbits": "serial.STOPBITS_ONE", | ||
"bytesize": "serial.EIGHTBITS", | ||
"key_hex_string": "", | ||
"interval": 15, | ||
"key_hex_string": "", | ||
"export_format": "SOLARVIEW", | ||
"export_file_abspath": "/tmp/export.txt" | ||
"export_file_abspath": "/var/run/kaifareader/kaifa.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=kaifareader | ||
After=syslog.target network.target ntp.service | ||
|
||
[Service] | ||
ExecStart=/usr/bin/python3 /usr/lib/kaifareader/kaifareader.py | ||
StandardOutput=null | ||
|
||
[Install] | ||
WantedBy=multi-user.target |