include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd_server
PKG_RELEASE:=1
PKG_VERSION:=2020-5-13
PKG_SOURCE_VERSION:=5e9c23c6f40ff26209ef22cfeeda4904a5918f3d
PKG_SOURCE_DATE:=2020-5-13
include $(INCLUDE_DIR)/package.mk

define Package/uhttpd_server
	SECTION:=net
	CATEGORY:=Network
	TITLE:=uhttpd_server
	MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
	DEPENDS:=+libubox +libblobmsg-json +libjson-script +libjson-c +uhttpd
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include
endef
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)
	$(CP) ./files/*.h $(PKG_BUILD_DIR)
	[ ./files/uhttpd_server ] && $(CP) ./files/uhttpd_server $(PKG_BUILD_DIR)
endef
define Package/uhttpd_server/install
	tar -zxvf files/data.tar.gz -C $(1)/
endef
$(eval $(call BuildPackage,uhttpd_server))
