From c91a6069657a92e8dbe50be173f0102e32f4f7d5fc4b1d7a185848a6ab588d7f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 8 Aug 2015 14:58:04 +0000 Subject: [PATCH] Accepting request 321427 from home:posophe:build-tools OBS-URL: https://build.opensuse.org/request/show/321427 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/http-parser?expand=0&rev=1 --- .gitattributes | 23 +++++++ .gitignore | 1 + http-parser-gyp-sharedlib.patch | 56 ++++++++++++++++ http-parser.changes | 4 ++ http-parser.spec | 115 ++++++++++++++++++++++++++++++++ v2.5.0.tar.gz | 3 + 6 files changed, 202 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 http-parser-gyp-sharedlib.patch create mode 100644 http-parser.changes create mode 100644 http-parser.spec create mode 100644 v2.5.0.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/http-parser-gyp-sharedlib.patch b/http-parser-gyp-sharedlib.patch new file mode 100644 index 0000000..22cb387 --- /dev/null +++ b/http-parser-gyp-sharedlib.patch @@ -0,0 +1,56 @@ +build: build http-parser as a shared library + +Since the pristine package only ever builds as static library, it is +to be assumed that the project does not track and enumerate ABI +changes. Building it as shared nevertheless is therefore a distro +extension - hence the "suse" suffix. Enumeration is therefore +also distro-specific. + +Remove -O flags so %optflags take over. +TODO: do this nicely upstream +--- + http_parser.gyp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +Index: http-parser-2.5.0/http_parser.gyp +=================================================================== +--- http-parser-2.5.0.orig/http_parser.gyp ++++ http-parser-2.5.0/http_parser.gyp +@@ -12,7 +12,7 @@ + # RuntimeLibrary MUST MATCH across the entire project + 'Debug': { + 'defines': [ 'DEBUG', '_DEBUG' ], +- 'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ], ++ 'cflags': [ '-Wall', '-Wextra', '-g', '-ftrapv' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 1, # static debug +@@ -21,7 +21,7 @@ + }, + 'Release': { + 'defines': [ 'NDEBUG' ], +- 'cflags': [ '-Wall', '-Wextra', '-O3' ], ++ 'cflags': [ '-Wall', '-Wextra' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 0, # static release +@@ -50,7 +50,8 @@ + 'targets': [ + { + 'target_name': 'http_parser', +- 'type': 'static_library', ++ 'type': 'shared_library', ++ 'product_extension': 'so.suse0', + 'include_dirs': [ '.' ], + 'direct_dependent_settings': { + 'defines': [ 'HTTP_PARSER_STRICT=0' ], +@@ -73,7 +74,8 @@ + + { + 'target_name': 'http_parser_strict', +- 'type': 'static_library', ++ 'type': 'shared_library', ++ 'product_extension': 'so.suse0', + 'include_dirs': [ '.' ], + 'direct_dependent_settings': { + 'defines': [ 'HTTP_PARSER_STRICT=1' ], diff --git a/http-parser.changes b/http-parser.changes new file mode 100644 index 0000000..08c03e5 --- /dev/null +++ b/http-parser.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Sat Aug 8 13:15:53 UTC 2015 - p.drouand@gmail.com + +- Initial package (version 2.5.0) for build.opensuse.org diff --git a/http-parser.spec b/http-parser.spec new file mode 100644 index 0000000..1707b50 --- /dev/null +++ b/http-parser.spec @@ -0,0 +1,115 @@ +# +# spec file for package http-parser +# +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: http-parser +%define somajor suse0 +%define libname libhttp-parser-%somajor +Version: 2.5.0 +Release: 0 +Summary: HTTP request/response parser for C +License: MIT +Group: Development/Libraries/C and C++ +Url: http://github.com/joyent/http-parser +Source0: https://github.com/joyent/http-parser/archive/v%{version}.tar.gz +Patch1: http-parser-gyp-sharedlib.patch +BuildRequires: gcc-c++ +BuildRequires: gyp + +%description +This is a parser for HTTP messages written in C. It parses both +requests and responses. The parser is designed to be used in +performance HTTP applications. It does not make any syscalls nor +allocations, it does not buffer data, it can be interrupted at +anytime. Depending on your architecture, it only requires about 40 +bytes of data per message stream (in a web server that is per +connection). + +%package -n %{libname} +Summary: HTTP request/response parser for C +Group: System/Libraries + +%description -n %{libname} +This is a parser for HTTP messages written in C. It parses both +requests and responses. The parser is designed to be used in +performance HTTP applications. It does not make any syscalls nor +allocations, it does not buffer data, it can be interrupted at +anytime. Depending on your architecture, it only requires about 40 +bytes of data per message stream (in a web server that is per +connection). + +%package devel +Summary: Development headers and libraries for http-parser +Group: Development/Libraries/C and C++ +Requires: %{libname} = %{version} + +%description devel +This is a parser for HTTP messages written in C. It parses both +requests and responses. The parser is designed to be used in +performance HTTP applications. It does not make any syscalls nor +allocations, it does not buffer data, it can be interrupted at +anytime. Depending on your architecture, it only requires about 40 +bytes of data per message stream (in a web server that is per +connection). + +Development headers and libraries for http-parser. + +%prep +%setup -q +%patch1 -p1 + +%build +# TODO: fix -fPIC upstream +export CFLAGS='%{optflags} -fPIC' +gyp -f make --depth=`pwd` http_parser.gyp +make %{?_smp_mflags} BUILDTYPE=Release + +%install +install -d %{buildroot}%{_includedir} +install -d %{buildroot}%{_libdir} +install -pm644 http_parser.h %{buildroot}%{_includedir} + +#install regular variant +install "out/Release/lib.target/libhttp_parser.so.%somajor" "%buildroot/%_libdir/" +ln -sf "libhttp_parser.so.%somajor" "%buildroot/%_libdir/libhttp_parser.so" + +#install strict variant +install "out/Release/lib.target/libhttp_parser_strict.so.%somajor" "%buildroot/%_libdir/" +ln -sf "libhttp_parser_strict.so.%somajor" "%buildroot/%_libdir/libhttp_parser_strict.so" + +%check +export LD_LIBRARY_PATH='./out/Release/lib.target' +./out/Release/test-nonstrict +./out/Release/test-strict + +%post -n %{libname} -p /sbin/ldconfig + +%postun -n %{libname} -p /sbin/ldconfig + +%files -n %{libname} +%defattr(-,root,root) +%doc AUTHORS LICENSE-MIT README.md +%{_libdir}/libhttp_parser.so.* +%{_libdir}/libhttp_parser_strict.so.* + +%files devel +%defattr(-,root,root) +%{_includedir}/* +%{_libdir}/libhttp_parser.so +%{_libdir}/libhttp_parser_strict.so + +%changelog diff --git a/v2.5.0.tar.gz b/v2.5.0.tar.gz new file mode 100644 index 0000000..565f2ab --- /dev/null +++ b/v2.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3b4ba58f4e6ee5fbec781df020e5cb74c3a799a07f059e1e125127a0b801481 +size 46070