librouteros: add package

librouteros is a library to communicate with RouterOS, the operating system of MikroTik's
RouterBoards. It uses the API port provided by those systems to connect and talk to the
devices.

API connections must be explicitly enabled. To do so, issue the following command:

> /ip service enable api

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
This commit is contained in:
Sven Roederer 2019-06-10 15:13:43 +02:00
parent a91c4aa395
commit abaca50b57
1 changed files with 54 additions and 0 deletions

54
libs/librouteros/Makefile Normal file
View File

@ -0,0 +1,54 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=librouteros
PKG_SOURCE_DATE:=2018-07-19
PKG_SOURCE_VERSION:=c485c777ffbbbd87c3d72d843af36ba016803cae
PKG_RELEASE:=1
PKG_MAINTAINER:=Sven Roederer <devel-sven@geroedel.de>
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/octo/librouteros/tar.gz/$(PKG_SOURCE_VERSION)?
PKG_HASH:=427e071fe270ff6c08e32a10e5beff2add4205e6c864b142f950efdb8d2245a4
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/librouteros
TITLE:=A library that talks to MikroTik devices.
URL:=https://octo.github.io/librouteros/
SECTION:=libs
CATEGORY:=Libraries
endef
define Package/librouteros/description
librouteros is a library to communicate with RouterOS, the operating system of MikroTik's RouterBoards.
It uses the API port provided by those systems to connect and talk to the devices. librouteros is a
low-level library in that it abstracts the network protocol used but has next to no knowledge about the
commands and responses available
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/routeros_*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/librouteros.{a,la,so*} $(1)/usr/lib/
endef
define Package/librouteros/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/librouteros.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,librouteros))