aboutsummaryrefslogtreecommitdiff
path: root/utils/clixon/Makefile
blob: 4ed8e99a8ac6dfd4c04f73ef304c1f64095d340d (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
84
85
86
87
88
89
90
91
92
93
#
# Copyright (C) 2020-2023 Olof Hagsand and Rubicon Communications, LLC(Netgate)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=clixon
PKG_VERSION:=7.0.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/clicon/$(PKG_NAME)/tar.gz/$(PKG_VERSION)?
PKG_HASH:=524bdf9447b0af9a63d5510ddc87fc843c206732619c64141f9f2b4e4cc014d1
PKG_MAINTAINER:=Olof Hagsand <olof@hagsand.se>, Philip Prindeville <philipp@redfish-solutions.com>

PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILE:=LICENSE.md

PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/clixon
  SECTION:=utils
  CATEGORY:=Utilities
  URL:=https://www.clicon.org
  TITLE:=YANG-based toolchain
  DEPENDS:=+cligen +libopenssl +libnghttp2 +libcurl \
	 @(PACKAGE_openssh-server||PACKAGE_openssh-server-pam)
  USERID:=clicon=61:clicon=61
endef

define Package/clixon/description
  YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI.
endef

define Package/clixon/conffiles
/etc/clixon/restconf.xml
/etc/ssh/sshd_config.d/90-netconf-subsystem.conf
endef

CONFIGURE_ARGS += \
	--exec-prefix=/usr \
	--with-restconf=native \
	--with-configfile=/etc/clixon/clixon.xml \
	--with-cligen=$(STAGING_DIR)/usr

CONFIGURE_ARGS:=$(filter-out --disable-dependency-tracking,$(CONFIGURE_ARGS))

INSTALLFLAGS:=-s --strip-program=$(TARGET_CROSS)strip

CONFIGURE_VARS+= \
	INSTALLFLAGS="$(INSTALLFLAGS)" \
	SSH_BIN=/usr/bin/ssh

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(CP) $(PKG_INSTALL_DIR)/usr/include/clixon $(1)/usr/include/
	$(INSTALL_DIR) $(1)/usr/lib/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libclixon.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_backend.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_restconf.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_cli.so* \
	      $(1)/usr/lib/
endef

define Package/clixon/install
	$(INSTALL_DIR) $(1)/etc/clixon
	$(INSTALL_DATA) ./files/restconf.xml $(1)/etc/clixon/
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clixon_* $(1)/usr/sbin/
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clixon_* $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/usr/share/clixon
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/clixon/*.yang $(1)/usr/share/clixon/
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libclixon.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_backend.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_restconf.so* \
	      $(PKG_INSTALL_DIR)/usr/lib/libclixon_cli.so* \
	      $(1)/usr/lib/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/clixon.init $(1)/etc/init.d/clixon
	$(INSTALL_DIR) $(1)/etc/ssh/sshd_config.d
	$(INSTALL_CONF) ./files/netconf-subsystem.conf $(1)/etc/ssh/sshd_config.d/90-netconf-subsystem.conf
endef

$(eval $(call BuildPackage,clixon))