blob: 0a6243b43cd204e6b1722d7b250d1b079ceaf128 [file] [log] [blame]
Jan Kundráta67deea2017-03-21 20:21:07 +01001CLA_SYSREPO_VERSION = master
2CLA_SYSREPO_SITE = ssh://kundrat@cesnet.cz@gerrit.cesnet.cz:29418/CzechLight/cla-sysrepo
3CLA_SYSREPO_SITE_METHOD = git
4CLA_SYSREPO_INSTALL_STAGING = NO
Jan Kundrátc901db02019-10-30 15:01:23 +01005CLA_SYSREPO_DEPENDENCIES = sysrepo docopt-cpp spdlog systemd libgpiod boost cppcodec
Jan Kundráta67deea2017-03-21 20:21:07 +01006CLA_SYSREPO_CONF_OPTS = -DTHREADS_PTHREAD_ARG:STRING=-pthread
7CLA_SYSREPO_LICENSE_FILES = LICENSE.md
8
Jan Kundrát61670db2019-04-05 22:11:24 +02009define CLA_SYSREPO_ONE_MODEL_INSTALL_1
Jan Kundrát2ccae182018-09-13 21:24:38 +020010 sed \
11 -e "s/__MODEL__/$1/g" \
12 -e "s/__YANG__/$2/g" \
13 $(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/cla-sysrepo/cla-install-yang.service.in \
14 > $(TARGET_DIR)/usr/lib/systemd/system/cla-install-yang-$1.service
Jan Kundrát61670db2019-04-05 22:11:24 +020015endef
16
17define CLA_SYSREPO_ONE_MODEL_INSTALL_2
Jan Kundrát2ccae182018-09-13 21:24:38 +020018 sed -i '/__FEATURE__/d' $(TARGET_DIR)/usr/lib/systemd/system/cla-install-yang-$1.service
19 sed \
20 -e "s/__MODEL__/$1/g" \
21 -e "s/__YANG__/$2/g" \
22 $(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/cla-sysrepo/cla-appliance.service.in \
23 > $(TARGET_DIR)/usr/lib/systemd/system/cla-$1.service
24 mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants
25 ln -sf ../cla-install-yang-$1.service \
26 $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
27 ln -sf ../cla-$1.service \
28 $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
29endef
30
Jan Kundrát61670db2019-04-05 22:11:24 +020031define CLA_SYSREPO_ONE_MODEL_W_FEATURE
32 $(call CLA_SYSREPO_ONE_MODEL_INSTALL_1,$1,$2)
33 # FIXME: multiple features...
34 sed -i 's|__FEATURE__|ExecStart=/usr/bin/sysrepoctl --module $2 --feature-enable $3\n__FEATURE__|' \
35 $(TARGET_DIR)/usr/lib/systemd/system/cla-install-yang-$1.service
36 $(call CLA_SYSREPO_ONE_MODEL_INSTALL_2,$1,$2)
37endef
38
39define CLA_SYSREPO_ONE_MODEL
40 $(call CLA_SYSREPO_ONE_MODEL_INSTALL_1,$1,$2)
41 $(call CLA_SYSREPO_ONE_MODEL_INSTALL_2,$1,$2)
42endef
43
Jan Kundrát2ccae182018-09-13 21:24:38 +020044define CLA_SYSREPO_INSTALL_INIT_SYSTEMD
Jan Kundrát61670db2019-04-05 22:11:24 +020045 $(call CLA_SYSREPO_ONE_MODEL_W_FEATURE,sdn-roadm-add-drop,czechlight-roadm-device,hw-add-drop-20)
46 $(call CLA_SYSREPO_ONE_MODEL_W_FEATURE,sdn-roadm-line,czechlight-roadm-device,hw-line-9)
47 $(call CLA_SYSREPO_ONE_MODEL,sdn-roadm-coherent-a-d,czechlight-coherent-add-drop)
Jan Kundrát8677df62019-08-29 02:11:33 +020048 $(call CLA_SYSREPO_ONE_MODEL,sdn-inline,czechlight-inline-amp)
Jan Kundrát2ccae182018-09-13 21:24:38 +020049endef
50
Jan Kundráta67deea2017-03-21 20:21:07 +010051$(eval $(cmake-package))