Start building sysrepo-ietf-alarms
The project also requires date library[1] but it was not running
correctly on our ARM. I had to patch the library with the workaround
from [2], hence the buildroot update.
[1] https://github.com/HowardHinnant/date
[2] https://github.com/HowardHinnant/date/issues/252
Change-Id: Ie82b8c9ea50b0198b024256ff81d67ba7344c190
diff --git a/package/sysrepo-ietf-alarms/Config.in b/package/sysrepo-ietf-alarms/Config.in
new file mode 100644
index 0000000..0d87925
--- /dev/null
+++ b/package/sysrepo-ietf-alarms/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_SYSREPO_IETF_ALARMS
+ bool "velia"
+ select BR2_PACKAGE_DOCOPT_CPP
+ select BR2_PACKAGE_SPDLOG
+ select BR2_PACKAGE_SYSREPO
+ select BR2_PACKAGE_SYSREPO_CPP
+ select BR2_PACKAGE_CZECHLIGHT_CFG_FS
+ select BR2_PACKAGE_DATE
+ help
+ Implementing the `ietf-alarms` YANG module for sysrepo.
+
+ https://gerrit.cesnet.cz/q/project:CzechLight/sysrepo-ietf-alarms
diff --git a/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.hash b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.hash
new file mode 100644
index 0000000..075e53a
--- /dev/null
+++ b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.hash
@@ -0,0 +1 @@
+none xxx
diff --git a/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.mk b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.mk
new file mode 100644
index 0000000..dab9957
--- /dev/null
+++ b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.mk
@@ -0,0 +1,17 @@
+SYSREPO_IETF_ALARMS_VERSION = master
+SYSREPO_IETF_ALARMS_SITE = https://gerrit.cesnet.cz/CzechLight/sysrepo-ietf-alarms
+SYSREPO_IETF_ALARMS_SITE_METHOD = git
+SYSREPO_IETF_ALARMS_INSTALL_STAGING = NO
+SYSREPO_IETF_ALARMS_DEPENDENCIES = docopt-cpp spdlog date sysrepo sysrepo-cpp
+SYSREPO_IETF_ALARMS_LICENSE = Apache-2.0
+SYSREPO_IETF_ALARMS_LICENSE_FILES = LICENSE.md
+
+define SYSREPO_IETF_ALARMS_INSTALL_INIT_SYSTEMD
+ mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
+ $(INSTALL) -D -m 0644 \
+ $(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.service \
+ $(TARGET_DIR)/usr/lib/systemd/system/
+ ln -sf ../sysrepo-ietf-alarms.service $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
+endef
+
+$(eval $(cmake-package))
diff --git a/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.service b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.service
new file mode 100644
index 0000000..0bb5884
--- /dev/null
+++ b/package/sysrepo-ietf-alarms/sysrepo-ietf-alarms.service
@@ -0,0 +1,25 @@
+[Unit]
+Description=IETF-alarms management via sysrepo
+After=syslog.target network.target cfg-restore-sysrepo.service czechlight-migrate.service nacm-restore.service
+Before=rauc-mark-good.service
+PartOf=netopeer2.service
+Requires=cfg-restore-sysrepo.service czechlight-migrate.service nacm-restore.service
+ConditionKernelCommandLine=czechlight
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/sysrepo-ietf-alarmsd
+Group=sysrepo
+PrivateTmp=yes
+PrivateDevices=no
+ProtectSystem=yes
+ProtectHome=yes
+Restart=always
+RestartSec=10s
+LogRateLimitIntervalSec=10
+LogRateLimitBurst=30000
+SyslogLevel=alert
+
+[Install]
+WantedBy=multi-user.target
+RequiredBy=velia-health.service