]> git.pld-linux.org Git - packages/http-parser.git/blame - http-parser.spec
BR: libstdc++-devel
[packages/http-parser.git] / http-parser.spec
CommitLineData
2889eff1
ER
1%define git_date 20121128
2%define git_commit_hash cd01361
3%define github_seq 7
4Summary: HTTP request/response parser for C
5Name: http-parser
6Version: 2.0
7Release: 0.git%{git_commit_hash}
8License: MIT
9Group: Libraries
10URL: http://github.com/joyent/http-parser
11# download from https://github.com/joyent/http-parser/tarball/%%{version}
12Source0: http://pkgs.fedoraproject.org/repo/pkgs/http-parser/joyent-%{name}-v%{version}-%{github_seq}-g%{git_commit_hash}.tar.gz/340f2aab333c435cbaf49a4949645a06/joyent-http-parser-v%{version}-%{github_seq}-g%{git_commit_hash}.tar.gz
13# Source0-md5: 340f2aab333c435cbaf49a4949645a06
1dcbed49 14BuildRequires: libstdc++-devel
2889eff1
ER
15BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
16# Build shared library with SONAME using gyp and remove -O flags so optflags take over
17# TODO: do this nicely upstream
18Patch1: %{name}-gyp-sharedlib.patch
19BuildRequires: gyp
20BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22# we use the upstream version from http_parser.h as the SONAME
23%define somajor 2
24%define sominor 0
25%define somicro 0
26
27%description
28This is a parser for HTTP messages written in C. It parses both
29requests and responses. The parser is designed to be used in
30performance HTTP applications. It does not make any syscalls nor
31allocations, it does not buffer data, it can be interrupted at
32anytime. Depending on your architecture, it only requires about 40
33bytes of data per message stream (in a web server that is per
34connection).
35
36%package devel
37Summary: Development headers and libraries for http-parser
38Group: Development/Libraries
39Requires: %{name} = %{version}-%{release}
40
41%description devel
42Development headers and libraries for http-parser.
43
44%prep
45%setup -q -n joyent-%{name}-%{git_commit_hash}
46%patch1
47
48%build
49# TODO: fix -fPIC upstream
50export CFLAGS='%{optflags} -fPIC'
51gyp -f make --depth=. http_parser.gyp
52%{__make} V=1 BUILDTYPE=Release
53
54%if %{with tests}
55export LD_LIBRARY_PATH='./out/Release/lib.target'
56./out/Release/test-nonstrict
57./out/Release/test-strict
58%endif
59
60%install
61rm -rf $RPM_BUILD_ROOT
62install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}}
63cp -p http_parser.h $RPM_BUILD_ROOT%{_includedir}
64
65# install regular variant
66install -p out/Release/lib.target/libhttp_parser.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}.%{somicro}
67lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.*.*.*)
68ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}
69ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so
70
71# install strict variant
72install -p out/Release/lib.target/libhttp_parser_strict.so.%{somajor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor}.%{sominor}.%{somicro}
73lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.*.*.*)
74ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so.%{somajor}
75ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libhttp_parser_strict.so
76
77%clean
78rm -rf $RPM_BUILD_ROOT
79
80%post -p /sbin/ldconfig
81%postun -p /sbin/ldconfig
82
83%files
84%defattr(644,root,root,755)
85%doc AUTHORS CONTRIBUTIONS LICENSE-MIT README.md
86%attr(755,root,root) %{_libdir}/libhttp_parser.so.*.*.*
87%ghost %{_libdir}/libhttp_parser.so.2
88%attr(755,root,root) %{_libdir}/libhttp_parser_strict.so.*.*.*
89%ghost %{_libdir}/libhttp_parser_strict.so.2
90
91%files devel
92%defattr(644,root,root,755)
93%{_includedir}/http_parser.h
94%{_libdir}/libhttp_parser.so
95%{_libdir}/libhttp_parser_strict.so
This page took 0.064391 seconds and 4 git commands to generate.