diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd9ec16 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v2.7.0.tar.gz diff --git a/.rh-nodejs6-http-parser.metadata b/.rh-nodejs6-http-parser.metadata new file mode 100644 index 0000000..421eb50 --- /dev/null +++ b/.rh-nodejs6-http-parser.metadata @@ -0,0 +1 @@ +f24bd35cf6d663e2b9f916708d82a96f562bc78b SOURCES/v2.7.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/http-parser-gyp-sharedlib.patch b/SOURCES/http-parser-gyp-sharedlib.patch new file mode 100644 index 0000000..451faeb --- /dev/null +++ b/SOURCES/http-parser-gyp-sharedlib.patch @@ -0,0 +1,40 @@ +--- http_parser.gyp~ 2012-11-27 15:40:11.721398004 -0700 ++++ http_parser.gyp 2012-11-27 15:40:11.721398004 -0700 +@@ -12,7 +12,7 @@ + # RuntimeLibrary MUST MATCH across the entire project + 'Debug': { + 'defines': [ 'DEBUG', '_DEBUG' ], +- 'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ], ++ 'cflags': [ '-Wall', '-Wextra', '-g', '-ftrapv' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 1, # static debug +@@ -21,7 +21,7 @@ + }, + 'Release': { + 'defines': [ 'NDEBUG' ], +- 'cflags': [ '-Wall', '-Wextra', '-O3' ], ++ 'cflags': [ '-Wall', '-Wextra' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 0, # static release +@@ -50,7 +50,8 @@ + 'targets': [ + { + 'target_name': 'http_parser', +- 'type': 'static_library', ++ 'type': 'shared_library', ++ 'product_extension': 'so.<(soname_version)', + 'include_dirs': [ '.' ], + 'direct_dependent_settings': { + 'defines': [ 'HTTP_PARSER_STRICT=0' ], +@@ -73,7 +74,8 @@ + + { + 'target_name': 'http_parser_strict', +- 'type': 'static_library', ++ 'type': 'shared_library', ++ 'product_extension': 'so.<(soname_version)', + 'include_dirs': [ '.' ], + 'direct_dependent_settings': { + 'defines': [ 'HTTP_PARSER_STRICT=1' ], diff --git a/SPECS/http-parser.spec b/SPECS/http-parser.spec new file mode 100644 index 0000000..aa5dac3 --- /dev/null +++ b/SPECS/http-parser.spec @@ -0,0 +1,179 @@ +%{?scl:%scl_package http-parser} +%{!?scl:%global pkg_name %{name}} + +# we use the upstream version from http_parser.h as the SONAME +%global somajor 2 +%global sominor 7 +%global sopoint 0 +%global sover %{somajor}.%{sominor}.%{sopoint} + +Name: %{?scl_prefix}http-parser +Version: %{somajor}.%{sominor}.%{sopoint} +Release: 2%{?dist} +Summary: HTTP request/response parser for C + +License: MIT +URL: http://github.com/nodejs/http-parser + +Source0: https://github.com/nodejs/http-parser/archive/v%{version}.tar.gz + +# Build shared library with SONAME using gyp and remove -O flags so optflags take over +# TODO: do this nicely upstream +Patch1: http-parser-gyp-sharedlib.patch + +%{?scl:Requires: %{scl}-runtime} +%{?scl:BuildRequires: %{scl}-runtime} + +BuildRequires: %{scl_prefix}gyp + +%description +This is a parser for HTTP messages written in C. It parses both requests and +responses. The parser is designed to be used in performance HTTP applications. +It does not make any syscalls nor allocations, it does not buffer data, it can +be interrupted at anytime. Depending on your architecture, it only requires +about 40 bytes of data per message stream (in a web server that is per +connection). + + +%package devel +Summary: Development headers and libraries for http-parser +Requires: %{name} = %{version}-%{release} + +%description devel +Development headers and libraries for http-parser. + + +%prep +%setup -q -n http-parser-%{version} +%patch1 + +%build +%{?scl:scl enable %{scl} "} +# TODO: fix -fPIC upstream +export CFLAGS='%{optflags} -fPIC' +gyp -f make -Dsoname_version=%{?scl:%{scl_name}-}%{sover} --depth=`pwd` http_parser.gyp +make %{?_smp_mflags} BUILDTYPE=Release +%{?scl: "} + +%install +rm -rf %{buildroot} + +install -d %{buildroot}%{_includedir} +install -d %{buildroot}%{_libdir} + +install -pm644 http_parser.h %{buildroot}%{_includedir} + +#install regular variant +install out/Release/lib.target/libhttp_parser.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser.so.%{?scl:%{scl_name}-}%{sover} +ln -sf libhttp_parser.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor} +ln -sf libhttp_parser.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser.so + +#install strict variant +install out/Release/lib.target/libhttp_parser_strict.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{?scl:%{scl_name}-}%{sover} +ln -sf libhttp_parser_strict.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{somajor} +ln -sf libhttp_parser_strict.so.%{?scl:%{scl_name}-}%{sover} %{buildroot}%{_libdir}/libhttp_parser_strict.so + + +%check +export LD_LIBRARY_PATH='./out/Release/lib.target' +./out/Release/test-nonstrict +./out/Release/test-strict + + +%clean +rm -rf %{buildroot} + + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + + +%files +%{_libdir}/libhttp_parser.so.* +%{_libdir}/libhttp_parser_strict.so.* +%doc AUTHORS README.md +%license LICENSE-MIT + + +%files devel +%{_includedir}/* +%{_libdir}/libhttp_parser.so +%{_libdir}/libhttp_parser_strict.so + + +%changelog +* Wed Jan 11 2017 Zuzana Svetlikova - 2.7.0-2 +- Use macro in requires + +* Tue Nov 15 2016 Zuzana Svetlikova - 2.7.0-1 +- Update for nodejs rebase (RHBZ#1388097) + +* Mon Apr 04 2016 Tomas Hrcka - 2.6.1-4 +- Use scl name as soname suffix + +* Mon Apr 04 2016 Zuzana Svetlikova - 2.6.1-3 +- Modify patch to provide %%sover prefix + +* Wed Mar 23 2016 Zuzana Svetlikova - 2.6.1-2 +- Make package provide prefixed library + +* Tue Feb 16 2016 Tomas Hrcka - 2.6.1-1 +- Rebase to latest upstream release + +* Wed Feb 10 2016 Zuzana Svetlikova - 2.6.0-1 +- Update to latest upstream version + +* Wed Nov 27 2013 Tomas Hrcka - 2.0-6.20121128gitcd01361 +- add change nodejs010-gyp to v8314-gyp +- add build dependency on collection runtime package + +* Fri Apr 05 2013 Stanislav Ochotnicky - 2.0-5.20121128gitcd01361 +- Add support for software collections + +* Thu Feb 14 2013 Fedora Release Engineering - 2.0-4.20121128gitcd01361 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Dec 02 2012 T.C. Hollingsworth - 2.0-3.20121128gitcd01361 +- latest git snapshot +- fixes buffer overflow in tests + +* Tue Nov 27 2012 T.C. Hollingsworth - 2.0-2.20121110git245f6f0 +- latest git snapshot +- fixes tests +- use SMP make flags +- build as Release instead of Debug +- ship new strict variant + +* Sat Oct 13 2012 T.C. Hollingsworth - 2.0-1 +- new upstream release 2.0 +- migrate to GYP buildsystem + +* Thu Jul 19 2012 Fedora Release Engineering - 1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Aug 22 2011 T.C. Hollingsworth - 1.0-1 +- New upstream release 1.0 +- Remove patches, no longer needed for nodejs +- Fix typo in -devel description +- use github tarball instead of checkout + +* Wed Feb 09 2011 Fedora Release Engineering - 0.3-6.20100911git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 11 2011 Lubomir Rintel - 0.3-5.20100911git +- Add support for methods used by node.js + +* Thu Nov 04 2010 Dan Horák - 0.3-4.20100911git +- build with -fsigned-char + +* Wed Sep 29 2010 jkeating - 0.3-3.20100911git +- Rebuilt for gcc bug 634757 + +* Mon Sep 20 2010 Lubomir Rintel - 0.3-2.20100911git +- Call ldconfig (Peter Lemenkov) + +* Fri Sep 17 2010 Lubomir Rintel - 0.3-1.20100911git +- Initial packaging