libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutils
[project/luci.git] / contrib / package / lucihttp / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=lucihttp
4 PKG_RELEASE:=1
5
6 PKG_SOURCE_PROTO:=git
7 PKG_SOURCE_URL=https://github.com/jow-/lucihttp.git
8 PKG_SOURCE_DATE:=2018-04-17
9 PKG_SOURCE_VERSION:=b46a6ca5faf3d7c65447fdc5e65ae8eca7bda88d
10 PKG_MIRROR_HASH:=2ce8032254e94b45d7007e4849f18aff035f8da8c491679737fdd81a02b9fc4d
11 CMAKE_INSTALL:=1
12
13 PKG_LICENSE:=ISC
14 PKG_LICENSE_FILES:=LICENSE
15
16 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
17 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_liblucihttp-lua
18
19 include $(INCLUDE_DIR)/package.mk
20 include $(INCLUDE_DIR)/cmake.mk
21
22 define Package/liblucihttp
23   SECTION:=libs
24   CATEGORY:=Libraries
25   ABI_VERSION:=$(PKG_VERSION)
26   TITLE:=LuCI HTTP utility library
27 endef
28
29 define Package/liblucihttp-lua
30   SECTION:=libs
31   CATEGORY:=Libraries
32   DEPENDS:=+liblucihttp +liblua
33   TITLE:=Lua binding for the LuCI HTTP utility library
34 endef
35
36 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
37
38 CMAKE_OPTIONS = \
39         -DLUAPATH=/usr/lib/lua \
40         -DBUILD_LUA=$(if $(CONFIG_PACKAGE_liblucihttp-lua),ON,OFF) \
41         -DBUILD_TESTS=OFF
42
43 define Package/liblucihttp/install
44         $(INSTALL_DIR) $(1)/usr/lib
45         $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblucihttp.so $(1)/usr/lib/
46 endef
47
48 define Package/liblucihttp-lua/install
49         $(INSTALL_DIR) $(1)/usr/lib/lua
50         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/lucihttp.so $(1)/usr/lib/lua/
51 endef
52
53 $(eval $(call BuildPackage,liblucihttp))
54 $(eval $(call BuildPackage,liblucihttp-lua))