File libcares2.spec of Package libcares2

#
# spec file for package libcares2
#
# 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:           libcares2
Version:        1.10.0
Release:        0
Summary:        Library for asynchronous name resolves
License:        MIT
Group:          Development/Libraries/C and C++
Url:            http://c-ares.haxx.se/
Source0:        http://c-ares.haxx.se/download/%{pkg_name}-%{version}.tar.gz
Source1:        http://c-ares.haxx.se/download/%{pkg_name}-%{version}.tar.gz.asc
Source3:        libcares2.keyring
Source4:        baselibs.conf
Patch0:         cares-1.9.1-ocloexec.patch
Patch1:         0001-Use-RPM-compiler-options.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gpg-offline
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
c-ares is a C library that performs DNS requests and name resolves
asynchronously. c-ares is a fork of the library named 'ares', written
by Greg Hudson at MIT.

%package -n libcares-devel
Summary:        Library for asynchronous name resolves
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       glibc-devel

%description -n libcares-devel
c-ares is a C library that performs DNS requests and name resolves
asynchronously. c-ares is a fork of the library named 'ares', written
by Greg Hudson at MIT.

%prep
%if 0%{?suse_version} >= 1230
%gpg_verify %{SOURCE1}
%endif
%setup -q -n %{pkg_name}-%{version}
%patch0 -p1
%patch1 -p1

# Remove bogus cflags checking
sed -i -e '/XC_CHECK_BUILD_FLAGS/d' configure.ac
sed -i -e '/XC_CHECK_USER_FLAGS/d' m4/xc-cc-check.m4

%build
autoreconf -fiv
%configure \
	--enable-symbol-hiding \
	--enable-nonblocking \
	--enable-shared \
	--disable-static \
	--with-pic
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
find %{buildroot} -type f -name "*.la" -delete -print

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_libdir}/libcares.so.2*

%files -n libcares-devel
%defattr(-,root,root)
%{_libdir}/libcares.so
%{_includedir}/*.h
%{_mandir}/man3/ares_*
%{_libdir}/pkgconfig/libcares.pc

%changelog
openSUSE Build Service is sponsored by