File mingw64-ngtcp2.spec of Package mingw64-ngtcp2

#
# spec file for package mingw64-ngtcp2
#
# Copyright (c) 2026, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define sover 16
%global gnutls_sover 8
%define realname ngtcp2
%define libname mingw64-lib%{realname}-%{sover}
Name:           mingw64-%{realname}
Version:        1.19.0
Release:        0
Summary:        Implementation of the IETF QUIC protocol
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://nghttp2.org/ngtcp2
Source0:        https://github.com/ngtcp2/ngtcp2/releases/download/v%{version}/ngtcp2-%{version}.tar.xz
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-pkgconf
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-libgnutls-devel
BuildRequires:  mingw64-brotli-devel
BuildRequires:  mingw64-nghttp3-devel
%_mingw64_package_header_debug
BuildArch:      noarch

%description
ngtcp2 is an effort to implement RFC9000 QUIC protocol.

%package -n %{libname}
Summary:        Shared library for ngtcp2
Group:          System/Libraries

%description -n %{libname}
Shared C libraries for implementation of QUIC Protocol.

%package devel
Summary:        Development files for ngtcp2
Group:          Development/Languages/C and C++
Requires:       %{libname} = %{version}

%description devel
Development files for usage with libngtcp2, which implements
QUIC Protocol.

%_mingw64_debug_package

%prep
%autosetup -p1 -n %{realname}-%{version}

%build
%{_mingw64_cmake} \
  -DENABLE_LIB_ONLY=ON \
  -DENABLE_STATIC_LIB=OFF \
  -DCMAKE_DLL_NAME_WITH_SOVERSION=ON \
  -DENABLE_GNUTLS=ON \
  -DENABLE_OPENSSL=OFF
%{_mingw64_cmake_build}

%install
%{_mingw64_cmake_install}
rm -v %{buildroot}%{_mingw64_docdir}/ngtcp2/README.rst

%files -n %{libname}
%license COPYING
%{_mingw64_bindir}/libngtcp2-%{sover}.dll
%{_mingw64_bindir}/libngtcp2_crypto_gnutls-%{gnutls_sover}.dll

%files devel
%license COPYING
%doc README.rst
%{_mingw64_includedir}/ngtcp2
%{_mingw64_libdir}/libngtcp2.dll.a
%{_mingw64_libdir}/libngtcp2_crypto_gnutls.dll.a
%{_mingw64_libdir}/pkgconfig/libngtcp2.pc
%{_mingw64_libdir}/pkgconfig/libngtcp2_crypto_gnutls.pc
%{_mingw64_libdir}/cmake/ngtcp2

%changelog
openSUSE Build Service is sponsored by