blob: 4af400b0aa3b45a38ea0f97ccf71a248f9d96d6b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libhttp-parser
11PKG_VERSION:=2.9.4
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=https://codeload.github.com/nodejs/http-parser/tar.gz/v$(PKG_VERSION)?
16PKG_HASH:=467b9e30fd0979ee301065e70f637d525c28193449e1b13fbcb1b1fab3ad224f
17PKG_BUILD_DIR:=$(BUILD_DIR)/http-parser-$(PKG_VERSION)
18
19PKG_MAINTAINER:=Ramanathan Sivagurunathan <ramzthecoder@gmail.com>, Hirokazu MORIKAWA <morikw2@gmail.com>
20PKG_LICENSE:=MIT
21PKG_LICENSE_FILES:=LICENSE-MIT
22
23PKG_BUILD_PARALLEL:=1
24PKG_INSTALL:=1
25
26include $(INCLUDE_DIR)/package.mk
27
28define Package/libhttp-parser
29 SECTION:=libs
30 CATEGORY:=Libraries
31 TITLE:=A library to parse http request and response
32 URL:=https://github.com/nodejs/http-parser
33endef
34
35define Package/libhttp-parser/description
36 A parser for HTTP messages written in C. It parses both requests and responses.
37 The parser is designed to be used in performance HTTP applications.
38 It does not make any syscalls nor allocations, it does not buffer data,
39 it can be interrupted at anytime. Depending on your architecture,
40 it only requires about 40 bytes of data per message stream
41 (in a web server that is per connection).
42endef
43
44MAKE_FLAGS+=library \
45 PREFIX=/usr
46
47define Build/InstallDev
48 $(INSTALL_DIR) $(1)/usr/include
49 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/http_parser.h $(1)/usr/include/
50 $(INSTALL_DIR) $(1)/usr/lib
51 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttp_parser.so* $(1)/usr/lib/
52endef
53
54define Package/libhttp-parser/install
55 $(INSTALL_DIR) $(1)/usr/lib
56 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttp_parser.so* $(1)/usr/lib/
57endef
58
59$(eval $(call BuildPackage,libhttp-parser))