Blame SPECS/http-parser.spec

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