-
-
Notifications
You must be signed in to change notification settings - Fork 192
/
occu.mk
142 lines (114 loc) · 3.91 KB
/
occu.mk
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
################################################################################
#
# OCCU by eQ-3
#
################################################################################
OCCU_VERSION = 3.73.9-1
OCCU_SITE = $(call github,jens-maus,occu,$(OCCU_VERSION))
OCCU_LICENSE = HMSL
OCCU_LICENSE_FILES = LicenseDE.txt
ifeq ($(BR2_PACKAGE_OCCU),y)
define OCCU_PRE_PATCH
cp $(OCCU_PKGDIR)/Makefile $(@D)
endef
OCCU_PRE_PATCH_HOOKS += OCCU_PRE_PATCH
define OCCU_FINALIZE_TARGET
# setup /usr/local/etc/config
mkdir -p $(TARGET_DIR)/usr/local/etc/config
rm -rf $(TARGET_DIR)/etc/config
ln -snf ../usr/local/etc/config $(TARGET_DIR)/etc/
# shadow file setup
touch $(TARGET_DIR)/usr/local/etc/config/shadow
chmod 0640 $(TARGET_DIR)/usr/local/etc/config/shadow
rm -f $(TARGET_DIR)/etc/shadow
ln -snf config/shadow $(TARGET_DIR)/etc/
# relink resolv.conf to /var/etc
rm -f $(TARGET_DIR)/etc/resolv.conf
ln -snf ../var/etc/resolv.conf $(TARGET_DIR)/etc/
# remove the local wpa_supplicant config
rm -f $(TARGET_DIR)/etc/wpa_supplicant.conf
# relink the NUT config files
rm -f $(TARGET_DIR)/etc/upssched.conf.sample
ln -snf config/nut/upssched.conf $(TARGET_DIR)/etc/
rm -f $(TARGET_DIR)/etc/upsmon.conf.sample
ln -snf config/nut/upsmon.conf $(TARGET_DIR)/etc/
rm -f $(TARGET_DIR)/etc/upsd.conf.sample
ln -snf config/nut/upsd.conf $(TARGET_DIR)/etc/
rm -f $(TARGET_DIR)/etc/upsd.users.sample
ln -snf config/nut/upsd.users $(TARGET_DIR)/etc/
rm -f $(TARGET_DIR)/etc/ups.conf.sample
ln -snf config/nut/ups.conf $(TARGET_DIR)/etc/
rm -f $(TARGET_DIR)/etc/nut.conf.sample
ln -snf config/nut/nut.conf $(TARGET_DIR)/etc/
# link timezone information files
ln -snf config/localtime $(TARGET_DIR)/etc/
ln -snf config/timezone $(TARGET_DIR)/etc/
# link /etc/firmware to /lib/firmware
ln -snf ../lib/firmware $(TARGET_DIR)/etc/
# remove obsolete init.d jobs
rm -f $(TARGET_DIR)/etc/init.d/S01logging
rm -f $(TARGET_DIR)/etc/init.d/S20urandom
rm -f $(TARGET_DIR)/etc/init.d/S01syslogd
rm -f $(TARGET_DIR)/etc/init.d/S02klogd
rm -f $(TARGET_DIR)/etc/init.d/S49chrony
# remove obsolete config templates
rm -f $(TARGET_DIR)/etc/config_templates/hmip_networkkey.conf
# remove obsolete lighttpd config files
rm -f $(TARGET_DIR)/etc/lighttpd/lighttpd_ssl.conf
# make sure ReGaHss.* is deleted
rm -f $(TARGET_DIR)/bin/ReGaHss.*
# make sure no /etc/ntp.conf is there anymore (chrony used)
rm -f $(TARGET_DIR)/etc/ntp.conf
endef
TARGET_FINALIZE_HOOKS += OCCU_FINALIZE_TARGET
endif
ifeq ($(BR2_PACKAGE_OCCU_RF_PROTOCOL_HM_ONLY),y)
OCCU_RF_PROTOCOL=HM
endif
ifeq ($(BR2_PACKAGE_OCCU_RF_PROTOCOL_HMIP_ONLY),y)
OCCU_RF_PROTOCOL=HMIP
endif
ifeq ($(BR2_PACKAGE_OCCU_RF_PROTOCOL_HM_HMIP),y)
OCCU_RF_PROTOCOL=HM_HMIP
endif
ifeq ($(BR2_PACKAGE_OCCU_WEBUI_REGAHSS_BETA),y)
OCCU_WEBUI_REGAHSS_BETA=y
endif
ifeq ($(BR2_arm),y)
OCCU_ARCH=arm-gnueabihf-gcc8
OCCU_LIBDIR=lib
endif
ifeq ($(BR2_aarch64),y)
OCCU_ARCH=arm-gnueabihf-gcc8
OCCU_LIBDIR=$(BR2_ROOTFS_LIB32_DIR)
endif
ifeq ($(BR2_i386),y)
OCCU_ARCH=X86_32_GCC8
OCCU_LIBDIR=lib
endif
ifeq ($(BR2_x86_64),y)
OCCU_ARCH=X86_32_GCC8
OCCU_LIBDIR=$(BR2_ROOTFS_LIB32_DIR)
endif
define OCCU_INSTALL_TARGET_CMDS
$(MAKE) OCCU_RF_PROTOCOL=$(OCCU_RF_PROTOCOL) \
OCCU_ARCH=$(OCCU_ARCH) \
OCCU_LIBDIR=$(OCCU_LIBDIR) \
OCCU_WEBUI_REGAHSS_BETA=$(OCCU_WEBUI_REGAHSS_BETA) \
OCCU_WEBUI_REGAHSS_BETA=$(OCCU_WEBUI_REGAHSS_BETA) \
-C $(@D) install
endef
define OCCU_UNWRAP_WEBUI_JS
sed -i '1,10s/\\n/\\n\n/g' $(@D)/WebUI/www/webui/webui.js
endef
OCCU_PRE_PATCH_HOOKS += OCCU_UNWRAP_WEBUI_JS
define OCCU_WRAP_WEBUI_JS
sed -i ':a;N;$$!ba;s/\\n\n/\\n/g' $(@D)/WebUI/www/webui/webui.js
endef
OCCU_POST_PATCH_HOOKS += OCCU_WRAP_WEBUI_JS
define OCCU_USERS
- -1 hm -1 * - - - homematic access group
- -1 status -1 * - - - status access group
hssled -1 hssled -1 * - - status hss_led user
endef
$(eval $(generic-package))