]>
Commit | Line | Data |
---|---|---|
2889eff1 | 1 | Summary: HTTP request/response parser for C |
1961ec03 | 2 | Summary(pl.UTF-8): Analizator żądań/odpowiedzi HTTP dla C |
2889eff1 | 3 | Name: http-parser |
a4dd283e | 4 | Version: 2.9.2 |
883d3df7 | 5 | Release: 1 |
2889eff1 ER |
6 | License: MIT |
7 | Group: Libraries | |
5d0c3a9f JB |
8 | #Source0Download: https://github.com/nodejs/http-parser/releases |
9 | Source0: 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 | 13 | Patch0: %{name}-gyp-sharedlib.patch |
5d0c3a9f | 14 | URL: http://github.com/nodejs/http-parser |
1961ec03 | 15 | BuildRequires: libstdc++-devel |
2889eff1 ER |
16 | BuildRequires: gyp |
17 | BuildRoot: %{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 | |
25 | This is a parser for HTTP messages written in C. It parses both | |
26 | requests and responses. The parser is designed to be used in | |
27 | performance HTTP applications. It does not make any syscalls nor | |
28 | allocations, it does not buffer data, it can be interrupted at | |
29 | anytime. Depending on your architecture, it only requires about 40 | |
30 | bytes of data per message stream (in a web server that is per | |
31 | connection). | |
32 | ||
1961ec03 JB |
33 | %description -l pl.UTF-8 |
34 | Ten pakiet zawiera analizator komunikatów HTTP napisany w C. Analizuje | |
35 | zarówno żądania, jak i odpowiedzi. Może być używany w zastosowaniach | |
36 | wymagających dużej wydajności. Nie wykonuje żadnych wywołań | |
37 | systemowych, nie przydziela pamięci, nie buforuje danych, może być | |
38 | przerwany w dowolnej chwili. W zależności od architektury wymaga | |
39 | jedynie około 40 bajtów danych dla strumienia komunikatów (w przypadku | |
40 | serwera WWW - dla połączenia). | |
41 | ||
2889eff1 | 42 | %package devel |
1961ec03 JB |
43 | Summary: Development headers for http-parser library |
44 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki http-parser | |
2889eff1 ER |
45 | Group: Development/Libraries |
46 | Requires: %{name} = %{version}-%{release} | |
47 | ||
48 | %description devel | |
1961ec03 JB |
49 | Development headers for http-parser library. |
50 | ||
51 | %description devel -l pl.UTF-8 | |
52 | Pliki 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 | 60 | export CFLAGS='%{rpmcflags} -fPIC' |
2889eff1 | 61 | gyp -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} | |
68 | export LD_LIBRARY_PATH='./out/Release/lib.target' | |
69 | ./out/Release/test-nonstrict | |
70 | ./out/Release/test-strict | |
71 | %endif | |
72 | ||
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}} | |
76 | cp -p http_parser.h $RPM_BUILD_ROOT%{_includedir} | |
77 | ||
78 | # install regular variant | |
79 | install -p out/Release/lib.target/libhttp_parser.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}.%{somicro} | |
80 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.*.*.*) | |
81 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor} | |
82 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so | |
83 | ||
84 | # install strict variant | |
85 | install -p out/Release/lib.target/libhttp_parser_strict.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor}.%{sominor}.%{somicro} | |
86 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.*.*.*) | |
87 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor} | |
88 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so | |
89 | ||
90 | %clean | |
91 | rm -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 |