File mingw64-libmaxminddb.spec of Package mingw64-libmaxminddb

#
# spec file for package mingw64-libmaxminddb
#
# 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 sover 0
%define realname libmaxminddb
%define libname mingw64-lib%{realname}%{sover}
Name:           mingw64-%{realname}
Version:        1.12.2
Release:        0
Summary:        C library for the MaxMind DB file format
License:        Apache-2.0
URL:            https://dev.maxmind.com/
Source:         https://github.com/maxmind/libmaxminddb/releases/download/%{version}/%{realname}-%{version}.tar.gz
BuildRequires:  mingw64-cross-gcc-c++
%_mingw64_package_header_debug
BuildArch:      noarch

%description
The libmaxminddb library provides a C library for reading MaxMind DB
files, including the GeoIP2 databases from MaxMind. This is a
custom binary format designed to facilitate fast lookups of IP
addresses while allowing for great flexibility in the type of
data associated with an address.

%package -n %{libname}
Summary:        C library for the MaxMind DB file format
Group:          System/Libraries

%description -n %{libname}
The libmaxminddb library provides a C library for reading MaxMind DB
files, including the GeoIP2 databases from MaxMind. This is a
custom binary format designed to facilitate fast lookups of IP
addresses while allowing for great flexibility in the type of
data associated with an address.

%package devel
Summary:        Development files for the MaxMind DB file format library
Group:          Development/Languages/C and C++
Requires:       %{libname} = %{version}

%description devel
The libmaxminddb library provides a C library for reading MaxMind DB
files, including the GeoIP2 databases from MaxMind. This is a
custom binary format designed to facilitate fast lookups of IP
addresses while allowing for great flexibility in the type of
data associated with an address.

This package contains the development files for %{name}.

%_mingw64_debug_package

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

%build
%{_mingw64_configure} --disable-static
%{_mingw64_make} %{?_smp_mflags}

%install
%{_mingw64_make_install}

%files -n %{libname}
%{_mingw64_bindir}/libmaxminddb-%{sover}.dll

%files devel
%doc Changes.md NOTICE README.md doc/mmdblookup.md doc/libmaxminddb.md
%license LICENSE
%{_mingw64_bindir}/mmdblookup.exe
%{_mingw64_mandir}/man1/mmdblookup.1%{?ext_man}
%{_mingw64_mandir}/man3/MMDB_*3%{?ext_man}
%{_mingw64_mandir}/man3/libmaxminddb.3%{?ext_man}
%{_mingw64_includedir}/maxminddb.h
%{_mingw64_includedir}/maxminddb_config.h
%{_mingw64_libdir}/libmaxminddb.dll.a
%{_mingw64_libdir}/pkgconfig/libmaxminddb.pc

%changelog
openSUSE Build Service is sponsored by