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