0cf3a66
%global somajor 1
0cf3a66
%global sominor 0
0cf3a66
%global git_hash 32c0e11
bbd587f
bbd587f
Name:           http-parser
bbd587f
Version:        %{somajor}.%{sominor}
666b0c4
Release:        3%{?dist}
bbd587f
Summary:        HTTP request/response parser for C
bbd587f
bbd587f
Group:          System Environment/Libraries
bbd587f
License:        MIT
bbd587f
URL:            http://github.com/ry/http-parser
0cf3a66
# download from https://github.com/ry/http-parser/tarball/v%%{version}
0cf3a66
Source0:        ry-http-parser-v%{version}-0-g%{git_hash}.tar.gz
bbd587f
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
bbd587f
bbd587f
%description
bbd587f
This is a parser for HTTP messages written in C. It parses both requests and
bbd587f
responses. The parser is designed to be used in performance HTTP applications.
bbd587f
It does not make any syscalls nor allocations, it does not buffer data, it can
bbd587f
be interrupted at anytime. Depending on your architecture, it only requires
bbd587f
about 40 bytes of data per message stream (in a web server that is per
bbd587f
connection).
bbd587f
bbd587f
bbd587f
%package devel
bbd587f
Group:          Development/Libraries
bbd587f
Summary:        Development headers and libraries for http-parser
bbd587f
Requires:       %{name} = %{version}-%{release}
bbd587f
bbd587f
%description devel
0cf3a66
Development headers and libraries for http-parser.
bbd587f
bbd587f
bbd587f
%prep
0cf3a66
%setup -q -n ry-http-parser-%{git_hash}
bbd587f
bbd587f
bbd587f
%build
2bc7ee7
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" http_parser.o
2bc7ee7
%{__cc} %{optflags} -Wl,-soname,http_parser.so.%{somajor} \
bbd587f
        -o libhttp_parser.so -shared http_parser.o
bbd587f
bbd587f
bbd587f
%install
bbd587f
rm -rf $RPM_BUILD_ROOT
bbd587f
install -d $RPM_BUILD_ROOT%{_includedir}
bbd587f
install -d $RPM_BUILD_ROOT%{_libdir}
bbd587f
install -pm644 http_parser.h $RPM_BUILD_ROOT%{_includedir}
bbd587f
install libhttp_parser.so $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
bbd587f
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}
bbd587f
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so
bbd587f
bbd587f
bbd587f
%check
2bc7ee7
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" test
bbd587f
bbd587f
bbd587f
%clean
bbd587f
rm -rf $RPM_BUILD_ROOT
bbd587f
bbd587f
bbd587f
%post -p /sbin/ldconfig
bbd587f
%postun -p /sbin/ldconfig
bbd587f
bbd587f
bbd587f
%files
bbd587f
%defattr(-,root,root,-)
bbd587f
%{_libdir}/libhttp_parser.so.*
bbd587f
%doc CONTRIBUTIONS LICENSE-MIT README.md
bbd587f
bbd587f
bbd587f
%files devel
bbd587f
%defattr(-,root,root,-)
bbd587f
%{_includedir}/*
bbd587f
%{_libdir}/libhttp_parser.so
bbd587f
bbd587f
bbd587f
%changelog
666b0c4
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
666b0c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
666b0c4
af6d056
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
af6d056
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
af6d056
0cf3a66
* Mon Aug 22 2011 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0-1
0cf3a66
- New upstream release 1.0
0cf3a66
- Remove patches, no longer needed for nodejs
0cf3a66
- Fix typo in -devel description
0cf3a66
- use github tarball instead of checkout
0cf3a66
4b6f69b
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-6.20100911git
4b6f69b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4b6f69b
389fac3
* Tue Jan 11 2011 Lubomir Rintel <lkundrak@v3.sk> - 0.3-5.20100911git
389fac3
- Add support for methods used by node.js
389fac3
0cf3a66
* Thu Nov  4 2010 Dan Horák <dan[at]danny.cz> - 0.3-4.20100911git
2bc7ee7
- build with -fsigned-char
2bc7ee7
Jesse Keating 2754012
* Wed Sep 29 2010 jkeating - 0.3-3.20100911git
Jesse Keating 2754012
- Rebuilt for gcc bug 634757
Jesse Keating 2754012
bbd587f
* Mon Sep 20 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.3-2.20100911git
bbd587f
- Call ldconfig (Peter Lemenkov)
bbd587f
bbd587f
* Fri Sep 17 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.3-1.20100911git
0cf3a66
- Initial packaging