2018-11-20 11:16:33 +01:00
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2021-06-23 14:52:35 +02:00
|
|
|
EAPI=7
|
2018-11-20 11:16:33 +01:00
|
|
|
|
2023-04-20 09:04:40 +02:00
|
|
|
inherit cmake systemd
|
2018-11-20 11:16:33 +01:00
|
|
|
|
|
|
|
if [[ ${PV} == "9999" ]]; then
|
|
|
|
EGIT_REPO_URI="https://github.com/volkszaehler/${PN}"
|
|
|
|
inherit git-r3
|
|
|
|
KEYWORDS=""
|
|
|
|
else
|
|
|
|
SRC_URI=""
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DESCRIPTION="A tool to read and log measurements of a wide variety of smart meters and sensors to the volkszaehler.org middleware"
|
|
|
|
HOMEPAGE="https://github.com/volkszaehler/vzlogger"
|
|
|
|
|
|
|
|
LICENSE="GPL-3"
|
|
|
|
SLOT="0"
|
2020-04-29 11:58:11 +02:00
|
|
|
IUSE="+logrotate +microhttpd mqtt ocr oms +sml systemd"
|
2018-11-20 11:16:33 +01:00
|
|
|
|
2020-04-29 11:58:11 +02:00
|
|
|
RDEPEND="
|
|
|
|
dev-libs/cyrus-sasl
|
|
|
|
dev-libs/json-c
|
|
|
|
dev-libs/libgcrypt
|
|
|
|
net-libs/gnutls
|
2018-11-20 11:16:33 +01:00
|
|
|
logrotate? ( app-admin/logrotate )
|
2020-04-01 21:31:05 +02:00
|
|
|
microhttpd? ( >=net-libs/libmicrohttpd-0.9 )
|
2020-04-29 11:58:11 +02:00
|
|
|
mqtt? ( app-misc/mosquitto )
|
2018-11-20 11:16:33 +01:00
|
|
|
ocr? ( media-libs/leptonica app-text/tesseract )
|
|
|
|
oms? ( sci-libs/libmbus )
|
|
|
|
sml? ( sci-libs/libsml )
|
|
|
|
"
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
virtual/pkgconfig"
|
|
|
|
|
|
|
|
src_prepare() {
|
2020-04-01 21:31:05 +02:00
|
|
|
#epatch "${FILESDIR}"/"${P}"-curl_tls1_2.patch
|
2021-01-21 13:32:00 +01:00
|
|
|
#epatch "${FILESDIR}"/"${P}"-cpp-true_false.patch
|
2020-04-01 21:31:05 +02:00
|
|
|
|
2018-11-20 11:16:33 +01:00
|
|
|
default
|
|
|
|
|
2023-04-20 09:04:40 +02:00
|
|
|
cmake_src_prepare
|
2018-11-20 11:16:33 +01:00
|
|
|
|
2020-04-01 21:31:05 +02:00
|
|
|
sed -e "s/ share\/doc\/vzlogger-\${VZLOGGER_MAJOR_VERSION}-\${VZLOGGER_MINOR_VERSION}$/ share\/doc\/vzlogger-${PV}/" \
|
|
|
|
-i ${S}/CMakeLists.txt \
|
|
|
|
|| die "sed failed"
|
2020-09-03 10:18:42 +02:00
|
|
|
sed -e "s:Wno-system-headers:Wno-system-headers -Wno-error -fpermissive:" \
|
2019-07-14 21:24:02 +02:00
|
|
|
-i ${S}/modules/CompilerFlags.cmake \
|
|
|
|
|| die "sed failed"
|
|
|
|
|
2021-11-30 16:14:32 +01:00
|
|
|
sed -e "s@ARCHIVE DESTINATION lib/static COMPONENT libraries@ARCHIVE DESTINATION $(get_libdir)/static COMPONENT libraries@" \
|
|
|
|
-e "s@LIBRARY DESTINATION lib COMPONENT libraries@LIBRARY DESTINATION $(get_libdir) COMPONENT libraries@" \
|
|
|
|
-i ${S}/src/CMakeLists.txt -i ${S}/src/api/CMakeLists.txt -i ${S}/src/protocols/CMakeLists.txt \
|
|
|
|
|| die "sed failed"
|
|
|
|
|
2020-04-01 21:31:05 +02:00
|
|
|
#sed -e "s@ExecStart=/usr/local/bin/vzlogger@ExecStart=/usr/bin/vzlogger@" \
|
|
|
|
# -i ${S}/etc/vzlogger.service \
|
|
|
|
#|| die "sed failed"
|
2018-11-20 11:16:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
local mycmakeargs=(
|
|
|
|
-DBUILD_TEST=off
|
|
|
|
-DENABLE_LOCAL=$(usex microhttpd)
|
2020-04-29 11:58:11 +02:00
|
|
|
-DENABLE_MQTT=$(usex mqtt)
|
2018-11-20 11:16:33 +01:00
|
|
|
-DENABLE_OCR=$(usex ocr)
|
|
|
|
-DENABLE_OCR_TESSERACT=$(usex ocr)
|
|
|
|
-DENABLE_OMS=$(usex oms)
|
|
|
|
-DENABLE_SML=$(usex sml)
|
2020-04-01 21:31:05 +02:00
|
|
|
-DJSON_HOME=/usr
|
|
|
|
-DMICROHTTPD_HOME=/usr
|
|
|
|
-DSML_HOME=/usr
|
2018-11-20 11:16:33 +01:00
|
|
|
)
|
2023-04-20 09:04:40 +02:00
|
|
|
cmake_src_configure
|
2018-11-20 11:16:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2023-04-20 09:04:40 +02:00
|
|
|
cmake_src_install
|
2018-11-20 11:16:33 +01:00
|
|
|
|
|
|
|
insinto /etc
|
|
|
|
doins ${S}/etc/vzlogger.conf
|
|
|
|
|
|
|
|
if use logrotate; then
|
|
|
|
insinto /etc/logrotate.d
|
|
|
|
newins ${FILESDIR}/vzlogger.logrotate vzlogger
|
|
|
|
fi
|
|
|
|
|
2020-04-01 21:31:05 +02:00
|
|
|
use systemd && systemd_dounit ${FILESDIR}/vzlogger.service
|
2018-11-20 11:16:33 +01:00
|
|
|
}
|