|
|
321eb1 |
%{?scl:%scl_package http-parser}
|
|
|
321eb1 |
%{!?scl:%global pkg_name %{name}}
|
|
|
321eb1 |
|
|
|
321eb1 |
# we use the upstream version from http_parser.h as the SONAME
|
|
|
321eb1 |
%global somajor 2
|
|
|
321eb1 |
%global sominor 0
|
|
|
321eb1 |
|
|
|
321eb1 |
%global git_date 20121128
|
|
|
321eb1 |
%global git_commit_hash cd01361
|
|
|
321eb1 |
%global github_seq 7
|
|
|
321eb1 |
|
|
|
321eb1 |
Name: %{?scl_prefix}http-parser
|
|
|
321eb1 |
Version: %{somajor}.%{sominor}
|
|
|
321eb1 |
Release: 6.%{git_date}git%{git_commit_hash}%{?dist}
|
|
|
321eb1 |
Summary: HTTP request/response parser for C
|
|
|
321eb1 |
|
|
|
321eb1 |
Group: System Environment/Libraries
|
|
|
321eb1 |
License: MIT
|
|
|
321eb1 |
URL: http://github.com/joyent/http-parser
|
|
|
321eb1 |
# download from https://github.com/joyent/http-parser/tarball/%%{version}
|
|
|
321eb1 |
Source0: joyent-http-parser-v%{version}-%{github_seq}-g%{git_commit_hash}.tar.gz
|
|
|
321eb1 |
BuildRoot: %(mktemp -ud %{_tmppath}/%{pkg_name}-%{version}-%{release}-XXXXXX)
|
|
|
321eb1 |
|
|
|
321eb1 |
# Build shared library with SONAME using gyp and remove -O flags so optflags take over
|
|
|
321eb1 |
# TODO: do this nicely upstream
|
|
|
321eb1 |
Patch1: http-parser-gyp-sharedlib.patch
|
|
|
321eb1 |
|
|
|
321eb1 |
%{?scl:Requires: %{scl}-runtime}
|
|
|
321eb1 |
%{?scl:BuildRequires: %{scl}-runtime}
|
|
|
321eb1 |
BuildRequires: v8314-gyp
|
|
|
321eb1 |
|
|
|
321eb1 |
%description
|
|
|
321eb1 |
This is a parser for HTTP messages written in C. It parses both requests and
|
|
|
321eb1 |
responses. The parser is designed to be used in performance HTTP applications.
|
|
|
321eb1 |
It does not make any syscalls nor allocations, it does not buffer data, it can
|
|
|
321eb1 |
be interrupted at anytime. Depending on your architecture, it only requires
|
|
|
321eb1 |
about 40 bytes of data per message stream (in a web server that is per
|
|
|
321eb1 |
connection).
|
|
|
321eb1 |
|
|
|
321eb1 |
%package devel
|
|
|
321eb1 |
Group: Development/Libraries
|
|
|
321eb1 |
Summary: Development headers and libraries for http-parser
|
|
|
321eb1 |
Requires: %{name} = %{version}-%{release}
|
|
|
321eb1 |
|
|
|
321eb1 |
%description devel
|
|
|
321eb1 |
Development headers and libraries for http-parser.
|
|
|
321eb1 |
|
|
|
321eb1 |
%prep
|
|
|
321eb1 |
%setup -q -n joyent-http-parser-%{git_commit_hash}
|
|
|
321eb1 |
%patch1
|
|
|
321eb1 |
|
|
|
321eb1 |
%build
|
|
|
321eb1 |
%{?scl:scl enable %{scl} "}
|
|
|
321eb1 |
# TODO: fix -fPIC upstream
|
|
|
321eb1 |
export CFLAGS='%{optflags} -fPIC'
|
|
|
321eb1 |
gyp -f make --depth=`pwd` http_parser.gyp
|
|
|
321eb1 |
make %{?_smp_mflags} BUILDTYPE=Release
|
|
|
321eb1 |
%{?scl: "}
|
|
|
321eb1 |
|
|
|
321eb1 |
%install
|
|
|
321eb1 |
rm -rf %{buildroot}
|
|
|
321eb1 |
|
|
|
321eb1 |
install -d %{buildroot}%{_includedir}
|
|
|
321eb1 |
install -d %{buildroot}%{_libdir}
|
|
|
321eb1 |
|
|
|
321eb1 |
install -pm644 http_parser.h %{buildroot}%{_includedir}
|
|
|
321eb1 |
|
|
|
321eb1 |
#install regular variant
|
|
|
321eb1 |
install out/Release/lib.target/libhttp_parser.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
|
|
|
321eb1 |
ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}
|
|
|
321eb1 |
ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so
|
|
|
321eb1 |
|
|
|
321eb1 |
#install strict variant
|
|
|
321eb1 |
install out/Release/lib.target/libhttp_parser_strict.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{somajor}.%{sominor}
|
|
|
321eb1 |
ln -sf libhttp_parser_strict.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{somajor}
|
|
|
321eb1 |
ln -sf libhttp_parser_strict.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser_strict.so
|
|
|
321eb1 |
|
|
|
321eb1 |
%check
|
|
|
321eb1 |
export LD_LIBRARY_PATH='./out/Release/lib.target'
|
|
|
321eb1 |
./out/Release/test-nonstrict
|
|
|
321eb1 |
./out/Release/test-strict
|
|
|
321eb1 |
|
|
|
321eb1 |
%clean
|
|
|
321eb1 |
rm -rf %{buildroot}
|
|
|
321eb1 |
|
|
|
321eb1 |
|
|
|
321eb1 |
%post -p /sbin/ldconfig
|
|
|
321eb1 |
%postun -p /sbin/ldconfig
|
|
|
321eb1 |
|
|
|
321eb1 |
%files
|
|
|
321eb1 |
%defattr(-,root,root,-)
|
|
|
321eb1 |
%{_libdir}/libhttp_parser.so.*
|
|
|
321eb1 |
%{_libdir}/libhttp_parser_strict.so.*
|
|
|
321eb1 |
%doc AUTHORS CONTRIBUTIONS LICENSE-MIT README.md
|
|
|
321eb1 |
|
|
|
321eb1 |
%files devel
|
|
|
321eb1 |
%defattr(-,root,root,-)
|
|
|
321eb1 |
%{_includedir}/*
|
|
|
321eb1 |
%{_libdir}/libhttp_parser.so
|
|
|
321eb1 |
%{_libdir}/libhttp_parser_strict.so
|
|
|
321eb1 |
|
|
|
321eb1 |
%changelog
|
|
|
321eb1 |
* Wed Nov 27 2013 Tomas Hrcka <thrcka@redhat.com> - 2.0-6.20121128gitcd01361
|
|
|
321eb1 |
- add change nodejs010-gyp to v8314-gyp
|
|
|
321eb1 |
- add build dependency on collection runtime package
|
|
|
321eb1 |
|
|
|
321eb1 |
* Fri Apr 05 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-5.20121128gitcd01361
|
|
|
321eb1 |
- Add support for software collections
|
|
|
321eb1 |
|
|
|
321eb1 |
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4.20121128gitcd01361
|
|
|
321eb1 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
|
|
321eb1 |
|
|
|
321eb1 |
* Sun Dec 02 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-3.20121128gitcd01361
|
|
|
321eb1 |
- latest git snapshot
|
|
|
321eb1 |
- fixes buffer overflow in tests
|
|
|
321eb1 |
|
|
|
321eb1 |
* Tue Nov 27 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-2.20121110git245f6f0
|
|
|
321eb1 |
- latest git snapshot
|
|
|
321eb1 |
- fixes tests
|
|
|
321eb1 |
- use SMP make flags
|
|
|
321eb1 |
- build as Release instead of Debug
|
|
|
321eb1 |
- ship new strict variant
|
|
|
321eb1 |
|
|
|
321eb1 |
* Sat Oct 13 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-1
|
|
|
321eb1 |
- new upstream release 2.0
|
|
|
321eb1 |
- migrate to GYP buildsystem
|
|
|
321eb1 |
|
|
|
321eb1 |
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
|
|
|
321eb1 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
|
|
321eb1 |
|
|
|
321eb1 |
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
|
|
|
321eb1 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
|
|
321eb1 |
|
|
|
321eb1 |
* Mon Aug 22 2011 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0-1
|
|
|
321eb1 |
- New upstream release 1.0
|
|
|
321eb1 |
- Remove patches, no longer needed for nodejs
|
|
|
321eb1 |
- Fix typo in -devel description
|
|
|
321eb1 |
- use github tarball instead of checkout
|
|
|
321eb1 |
|
|
|
321eb1 |
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-6.20100911git
|
|
|
321eb1 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
|
|
321eb1 |
|
|
|
321eb1 |
* Tue Jan 11 2011 Lubomir Rintel <lkundrak@v3.sk> - 0.3-5.20100911git
|
|
|
321eb1 |
- Add support for methods used by node.js
|
|
|
321eb1 |
|
|
|
321eb1 |
* Thu Nov 4 2010 Dan Horák <dan[at]danny.cz> - 0.3-4.20100911git
|
|
|
321eb1 |
- build with -fsigned-char
|
|
|
321eb1 |
|
|
|
321eb1 |
* Wed Sep 29 2010 jkeating - 0.3-3.20100911git
|
|
|
321eb1 |
- Rebuilt for gcc bug 634757
|
|
|
321eb1 |
|
|
|
321eb1 |
* Mon Sep 20 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.3-2.20100911git
|
|
|
321eb1 |
- Call ldconfig (Peter Lemenkov)
|
|
|
321eb1 |
|
|
|
321eb1 |
* Fri Sep 17 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.3-1.20100911git
|
|
|
321eb1 |
- Initial packaging
|