summaryrefslogtreecommitdiff
path: root/healthcheck/Makefile
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-02-16 13:00:48 +0100
committerKarel Kočí <cynerd@email.cz>2022-02-16 13:00:48 +0100
commitc39bc47a92d3392fe501b6d27c0904e5c27cdf1a (patch)
tree65f5b79ac08eb8a9bd9fb717c0e89608b8ef149f /healthcheck/Makefile
parent265d38a9ad68448f3b0ce2b69e8075187657a67c (diff)
downloadopenwrt-personal-pkgs-c39bc47a92d3392fe501b6d27c0904e5c27cdf1a.tar.gz
openwrt-personal-pkgs-c39bc47a92d3392fe501b6d27c0904e5c27cdf1a.tar.bz2
openwrt-personal-pkgs-c39bc47a92d3392fe501b6d27c0904e5c27cdf1a.zip
healthcheck: add languages
Diffstat (limited to 'healthcheck/Makefile')
-rw-r--r--healthcheck/Makefile36
1 files changed, 35 insertions, 1 deletions
diff --git a/healthcheck/Makefile b/healthcheck/Makefile
index 8faa1fb..928aad5 100644
--- a/healthcheck/Makefile
+++ b/healthcheck/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
+# Copyright (C) 2021-2022 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@@ -15,6 +15,8 @@ PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
+LOCALES:=cs nb ru sk
+
include $(INCLUDE_DIR)/autopkg-branch.mk
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
@@ -36,6 +38,17 @@ define Package/healthcheck/description
Turris router health checking tool.
endef
+define run_makefile
+ $(call Build/Compile/Default)
+endef
+Hooks/Compile/Pre += run_makefile
+
+define Py3Package/healthcheck/filespec
++|$(PYTHON3_PKG_DIR)
+-|$(PYTHON3_PKG_DIR)/healthcheck*/locale/*
+endef
+
+
define Py3Package/healthcheck/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
@@ -44,6 +57,27 @@ define Py3Package/healthcheck/install
$(INSTALL_CONF) ./files/cron $(1)/etc/cron.d/healthcheck
endef
+define TRANSLATION
+
+define Package/healthcheck-l10n-$(1)
+ TITLE:=Translation for package healthcheck: $(1)
+ DEPENDS:=+healthcheck
+endef
+
+define Package/healthcheck-l10n-$(1)/install
+ $$(foreach MOD,healthcheck healthcheck_setup healthcheck_system,
+ $$(INSTALL_DIR) $$(1)$$(PYTHON3_PKG_DIR)/$$(MOD)/locale/$(1)/LC_MESSAGES
+ $$(INSTALL_DATA) \
+ $$(PKG_INSTALL_DIR)$$(PYTHON3_PKG_DIR)/$$(MOD)/locale/$(1)/LC_MESSAGES/*.mo \
+ $$(1)$$(PYTHON3_PKG_DIR)/$$(MOD)/locale/$(1)/LC_MESSAGES/
+ )
+endef
+
+$$(eval $$(call BuildPackage,healthcheck-l10n-$(1)))
+
+endef
+
$(eval $(call Py3Package,healthcheck))
$(eval $(call BuildPackage,healthcheck))
$(eval $(call BuildPackage,healthcheck-src))
+$(foreach LANG,$(LOCALES),$(eval $(call TRANSLATION,$(LANG))))