File mingw32-enet.spec of Package mingw32-enet

#
# spec file for package mingw32-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 mingw32-libenet

Name:           mingw32-%{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:         mingw32-enet-fix-static-lib-dest.patch
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-cmake
BuildRequires:  mingw32-cross-pkg-config
%_mingw32_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 mingw32-%{realname}-devel
Summary:        Development files for libenet
Group:          Development/Libraries/C and C++
Requires:       %{lname} = %{version}

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

%_mingw32_debug_package

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

%build
%{_mingw32_cmake} \
  -DBUILD_SHARED_LIBS=ON \
  -DENET_DLL=ON
%{_mingw32_cmake_build}

%install
%{_mingw32_cmake_install}

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

%files -n mingw32-%{realname}-devel
%license LICENSE
%{_mingw32_includedir}/enet
%{_mingw32_libdir}/libenet.dll.a

%changelog
openSUSE Build Service is sponsored by