opkgd: add new package

This commit is contained in:
Amin Ben Ramdhane 2019-12-09 11:43:52 +01:00 committed by Sukru Senli
parent 5ca4ee678b
commit 4f5c7623d2
3 changed files with 68 additions and 0 deletions

48
opkgd/Makefile Executable file
View file

@ -0,0 +1,48 @@
#
# Copyright (C) 2019 IOPSYS
#
#
include $(TOPDIR)/rules.mk
PKG_NAME:=opkgd
PKG_VERSION:=1.0.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=d3da32eca6e50b6be6e846a7f82c8e93c74c45a4
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/opkgd.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/opkgd
SECTION:=utils
CATEGORY:=Utilities
TITLE:=OPKG ubus backend
DEPENDS:=+libuci +libubox +ubus +libuuid
endef
define Package/opkgd/description
Ubus based backend for OPKG which can be used by other applications running on top of it.
endef
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-D_GNU_SOURCE
define Package/opkgd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/opkgd.init $(1)/etc/init.d/opkgd
$(INSTALL_DIR) $(1)/etc/opkg
$(INSTALL_CONF) ./files/map_du $(1)/etc/opkg/map_du
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/opkgd $(1)/usr/sbin/opkgd
endef
$(eval $(call BuildPackage,opkgd))

0
opkgd/files/map_du Normal file
View file

20
opkgd/files/opkgd.init Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh /etc/rc.common
START=94
STOP=10
USE_PROCD=1
PROG=/usr/sbin/opkgd
start_service() {
procd_open_instance
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}