File http-parser.spec of Package http-parser

#
# spec file for package http-parser
#
# Copyright (c) 2016 SUSE LINUX Products 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/
#

%define pkgsoname 2
Name:           http-parser
Version:        2.7.1
Release:        0
License:        MIT
Summary:	Parser for HTTP messages
Url:            https://github.com/nodejs/http-parser
Group:          Development/Libraries/C and C++
Source:         https://github.com/nodejs/http-parser/archive/v%{version}.tar.gz
Patch:          fix-makefile.patch
BuildRequires:  gcc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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 libhttp_parser%{pkgsoname}
Summary: HTTP Parser runtime library

%description -n libhttp_parser%{pkgsoname}
This package contains the runtime for http-parser library.

%package -n libhttp_parser-devel
Requires:       libhttp_parser%{pkgsoname} = %{version}
Summary: Development files for HTTP Parser library

%description -n libhttp_parser-devel
This package contains development headers for HTTP Parser
library.

%prep
%setup -q
%patch -p1

%build
export CFLAGS=$RPM_OPT_FLAGS
make %{?_smp_mflags} library test_fast
./test_fast

%install
export PREFIX=%{buildroot}/%{_prefix}
export LIBDIR=%{buildroot}/%{_libdir}
make install DESTDIR=%{buildroot} %{?_smp_mflags}

%post -n libhttp_parser%{pkgsoname} -p /sbin/ldconfig

%postun -n libhttp_parser%{pkgsoname} -p /sbin/ldconfig

%files -n libhttp_parser%{pkgsoname}
%defattr(-,root,root)
%attr(755,root,root) %{_libdir}/libhttp_parser.so.*
%doc AUTHORS README.md LICENSE-MIT

%files -n libhttp_parser-devel
%defattr(-,root,root)
%attr(644,root,root) %{_includedir}/http_parser.h
%{_libdir}/libhttp_parser.so

%changelog

openSUSE Build Service is sponsored by