Merge branch 'master' of github.com:john30/ebusd
This commit is contained in:
@@ -25,7 +25,8 @@ Installation
|
||||
------------
|
||||
|
||||
Building ebusd from the source requires the following packages:
|
||||
* autoconf (>=2.65)
|
||||
* autoconf (>=2.63)
|
||||
* automake (>=1.11)
|
||||
* g++
|
||||
* make
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
AC_PREREQ([2.65])
|
||||
AC_PREREQ([2.63])
|
||||
AC_INIT([ebusd], [1.0.0], [ebusd@johnm.de], [ebusd], [https://github.com/john30/ebusd])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build])
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# Maintainer: Milan Knizek <knizek volny cz>
|
||||
# Contributor: Milan Knizek <knizek volny cz>
|
||||
|
||||
pkgname=ebusd-git
|
||||
_gitname=ebusd
|
||||
pkgver=2faab3f
|
||||
_pkgver=1.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="ebusd provides a communication interface to the energy bus (ebus)."
|
||||
arch=('i686' 'x86_64' 'armv6h')
|
||||
url=https://github.com/john30/ebusd/
|
||||
license=('GPL3')
|
||||
depends=()
|
||||
makedepends=('git')
|
||||
optdepends=()
|
||||
conflicts=('ebusd')
|
||||
provides=('ebusd')
|
||||
install=ebusd.install
|
||||
options=()
|
||||
backup=('etc/conf.d/ebusd')
|
||||
source=('git://github.com/john30/ebusd.git' 'ebusd.service' 'ebusd_conf.d')
|
||||
|
||||
# This is for -git only
|
||||
pkgver() {
|
||||
cd $_gitname
|
||||
git describe --always | sed 's|-|.|g'
|
||||
}
|
||||
|
||||
build() {
|
||||
local _gitdir=$srcdir/$_gitname
|
||||
cd "$_gitdir"
|
||||
|
||||
git clean -dfx
|
||||
git reset --hard
|
||||
# git apply -v --ignore-space-change --ignore-whitespace ../some.patch
|
||||
|
||||
./autogen.sh --prefix=/usr --sysconfdir=/etc
|
||||
make -j1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$_gitname"
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
install -d "${pkgdir}"/usr/lib/systemd/system
|
||||
install -m 0644 ../ebusd.service "${pkgdir}"/usr/lib/systemd/system
|
||||
install -d "${pkgdir}"/etc/conf.d
|
||||
install -m 0644 ../ebusd_conf.d "${pkgdir}"/etc/conf.d/ebusd
|
||||
}
|
||||
|
||||
md5sums=('SKIP'
|
||||
'15b2fdb0a219fae6feecd539e8823864'
|
||||
'a2b4d5557fd90ea30e04358da62597fb')
|
||||
@@ -0,0 +1,24 @@
|
||||
pkgname=ebusd
|
||||
|
||||
post_install() {
|
||||
echo ">>> Put daemon options to /etc/conf.d/ebusd (especially /dev/tty????)"
|
||||
echo " Copy your configuration files (csv) to /etc/ebusd"
|
||||
echo " Start the daemon 'systemctl start ebusd'"
|
||||
}
|
||||
|
||||
pre_upgrade() {
|
||||
true
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
true
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
true
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Communication interface to the energy bus (ebus)
|
||||
After=local-fs.target
|
||||
ConditionPathExists=/var/log
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-/etc/conf.d/ebusd
|
||||
ExecStart=/usr/bin/ebusd $EBUSD_ARGS
|
||||
Restart=always
|
||||
PIDFile=/run/ebusd.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/conf.d/ebusd: config file for ebusd.service
|
||||
# Options to pass to the ebusd.
|
||||
# See the ebusd -h for more info.
|
||||
|
||||
EBUSD_ARGS=""
|
||||
@@ -0,0 +1,38 @@
|
||||
# Maintainer: Milan Knizek <knizek volny cz>
|
||||
# Contributor: Milan Knizek <knizek volny cz>
|
||||
|
||||
pkgname=ebusd
|
||||
#_gitname=ebusd
|
||||
pkgver=1.0.0
|
||||
_pkgver=1.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="ebusd provides a communication interface to the energy bus (ebus)."
|
||||
arch=('i686' 'x86_64' 'armv6h')
|
||||
url=https://github.com/john30/ebusd/
|
||||
license=('GPL3')
|
||||
depends=()
|
||||
optdepends=()
|
||||
conflicts=('ebusd-git')
|
||||
provides=('ebusd')
|
||||
install=ebusd.install
|
||||
options=()
|
||||
backup=('etc/conf.d/ebusd')
|
||||
source=("https://github.com/john30/ebusd/archive/v${_pkgver}.tar.gz" 'ebusd.service' 'ebusd')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"/${pkgname}-${_pkgver}
|
||||
./autogen.sh --prefix=/usr --sysconfdir=/etc
|
||||
# This is corrected in master
|
||||
sed -i 's@\(\[ -d \)\(\$(sysconfdir)/ebusd \] || mkdir -p \)\(\$(sysconfdir)/ebusd\)@\1\$(DESTDIR)\2\$(DESTDIR)\3@' src/ebusd/Makefile.am
|
||||
make -j1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}"/${pkgname}-${_pkgver}
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
install -d "${pkgdir}"/usr/lib/systemd/system
|
||||
install -m 0644 ../ebusd.service "${pkgdir}"/usr/lib/systemd/system
|
||||
install -d "${pkgdir}"/etc/conf.d
|
||||
install -m 0644 ../ebusd_conf.d "${pkgdir}"/etc/conf.d/ebusd
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
pkgname=ebusd
|
||||
|
||||
post_install() {
|
||||
echo ">>> Put daemon options to /etc/conf.d/ebusd (especially /dev/tty????)"
|
||||
echo " Copy your configuration files (csv) to /etc/ebusd"
|
||||
echo " Start the daemon 'systemctl start ebusd'"
|
||||
}
|
||||
|
||||
pre_upgrade() {
|
||||
true
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
true
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
true
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Communication interface to the energy bus (ebus)
|
||||
After=local-fs.target
|
||||
ConditionPathExists=/var/log
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-/etc/conf.d/ebusd
|
||||
ExecStart=/usr/bin/ebusd $EBUSD_ARGS
|
||||
Restart=always
|
||||
PIDFile=/run/ebusd.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/conf.d/ebusd: config file for ebusd.service
|
||||
# Options to pass to the ebusd.
|
||||
# See the ebusd -h for more info.
|
||||
|
||||
EBUSD_ARGS=""
|
||||
@@ -705,7 +705,7 @@ result_t StringDataField::writeSymbols(istringstream& input,
|
||||
if ((m_dataType.flags & BCD) != 0)
|
||||
output[baseOffset + offset - incr] = (unsigned char)((6+daysSinceSunday) % 7); // Sun=0x06
|
||||
else
|
||||
output[baseOffset + offset - incr] = (daysSinceSunday==0 ? 7 : daysSinceSunday); // Sun=0x07
|
||||
output[baseOffset + offset - incr] = (unsigned char)(daysSinceSunday==0 ? 7 : daysSinceSunday); // Sun=0x07
|
||||
}
|
||||
if (value >= 2000)
|
||||
value -= 2000;
|
||||
@@ -891,7 +891,7 @@ NumberDataField::NumberDataField(const string name, const string comment,
|
||||
const unsigned char length, const unsigned char bitCount,
|
||||
const int divisor)
|
||||
: NumericDataField(name, comment, unit, dataType, partType, length, bitCount,
|
||||
(dataType.bitCount % 8) == 0 ? 0 : (unsigned char)dataType.divisorOrFirstBit),
|
||||
(unsigned char)((dataType.bitCount % 8) == 0 ? 0 : dataType.divisorOrFirstBit)),
|
||||
m_divisor(divisor), m_precision(0)
|
||||
{
|
||||
if (divisor > 1)
|
||||
|
||||
+2
-2
@@ -306,7 +306,7 @@ public:
|
||||
PartType getPartType() const { return m_partType; }
|
||||
|
||||
// @copydoc
|
||||
virtual unsigned char getLength(PartType partType) { return partType == m_partType ? m_length : 0; };
|
||||
virtual unsigned char getLength(PartType partType) { return partType == m_partType ? m_length : (unsigned char)0; };
|
||||
// re-use same position as previous field as not all bits of fully consumed yet
|
||||
|
||||
/**
|
||||
@@ -558,7 +558,7 @@ public:
|
||||
const unsigned char length, const unsigned char bitCount,
|
||||
const map<unsigned int, string> values)
|
||||
: NumericDataField(name, comment, unit, dataType, partType, length, bitCount,
|
||||
(dataType.bitCount < 8) ? (unsigned char)dataType.divisorOrFirstBit : 0),
|
||||
(unsigned char)((dataType.bitCount < 8) ? dataType.divisorOrFirstBit : 0)),
|
||||
m_values(values) {}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user