bbd587f
%global somajor 0
bbd587f
%global sominor 3
bbd587f
bbd587f
Name:           http-parser
bbd587f
Version:        %{somajor}.%{sominor}
bbd587f
Release:        2.20100911git%{?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
bbd587f
# git clone http://github.com/ry/http-parser.git
bbd587f
# cd http-parser/
bbd587f
# git archive 459507f5 --prefix=http-parser/ |gzip -9 >../http-parser.tar.gz
bbd587f
Source0:        http-parser.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
bbd587f
Development headers and libraries for htt-parser.
bbd587f
bbd587f
bbd587f
%prep
bbd587f
%setup -q -n %{name}
bbd587f
bbd587f
bbd587f
%build
bbd587f
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fPIC" http_parser.o
bbd587f
%{__cc} $(rpm --eval %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
bbd587f
make %{?_smp_mflags} CC="%{__cc} %{optflags} -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
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
bbd587f
- Initial packaging