2015-08-08 16:58:04 +02:00
|
|
|
#
|
|
|
|
# spec file for package http-parser
|
|
|
|
#
|
2016-03-27 17:05:18 +02:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2015-08-08 16:58:04 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define somajor suse0
|
2016-03-27 17:05:18 +02:00
|
|
|
%define libname libhttp-parser-%{somajor}
|
|
|
|
Name: http-parser
|
2016-10-21 21:23:55 +02:00
|
|
|
Version: 2.7.1
|
2015-08-08 16:58:04 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: HTTP request/response parser for C
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Libraries/C and C++
|
2016-03-27 17:05:18 +02:00
|
|
|
Url: https://github.com/joyent/http-parser
|
2016-10-21 21:23:55 +02:00
|
|
|
Source0: https://github.com/joyent/http-parser/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2016-01-28 15:16:19 +01:00
|
|
|
Source1: baselibs.conf
|
2015-08-08 16:58:04 +02:00
|
|
|
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
|
2016-03-27 17:05:18 +02:00
|
|
|
install "out/Release/lib.target/libhttp_parser.so.%{somajor}" "%{buildroot}/%{_libdir}/"
|
|
|
|
ln -sf "libhttp_parser.so.%{somajor}" "%{buildroot}/%{_libdir}/libhttp_parser.so"
|
2015-08-08 16:58:04 +02:00
|
|
|
|
|
|
|
#install strict variant
|
2016-03-27 17:05:18 +02:00
|
|
|
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"
|
2015-08-08 16:58:04 +02:00
|
|
|
|
|
|
|
%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
|