John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 1 | # |
| 2 | # libwebsockets makefile for openwrt |
| 3 | # |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 4 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 5 | include $(TOPDIR)/rules.mk |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 6 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 7 | PKG_NAME:=libwebsockets |
| 8 | PKG_VERSION:=2014-03-01 |
| 9 | PKG_RELEASE=$(PKG_SOURCE_VERSION) |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 10 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 11 | PKG_SOURCE_PROTO:=git |
| 12 | PKG_SOURCE_URL:=https://github.com/warmcat/libwebsockets.git |
| 13 | PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) |
| 14 | PKG_SOURCE_VERSION:=388dc7d201d8d123841869fb49ec4d94d6dd7f54 |
| 15 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz |
| 16 | CMAKE_INSTALL:=1 |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 17 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 18 | include $(INCLUDE_DIR)/package.mk |
| 19 | include $(INCLUDE_DIR)/cmake.mk |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 20 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 21 | CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs |
| 22 | CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON |
| 23 | CMAKE_OPTIONS += -DLWS_WITH_SSL=ON |
| 24 | CMAKE_OPTIONS += -DLWS_WITHOUT_TESTAPPS=$(if $(CONFIG_PACKAGE_libwebsockets-examples),"OFF","ON") |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 25 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 26 | # for cyassl, define these in addition to LWS_OPENSSL_SUPPORT and |
| 27 | # edit package/libs/cyassl/Makefile to include --enable-opensslextra |
| 28 | # CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON |
| 29 | # CMAKE_OPTIONS += -DLWS_CYASSL_LIB=$(STAGING_DIR)/usr/lib/libcyassl.so |
| 30 | # CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include |
| 31 | |
| 32 | # other options worth noting |
| 33 | # CMAKE_OPTIONS += -DLWS_WITHOUT_EXTENSIONS=ON |
| 34 | # CMAKE_OPTIONS += -DLWS_WITHOUT_DAEMONIZE=ON |
| 35 | # CMAKE_OPTIONS += -DLWS_WITHOUT_SERVER=ON |
| 36 | # CMAKE_OPTIONS += -DLWS_WITHOUT_DEBUG=ON |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 37 | |
| 38 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 39 | define Package/libwebsockets/Default |
| 40 | SECTION:=libs |
| 41 | CATEGORY:=Libraries |
| 42 | TITLE:=libwebsockets |
| 43 | DEPENDS:=+zlib +libopenssl |
| 44 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 45 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 46 | define Package/libwebsockets |
| 47 | $(call Package/libwebsockets/Default) |
| 48 | TITLE+= (libraries) |
| 49 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 50 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 51 | define Package/libwebsockets/description |
| 52 | libwebsockets |
| 53 | This package contains libwebsocket libraries |
| 54 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 55 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 56 | define Package/libwebsockets-examples |
| 57 | $(call Package/libwebsockets/Default) |
| 58 | DEPENDS:=libwebsockets |
| 59 | TITLE+= (examples) |
| 60 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 61 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 62 | define Package/libwebsockets-examples/description |
| 63 | libwebsockets examples |
| 64 | This package contains libwebsockets examples |
| 65 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 66 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 67 | define Package/libwebsockets/install |
| 68 | $(INSTALL_DIR) $(1)/usr/lib |
John Clark | 25f8b9e | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 69 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/ |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 70 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 71 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 72 | define Package/libwebsockets-examples/install |
| 73 | $(INSTALL_DIR) $(1)/usr/bin |
| 74 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-client $(1)/usr/bin/ |
| 75 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-echo $(1)/usr/bin/ |
| 76 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-fraggle $(1)/usr/bin/ |
| 77 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-ping $(1)/usr/bin/ |
| 78 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-server $(1)/usr/bin/ |
| 79 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libwebsockets-test-server-extpoll $(1)/usr/bin/ |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 80 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 81 | $(INSTALL_DIR) $(1)/usr/share/libwebsockets-test-server |
| 82 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/favicon.ico $(1)/usr/share/libwebsockets-test-server/ |
| 83 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/leaf.jpg $(1)/usr/share/libwebsockets-test-server/ |
| 84 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets.org-logo.png $(1)/usr/share/libwebsockets-test-server/ |
| 85 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets-test-server.key.pem $(1)/usr/share/libwebsockets-test-server/ |
| 86 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/libwebsockets-test-server.pem $(1)/usr/share/libwebsockets-test-server/ |
| 87 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/libwebsockets-test-server/test.html $(1)/usr/share/libwebsockets-test-server/ |
| 88 | endef |
tmu | 3c7fe49 | 2013-12-21 10:33:33 +0800 | [diff] [blame] | 89 | |
John Clark | 71a8870 | 2014-03-02 16:27:10 -0500 | [diff] [blame] | 90 | $(eval $(call BuildPackage,libwebsockets)) |
| 91 | $(eval $(call BuildPackage,libwebsockets-examples)) |