Add MinGW packages
This commit is contained in:
parent
65c5af8285
commit
15c65ff555
98
nghttp2.spec
98
nghttp2.spec
@ -1,7 +1,13 @@
|
||||
%global with_mingw 0
|
||||
|
||||
%if 0%{?fedora}
|
||||
%global with_mingw 1
|
||||
%endif
|
||||
|
||||
Summary: Experimental HTTP/2 client, server and proxy
|
||||
Name: nghttp2
|
||||
Version: 1.56.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
|
||||
# Parts of ruby bindings are additionally under GPL-2.0-or-later, MIT and
|
||||
# Kevlin Henney (this one is not recognized by Fedora!) but they are NOT shipped.
|
||||
@ -29,6 +35,26 @@ BuildRequires: gnupg2
|
||||
Requires: libnghttp2%{?_isa} = %{version}-%{release}
|
||||
%{?systemd_requires}
|
||||
|
||||
%if %{with_mingw}
|
||||
BuildRequires: mingw32-filesystem >= 107
|
||||
BuildRequires: mingw32-gcc-c++
|
||||
BuildRequires: mingw32-binutils
|
||||
BuildRequires: mingw32-c-ares
|
||||
BuildRequires: mingw32-libxml2
|
||||
BuildRequires: mingw32-openssl
|
||||
BuildRequires: mingw32-python3
|
||||
BuildRequires: mingw32-zlib
|
||||
|
||||
BuildRequires: mingw64-filesystem >= 107
|
||||
BuildRequires: mingw64-gcc-c++
|
||||
BuildRequires: mingw64-binutils
|
||||
BuildRequires: mingw64-c-ares
|
||||
BuildRequires: mingw64-libxml2
|
||||
BuildRequires: mingw64-openssl
|
||||
BuildRequires: mingw64-python3
|
||||
BuildRequires: mingw64-zlib
|
||||
%endif
|
||||
|
||||
%description
|
||||
This package contains the HTTP/2 client, server and proxy programs.
|
||||
|
||||
@ -50,6 +76,27 @@ Requires: pkgconfig
|
||||
The libnghttp2-devel package includes libraries and header files needed
|
||||
for building applications with libnghttp2.
|
||||
|
||||
%if %{with_mingw}
|
||||
%package -n mingw32-libnghttp2
|
||||
Summary: A library implementing the HTTP/2 protocol
|
||||
|
||||
%description -n mingw32-libnghttp2
|
||||
libnghttp2 is a library implementing the Hypertext Transfer Protocol
|
||||
version 2 (HTTP/2) protocol in C.
|
||||
|
||||
This is the MinGW cross-compiled Windows library.
|
||||
|
||||
%package -n mingw64-libnghttp2
|
||||
Summary: A library implementing the HTTP/2 protocol
|
||||
|
||||
%description -n mingw64-libnghttp2
|
||||
libnghttp2 is a library implementing the Hypertext Transfer Protocol
|
||||
version 2 (HTTP/2) protocol in C.
|
||||
|
||||
This is the MinGW cross-compiled Windows library.
|
||||
|
||||
%{?mingw_debug_package}
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
||||
@ -59,6 +106,9 @@ for building applications with libnghttp2.
|
||||
sed -e '1 s|^#!/.*python|&3|' -i script/fetch-ocsp-response
|
||||
|
||||
%build
|
||||
mkdir build
|
||||
pushd build
|
||||
%define _configure ../configure
|
||||
%configure PYTHON=%{__python3} \
|
||||
--disable-hpack-tools \
|
||||
--disable-python-bindings \
|
||||
@ -71,12 +121,20 @@ sed -i libtool \
|
||||
-e 's/^hardcode_libdir_flag_spec=".*"$/hardcode_libdir_flag_spec=""/'
|
||||
|
||||
%make_build
|
||||
popd
|
||||
|
||||
%if %{with_mingw}
|
||||
%mingw_configure --disable-hpack-tools --disable-static
|
||||
%mingw_make_build
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
pushd build
|
||||
%make_install
|
||||
install -D -m0444 -p contrib/nghttpx.service \
|
||||
"$RPM_BUILD_ROOT%{_unitdir}/nghttpx.service"
|
||||
popd
|
||||
|
||||
# not needed on Fedora/RHEL
|
||||
rm -f "$RPM_BUILD_ROOT%{_libdir}/libnghttp2.la"
|
||||
@ -86,6 +144,18 @@ rm -f "$RPM_BUILD_ROOT%{_datadir}/doc/nghttp2/README.rst"
|
||||
|
||||
%ldconfig_scriptlets -n libnghttp2
|
||||
|
||||
%if %{with_mingw}
|
||||
%mingw_make_install
|
||||
%mingw_debug_install_post
|
||||
|
||||
rm -f "${buildroot}%{mingw32_libdir}/libnghttp2.la"
|
||||
rm -f "${buildroot}%{mingw64_libdir}/libnghttp2.la"
|
||||
rm -f "%{buildroot}%{mingw32_datadir}/doc/nghttp2/README.rst"
|
||||
rm -f "%{buildroot}%{mingw64_datadir}/doc/nghttp2/README.rst"
|
||||
rm -r "%{buildroot}%{mingw32_mandir}/man1"
|
||||
rm -r "%{buildroot}%{mingw64_mandir}/man1"
|
||||
%endif
|
||||
|
||||
%post
|
||||
%systemd_post nghttpx.service
|
||||
|
||||
@ -96,8 +166,9 @@ rm -f "$RPM_BUILD_ROOT%{_datadir}/doc/nghttp2/README.rst"
|
||||
%check
|
||||
# test the just built library instead of the system one, without using rpath
|
||||
export "LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARY_PATH"
|
||||
pushd build
|
||||
%make_build check
|
||||
|
||||
popd
|
||||
|
||||
%files
|
||||
%{_bindir}/h2load
|
||||
@ -122,8 +193,31 @@ export "LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARY_PATH"
|
||||
%{_libdir}/libnghttp2.so
|
||||
%doc README.rst
|
||||
|
||||
%if %{with_mingw}
|
||||
%files -n mingw32-libnghttp2
|
||||
%license COPYING
|
||||
%doc README.rst
|
||||
%{mingw32_bindir}/libnghttp2-14.dll
|
||||
%{mingw32_libdir}/libnghttp2.dll.a
|
||||
%{mingw32_libdir}/pkgconfig/libnghttp2.pc
|
||||
%{mingw32_includedir}/nghttp2/
|
||||
%{mingw32_datadir}/nghttp2/
|
||||
|
||||
%files -n mingw64-libnghttp2
|
||||
%license COPYING
|
||||
%doc README.rst
|
||||
%{mingw64_bindir}/libnghttp2-14.dll
|
||||
%{mingw64_libdir}/libnghttp2.dll.a
|
||||
%{mingw64_libdir}/pkgconfig/libnghttp2.pc
|
||||
%{mingw64_includedir}/nghttp2/
|
||||
%{mingw64_datadir}/nghttp2/
|
||||
%endif
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Sep 15 2023 Marc-André Lureau <marcandre.lureau@redhat.com> - 1.56.0-2
|
||||
- Add MinGW packages. rhbz#2102067
|
||||
|
||||
* Mon Sep 11 2023 Jan Macku <jamacku@redhat.com> 1.56.0-1
|
||||
- update to the latest upstream release
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user