summaryrefslogtreecommitdiff
path: root/healthcheck/Makefile
blob: abb055b6a9275e86879c5484253d5e9cfdc3679b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# 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.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=healthcheck
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/healthcheck.git
PKG_SOURCE_BRANCH:=dev

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

define Package/healthcheck
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Healthcheck
  URL:=https://gitlab.nic.cz/turris/healthcheck
  DEPENDS:=\
    +python3-humanize \
    +python3-rich \
    +python3-crontab \
    +python3-uci
  VARIANT:=python3
endef

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/

	$(INSTALL_DIR) $(1)/etc/cron.d
	$(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/$$(MOD).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))))