latest git snapshot
- fixes tests - use SMP make flags - build as Release instead of Debug - ship new strict variant
This commit is contained in:
parent
3ba45f113c
commit
d14b316514
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/http-parser.tar.gz
|
||||
/ry-http-parser-v1.0-0-g32c0e11.tar.gz
|
||||
/joyent-http-parser-v2.0-0-g3fb4e06.tar.gz
|
||||
/joyent-http-parser-v2.0-5-g245f6f0.tar.gz
|
||||
|
@ -1,12 +1,40 @@
|
||||
--- http_parser.gyp~ 2012-10-13 13:41:21.371501965 -0700
|
||||
+++ http_parser.gyp 2012-10-13 13:41:21.381502101 -0700
|
||||
@@ -48,7 +48,8 @@
|
||||
--- 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.2',
|
||||
'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.2',
|
||||
'include_dirs': [ '.' ],
|
||||
'direct_dependent_settings': {
|
||||
'include_dirs': [ '.' ],
|
||||
'defines': [ 'HTTP_PARSER_STRICT=1' ],
|
||||
|
@ -2,22 +2,23 @@
|
||||
%global somajor 2
|
||||
%global sominor 0
|
||||
|
||||
%global git_commit_hash 3fb4e06
|
||||
%global git_tag_hash 90a9383
|
||||
%global git_date 20121110
|
||||
%global git_commit_hash 245f6f0
|
||||
%global github_seq 5
|
||||
|
||||
Name: http-parser
|
||||
Version: %{somajor}.%{sominor}
|
||||
Release: 1%{?dist}
|
||||
Release: 2.%{git_date}git%{git_commit_hash}%{?dist}
|
||||
Summary: HTTP request/response parser for C
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: MIT
|
||||
URL: http://github.com/joyent/http-parser
|
||||
# download from https://github.com/joyent/http-parser/tarball/%%{version}
|
||||
Source0: joyent-http-parser-v%{version}-0-g%{git_commit_hash}.tar.gz
|
||||
Source0: joyent-http-parser-v%{version}-%{github_seq}-g%{git_commit_hash}.tar.gz
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
|
||||
# Build shared library with SONAME using gyp
|
||||
# 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
|
||||
|
||||
@ -42,7 +43,7 @@ Development headers and libraries for http-parser.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n joyent-http-parser-%{git_tag_hash}
|
||||
%setup -q -n joyent-http-parser-%{git_commit_hash}
|
||||
%patch1
|
||||
|
||||
|
||||
@ -50,22 +51,33 @@ Development headers and libraries for http-parser.
|
||||
# TODO: fix -fPIC upstream
|
||||
export CFLAGS='%{optflags} -fPIC'
|
||||
gyp -f make --depth=`pwd` http_parser.gyp
|
||||
make
|
||||
make %{?_smp_mflags} BUILDTYPE=Release
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
install -d %{buildroot}%{_includedir}
|
||||
install -d %{buildroot}%{_libdir}
|
||||
|
||||
install -pm644 http_parser.h %{buildroot}%{_includedir}
|
||||
install out/Debug/lib.target/libhttp_parser.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
|
||||
|
||||
#install regular variant
|
||||
install out/Release/lib.target/libhttp_parser.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
|
||||
ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}
|
||||
ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so
|
||||
|
||||
#install strict variant
|
||||
install out/Release/lib.target/libhttp_parser_strict.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{somajor}.%{sominor}
|
||||
ln -sf libhttp_parser_strict.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser_strict.so.%{somajor}
|
||||
ln -sf libhttp_parser_strict.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser_strict.so
|
||||
|
||||
|
||||
# Currently failing: https://github.com/joyent/http-parser/issues/129
|
||||
#%%check
|
||||
#LD_LIBRARY_PATH='./out/Debug/lib.target' ./out/Debug/test
|
||||
%check
|
||||
export LD_LIBRARY_PATH='./out/Release/lib.target'
|
||||
./out/Release/test-nonstrict
|
||||
./out/Release/test-strict
|
||||
|
||||
|
||||
%clean
|
||||
@ -79,6 +91,7 @@ rm -rf %{buildroot}
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/libhttp_parser.so.*
|
||||
%{_libdir}/libhttp_parser_strict.so.*
|
||||
%doc AUTHORS CONTRIBUTIONS LICENSE-MIT README.md
|
||||
|
||||
|
||||
@ -86,9 +99,17 @@ rm -rf %{buildroot}
|
||||
%defattr(-,root,root,-)
|
||||
%{_includedir}/*
|
||||
%{_libdir}/libhttp_parser.so
|
||||
%{_libdir}/libhttp_parser_strict.so
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Nov 27 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 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 <tchollingsworth@gmail.com> - 2.0-1
|
||||
- new upstream release 2.0
|
||||
- migrate to GYP buildsystem
|
||||
|
Loading…
Reference in New Issue
Block a user