Browse Source

Merge pull request #570 from ageekymonk/libhttp-parser

Adding support for libhttp-parser
Nikos Mavrogiannopoulos 10 years ago
parent
commit
87d4a0a222
1 changed files with 60 additions and 0 deletions
  1. 60
    0
      libs/libhttp-parser/Makefile

+ 60
- 0
libs/libhttp-parser/Makefile View File

@@ -0,0 +1,60 @@
1
+#
2
+# Copyright (C) 2013 OpenWrt.org
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:=libhttp-parser
11
+PKG_VERSION:=2.3.0
12
+PKG_RELEASE=1
13
+PKG_MAINTAINER:=Ramanathan Sivagurunathan <ramzthecoder@gmail.com>
14
+PKG_LICENSE:=MIT
15
+PKG_LICENSE_FILE:=LICENSE-MIT
16
+
17
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19
+PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
20
+PKG_SOURCE_PROTO:=git
21
+PKG_SOURCE_VERSION:=56f7ad0e2e5a80f79d214015c91e1f17d11d109f
22
+
23
+
24
+include $(INCLUDE_DIR)/package.mk
25
+
26
+define Package/libhttp-parser
27
+  SECTION:=libs
28
+  CATEGORY:=Libraries
29
+  TITLE:=A library to parse http request and response
30
+  URL:=https://github.com/joyent/http-parser
31
+endef
32
+
33
+define Package/libhttp-parser/description
34
+  A parser for HTTP messages written in C. It parses both requests and responses. 
35
+  The parser is designed to be used in performance HTTP applications. 
36
+  It does not make any syscalls nor allocations, it does not buffer data, 
37
+  it can be interrupted at anytime. Depending on your architecture, 
38
+  it only requires about 40 bytes of data per message stream 
39
+  (in a web server that is per connection).
40
+endef
41
+
42
+define Build/Compile
43
+	$(call Build/Compile/Default, library) 
44
+endef
45
+
46
+define Build/InstallDev
47
+	$(INSTALL_DIR) $(1)/usr/include
48
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/http_parser.h $(1)/usr/include/
49
+	$(INSTALL_DIR) $(1)/usr/lib
50
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
51
+	( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
52
+endef
53
+
54
+define Package/libhttp-parser/install
55
+	$(INSTALL_DIR) $(1)/usr/lib
56
+	$(CP) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
57
+	( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
58
+endef
59
+
60
+$(eval $(call BuildPackage,libhttp-parser))