libuhttpd: Update to 3.12.0
[feed/packages.git] / libs / libuhttpd / Makefile
1 #
2 # Copyright (C) 2018 Jianhui Zhao
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libuhttpd
11 PKG_VERSION:=3.12.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL=https://github.com/zhaojh329/libuhttpd/releases/download/v$(PKG_VERSION)
16 PKG_HASH:=0639ce20f81d4826e96c3abf7d287f15220e53912ba9d56e228e2409252985e1
17
18 PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
19 PKG_LICENSE:=MIT
20 PKG_LICENSE_FILES:=LICENSE
21
22 CMAKE_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25 include ../../devel/ninja/ninja-cmake.mk
26
27 define Package/libuhttpd/Default
28 SECTION:=libs
29 CATEGORY:=Libraries
30 SUBMENU:=Networking
31 TITLE:=A lightweight HTTP server library based on libev
32 URL:=https://github.com/zhaojh329/libuhttpd
33 DEPENDS:=+libev $(2)
34 VARIANT:=$(1)
35 PROVIDES:=libuhttpd
36 endef
37
38 Package/libuhttpd-openssl=$(call Package/libuhttpd/Default,openssl,+PACKAGE_libuhttpd-openssl:libopenssl)
39 Package/libuhttpd-wolfssl=$(call Package/libuhttpd/Default,wolfssl,+PACKAGE_libuhttpd-wolfssl:libwolfssl)
40 Package/libuhttpd-mbedtls=$(call Package/libuhttpd/Default,mbedtls,+PACKAGE_libuhttpd-mbedtls:libmbedtls +PACKAGE_libuhttpd-mbedtls:zlib)
41 Package/libuhttpd-nossl=$(call Package/libuhttpd/Default,nossl)
42
43 ifeq ($(BUILD_VARIANT),openssl)
44 CMAKE_OPTIONS += -DUSE_OPENSSL=ON
45 else ifeq ($(BUILD_VARIANT),wolfssl)
46 CMAKE_OPTIONS += -DUSE_WOLFSSL=ON
47 else ifeq ($(BUILD_VARIANT),mbedtls)
48 CMAKE_OPTIONS += -DUSE_MBEDTLS=ON
49 else
50 CMAKE_OPTIONS += -DSSL_SUPPORT=OFF
51 endif
52
53 define Package/libuhttpd-$(BUILD_VARIANT)/install
54 $(INSTALL_DIR) $(1)/usr/lib
55 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuhttpd.so* $(1)/usr/lib/
56 endef
57
58 $(eval $(call BuildPackage,libuhttpd-openssl))
59 $(eval $(call BuildPackage,libuhttpd-mbedtls))
60 $(eval $(call BuildPackage,libuhttpd-wolfssl))
61 $(eval $(call BuildPackage,libuhttpd-nossl))