mwarning/openwrt-examples

opkg package from shell script

marius-benthin opened this issue · 1 comments

Hi mwarning,

thanks for providing examples on how to create ipk packages for OpenWRT.
Is it also possible to create such package for an installer.sh ?
I would like to run my install.sh from an opkg package and therefore I need to create a Makefile, right?

Here are my first lines of the Makefile:

include $(TOPDIR)/rules.mk

PKG_NAME:=example
PKG_VERSION:=1.0.0

include $(INCLUDE_DIR)/package.mk

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=installer.sh
PKG_SOURCE_URL:=http://someurl.com/
PKG_HASH:=e2166050d404cffd26769b5c5e33e72173a34914c2eabad6b235039025c0ac1c

define Package/example
  SECTION:=base
  CATEGORY:=Network
  TITLE:=My Installer
  MENU:=1
endef

define Package/example/description
 My description ...
endef

define Package/example/install
	sh installer.sh
endef

$(eval $(call BuildPackage,example)) 

I would be very grateful if you could give me a hint to solve my issue :)

Yes, that is possible. But the installer.sh would need to know the source and target path. $(INSTALL_DIR) and $(1).