File mingw64-c-ares.spec of Package mingw64-c-ares

#
# spec file for package mingw64-c-ares
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 pkg_name c-ares
Name:           mingw64-c-ares
Version:        1.34.5
Release:        0
Summary:        MinGW port of asynchronous name resolver library
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://c-ares.org/
Source:         https://github.com/c-ares/c-ares/releases/download/v%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires:  autoconf
BuildRequires:  libtool
BuildRequires:  mingw64-cross-binutils
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-pkg-config
%_mingw64_package_header_debug
BuildArch:      noarch

%description
c-ares is a C library that performs DNS requests and name resolution
asynchronously.

%package -n mingw64-libcares2
Summary:        Asynchronous name resolution library
Group:          System/Libraries

%description -n mingw64-libcares2
c-ares is a C library that performs DNS requests and name resolution
asynchronously.

%package devel
Summary:        Headers for c-ares, an asynchronous name resolution library
Group:          Development/Libraries/C and C++
Obsoletes:      mingw64-libcares2-devel < %{version}-%{release}
Provides:       mingw64-libcares2-devel = %{version}-%{release}

%description devel
c-ares is a C library that performs DNS requests and name resolution
asynchronously.

%_mingw64_debug_package

%prep
%autosetup -n %{pkg_name}-%{version}

%build
# I think there's a bug in the configure script where, if
# cross-compiling, it cannot correctly determine the target executable
# extension (ie. .exe).  As a result it doesn't correctly detect that
# the target is Windows and so tries to use Unix-specific functions
# which don't exist.  In any case we can work around this by forcing
# the extension via this export.
#   - RWMJ 2008-09-30
export config_TARGET_EXEEXT=.exe

echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw64_cache}
%{_mingw64_configure} --enable-shared --disable-static \
	--disable-tcl --disable-readline
%{_mingw64_make} %{?_smp_mflags} || %{_mingw64_make}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}

%files -n mingw64-libcares2
%{_mingw64_bindir}/libcares-2.dll

%files devel
%{_mingw64_mandir}/man3/ares_*
%{_mingw64_libdir}/libcares.dll.a
%{_mingw64_libdir}/pkgconfig/libcares.pc
%{_mingw64_includedir}/*.h

%changelog
openSUSE Build Service is sponsored by