File mingw64-enet.spec of Package mingw64-enet

#
# spec file for package mingw64-enet
#
# Copyright (c) 2025, 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 realname enet
%define lname mingw64-libenet

Name:           mingw64-%{realname}
Version:        1.3.18
Release:        0
Summary:        Network Communication Layer on Top of UDP
License:        MIT
Group:          Productivity/Networking/Other
URL:            http://enet.bespin.org/
Source:         http://enet.bespin.org/download/%{realname}-%{version}.tar.gz
Patch0:         0001-CMake-Enable-shared-builds-242.patch
Patch1:         mingw64-enet-fix-static-lib-dest.patch
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-cmake
BuildRequires:  mingw64-cross-pkg-config
%_mingw64_package_header_debug
BuildArch:      noarch

%description
ENet provides a relatively thin network communication layer on top of
UDP (User Datagram Protocol). The primary feature it provides is
optional reliable, in-order delivery of packets.

ENet omits certain higher level networking features such as authentication,
lobbying, server discovery, encryption, or other similar tasks that are
particularly application specific so that the library remains flexible,
portable, and embeddable.

%package -n %{lname}
Summary:        Library files for libenet
Group:          System/Libraries

%description -n %{lname}
The libenet7 package contains libraries for libenet.

%package -n mingw64-%{realname}-devel
Summary:        Development files for libenet
Group:          Development/Libraries/C and C++
Requires:       %{lname} = %{version}

%description -n mingw64-%{realname}-devel
The mingw64-%{realname}-devel package contains libraries and header files for
developing applications that use libenet.

%_mingw64_debug_package

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

%build
%{_mingw64_cmake} \
  -DBUILD_SHARED_LIBS=ON \
  -DENET_DLL=ON
%{_mingw64_cmake_build}

%install
%{_mingw64_cmake_install}

%files -n %lname
%{_mingw64_bindir}/libenet.dll

%files -n mingw64-%{realname}-devel
%license LICENSE
%{_mingw64_includedir}/enet
%{_mingw64_libdir}/libenet.dll.a

%changelog
openSUSE Build Service is sponsored by