commit 5591e7dbbe113904adfcb255059e1c2d711c03d0 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:52:49 2019 -0400 Package init diff --git a/http-parser-2.9.2.tar.gz b/http-parser-2.9.2.tar.gz new file mode 100644 index 0000000..faea26a Binary files /dev/null and b/http-parser-2.9.2.tar.gz differ diff --git a/http-parser.spec b/http-parser.spec new file mode 100644 index 0000000..3f961fb --- /dev/null +++ b/http-parser.spec @@ -0,0 +1,85 @@ +Name: http-parser +Version: 2.9.2 +Release: 1 +Summary: HTTP request/response parser for C + +License: MIT +URL: https://github.com/nodejs/%{name} +Source0: https://github.com/nodejs/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc meson + +%description +http-parser parses the HTTP request headers and body. As such, it acts as +a barrier in the policy to guarantee that the entire content has been received +before any other filters are invoked.The parser filter forces the server +to do "store-and-forward" routing instead of the default "cut-through" routing, +where the request is only parsed on-demand. This filter can be used as a simple test +to ensure that the message is XML, for example. + +Features: + + * No dependencies + * Handles persistent streams (keep-alive) + * Decodes chunked encoding + * Upgrade support + * Defends against buffer overflow attacks + +%package devel +Summary: Development headers and static libraries + +%description devel +Development headers and static libraries for http-parser. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +cat > meson.build << EOF +project('%{name}', 'c', + version : '%{version}', + license: 'MIT') + +install_headers('http_parser.h') +foreach x : [['http_parser', ['-DHTTP_PARSER_STRICT=0']], + ['http_parser_strict', ['-DHTTP_PARSER_STRICT=1']]] + + lib = library(x.get(0), 'http_parser.c', c_args : x.get(1), + version : '%{version}', install : true) + + test('test-@0@'.format(x.get(0)), + executable('test-@0@'.format(x.get(0)), 'test.c', + c_args : x.get(1), link_with : lib), + timeout : 60) +endforeach +EOF + +%build +%meson +%meson_build + +%install +%meson_install + +%check +%meson_test +%ldconfig_scriptlets + +%files +%defattr(-,root,root) +%license LICENSE* +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root) +%{_includedir}/*.h +%{_libdir}/*.so + +%files help +%defattr(-,root,root) +%doc AUTHORS README.md + +%changelog +* Sat Aug 31 2019 openEuler Buildteam - 2.9.2-1 +- Package init