Blame SPECS/http-parser.spec

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