]> git.pld-linux.org Git - packages/http-parser.git/blame - http-parser.spec
- updated to 2.9.2
[packages/http-parser.git] / http-parser.spec
CommitLineData
2889eff1 1Summary: HTTP request/response parser for C
1961ec03 2Summary(pl.UTF-8): Analizator żądań/odpowiedzi HTTP dla C
2889eff1 3Name: http-parser
a4dd283e 4Version: 2.9.2
883d3df7 5Release: 1
2889eff1
ER
6License: MIT
7Group: Libraries
5d0c3a9f
JB
8#Source0Download: https://github.com/nodejs/http-parser/releases
9Source0: https://github.com/nodejs/http-parser/archive/v%{version}/%{name}-%{version}.tar.gz
a4dd283e 10# Source0-md5: aaf0421392e1c0d1f2d51ec9f0e08cc1
2889eff1
ER
11# Build shared library with SONAME using gyp and remove -O flags so optflags take over
12# TODO: do this nicely upstream
1961ec03 13Patch0: %{name}-gyp-sharedlib.patch
5d0c3a9f 14URL: http://github.com/nodejs/http-parser
1961ec03 15BuildRequires: libstdc++-devel
2889eff1
ER
16BuildRequires: gyp
17BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19# we use the upstream version from http_parser.h as the SONAME
20%define somajor 2
a4dd283e
JB
21%define sominor 9
22%define somicro 2
2889eff1
ER
23
24%description
25This is a parser for HTTP messages written in C. It parses both
26requests and responses. The parser is designed to be used in
27performance HTTP applications. It does not make any syscalls nor
28allocations, it does not buffer data, it can be interrupted at
29anytime. Depending on your architecture, it only requires about 40
30bytes of data per message stream (in a web server that is per
31connection).
32
1961ec03
JB
33%description -l pl.UTF-8
34Ten pakiet zawiera analizator komunikatów HTTP napisany w C. Analizuje
35zarówno żądania, jak i odpowiedzi. Może być używany w zastosowaniach
36wymagających dużej wydajności. Nie wykonuje żadnych wywołań
37systemowych, nie przydziela pamięci, nie buforuje danych, może być
38przerwany w dowolnej chwili. W zależności od architektury wymaga
39jedynie około 40 bajtów danych dla strumienia komunikatów (w przypadku
40serwera WWW - dla połączenia).
41
2889eff1 42%package devel
1961ec03
JB
43Summary: Development headers for http-parser library
44Summary(pl.UTF-8): Pliki nagłówkowe biblioteki http-parser
2889eff1
ER
45Group: Development/Libraries
46Requires: %{name} = %{version}-%{release}
47
48%description devel
1961ec03
JB
49Development headers for http-parser library.
50
51%description devel -l pl.UTF-8
52Pliki nagłówkowe biblioteki http-parser.
2889eff1
ER
53
54%prep
883d3df7 55%setup -q
1961ec03 56%patch0
2889eff1
ER
57
58%build
59# TODO: fix -fPIC upstream
1961ec03 60export CFLAGS='%{rpmcflags} -fPIC'
2889eff1 61gyp -f make --depth=. http_parser.gyp
883d3df7
ER
62%{__make} V=1 \
63 CC="%{__cc}" \
64 CXX="%{__cxx}" \
65 BUILDTYPE=Release
2889eff1
ER
66
67%if %{with tests}
68export LD_LIBRARY_PATH='./out/Release/lib.target'
69./out/Release/test-nonstrict
70./out/Release/test-strict
71%endif
72
73%install
74rm -rf $RPM_BUILD_ROOT
75install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
76cp -p http_parser.h $RPM_BUILD_ROOT%{_includedir}
77
78# install regular variant
79install -p out/Release/lib.target/libhttp_parser.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}.%{somicro}
80lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.*.*.*)
81ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}
82ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so
83
84# install strict variant
85install -p out/Release/lib.target/libhttp_parser_strict.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor}.%{sominor}.%{somicro}
86lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.*.*.*)
87ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor}
88ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so
89
90%clean
91rm -rf $RPM_BUILD_ROOT
92
93%post -p /sbin/ldconfig
94%postun -p /sbin/ldconfig
95
96%files
97%defattr(644,root,root,755)
33618b37 98%doc AUTHORS LICENSE-MIT README.md
2889eff1 99%attr(755,root,root) %{_libdir}/libhttp_parser.so.*.*.*
1961ec03 100%attr(755,root,root) %ghost %{_libdir}/libhttp_parser.so.2
2889eff1 101%attr(755,root,root) %{_libdir}/libhttp_parser_strict.so.*.*.*
1961ec03 102%attr(755,root,root) %ghost %{_libdir}/libhttp_parser_strict.so.2
2889eff1
ER
103
104%files devel
105%defattr(644,root,root,755)
1961ec03
JB
106%attr(755,root,root) %{_libdir}/libhttp_parser.so
107%attr(755,root,root) %{_libdir}/libhttp_parser_strict.so
2889eff1 108%{_includedir}/http_parser.h
This page took 0.121997 seconds and 4 git commands to generate.