new upstream release 2.0

This commit is contained in:
T.C. Hollingsworth 2012-10-13 14:17:13 -07:00
parent 666b0c492e
commit 3ba45f113c
4 changed files with 51 additions and 22 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/http-parser.tar.gz /http-parser.tar.gz
/ry-http-parser-v1.0-0-g32c0e11.tar.gz /ry-http-parser-v1.0-0-g32c0e11.tar.gz
/joyent-http-parser-v2.0-0-g3fb4e06.tar.gz

View File

@ -0,0 +1,12 @@
--- 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 @@
'targets': [
{
'target_name': 'http_parser',
- 'type': 'static_library',
+ 'type': 'shared_library',
+ 'product_extension': 'so.2',
'include_dirs': [ '.' ],
'direct_dependent_settings': {
'include_dirs': [ '.' ],

View File

@ -1,19 +1,28 @@
%global somajor 1 # we use the upstream version from http_parser.h as the SONAME
%global somajor 2
%global sominor 0 %global sominor 0
%global git_hash 32c0e11
%global git_commit_hash 3fb4e06
%global git_tag_hash 90a9383
Name: http-parser Name: http-parser
Version: %{somajor}.%{sominor} Version: %{somajor}.%{sominor}
Release: 3%{?dist} Release: 1%{?dist}
Summary: HTTP request/response parser for C Summary: HTTP request/response parser for C
Group: System Environment/Libraries Group: System Environment/Libraries
License: MIT License: MIT
URL: http://github.com/ry/http-parser URL: http://github.com/joyent/http-parser
# download from https://github.com/ry/http-parser/tarball/v%%{version} # download from https://github.com/joyent/http-parser/tarball/%%{version}
Source0: ry-http-parser-v%{version}-0-g%{git_hash}.tar.gz Source0: joyent-http-parser-v%{version}-0-g%{git_commit_hash}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
# Build shared library with SONAME using gyp
# TODO: do this nicely upstream
Patch1: http-parser-gyp-sharedlib.patch
BuildRequires: gyp
%description %description
This is a parser for HTTP messages written in C. It parses both requests and 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. responses. The parser is designed to be used in performance HTTP applications.
@ -33,31 +42,34 @@ Development headers and libraries for http-parser.
%prep %prep
%setup -q -n ry-http-parser-%{git_hash} %setup -q -n joyent-http-parser-%{git_tag_hash}
%patch1
%build %build
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" http_parser.o # TODO: fix -fPIC upstream
%{__cc} %{optflags} -Wl,-soname,http_parser.so.%{somajor} \ export CFLAGS='%{optflags} -fPIC'
-o libhttp_parser.so -shared http_parser.o gyp -f make --depth=`pwd` http_parser.gyp
make
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
install -d $RPM_BUILD_ROOT%{_includedir} install -d %{buildroot}%{_includedir}
install -d $RPM_BUILD_ROOT%{_libdir} install -d %{buildroot}%{_libdir}
install -pm644 http_parser.h $RPM_BUILD_ROOT%{_includedir} install -pm644 http_parser.h %{buildroot}%{_includedir}
install libhttp_parser.so $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor} install out/Debug/lib.target/libhttp_parser.so.%{somajor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor} ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so.%{somajor}
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so ln -sf libhttp_parser.so.%{somajor}.%{sominor} %{buildroot}%{_libdir}/libhttp_parser.so
%check # Currently failing: https://github.com/joyent/http-parser/issues/129
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" test #%%check
#LD_LIBRARY_PATH='./out/Debug/lib.target' ./out/Debug/test
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
@ -67,7 +79,7 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_libdir}/libhttp_parser.so.* %{_libdir}/libhttp_parser.so.*
%doc CONTRIBUTIONS LICENSE-MIT README.md %doc AUTHORS CONTRIBUTIONS LICENSE-MIT README.md
%files devel %files devel
@ -77,6 +89,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Sat Oct 13 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-1
- new upstream release 2.0
- migrate to GYP buildsystem
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1 +1 @@
c24c8f016eebcb30afb96c51ee938b0a ry-http-parser-v1.0-0-g32c0e11.tar.gz 7648574821330edf0c71eb3d34a71c27 joyent-http-parser-v2.0-0-g3fb4e06.tar.gz