]> git.pld-linux.org Git - packages/http-parser.git/blob - http-parser.spec
- updated to 2.8.1
[packages/http-parser.git] / http-parser.spec
1 Summary:        HTTP request/response parser for C
2 Summary(pl.UTF-8):      Analizator żądań/odpowiedzi HTTP dla C
3 Name:           http-parser
4 Version:        2.8.1
5 Release:        1
6 License:        MIT
7 Group:          Libraries
8 #Source0Download: https://github.com/nodejs/http-parser/releases
9 Source0:        https://github.com/nodejs/http-parser/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  cb8cbe17d68c4101eebe80229e32efdb
11 # Build shared library with SONAME using gyp and remove -O flags so optflags take over
12 # TODO: do this nicely upstream
13 Patch0:         %{name}-gyp-sharedlib.patch
14 URL:            http://github.com/nodejs/http-parser
15 BuildRequires:  libstdc++-devel
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
21 %define sominor 8
22 %define somicro 1
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
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
42 %package devel
43 Summary:        Development headers for http-parser library
44 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki http-parser
45 Group:          Development/Libraries
46 Requires:       %{name} = %{version}-%{release}
47
48 %description devel
49 Development headers for http-parser library.
50
51 %description devel -l pl.UTF-8
52 Pliki nagłówkowe biblioteki http-parser.
53
54 %prep
55 %setup -q
56 %patch0
57
58 %build
59 # TODO: fix -fPIC upstream
60 export CFLAGS='%{rpmcflags} -fPIC'
61 gyp -f make --depth=. http_parser.gyp
62 %{__make} V=1 \
63         CC="%{__cc}" \
64         CXX="%{__cxx}" \
65         BUILDTYPE=Release
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)
98 %doc AUTHORS LICENSE-MIT README.md
99 %attr(755,root,root) %{_libdir}/libhttp_parser.so.*.*.*
100 %attr(755,root,root) %ghost %{_libdir}/libhttp_parser.so.2
101 %attr(755,root,root) %{_libdir}/libhttp_parser_strict.so.*.*.*
102 %attr(755,root,root) %ghost %{_libdir}/libhttp_parser_strict.so.2
103
104 %files devel
105 %defattr(644,root,root,755)
106 %attr(755,root,root) %{_libdir}/libhttp_parser.so
107 %attr(755,root,root) %{_libdir}/libhttp_parser_strict.so
108 %{_includedir}/http_parser.h
This page took 0.088828 seconds and 3 git commands to generate.