2018-02-20 10:24:29 +01:00
|
|
|
#
|
2020-09-11 09:54:43 +02:00
|
|
|
# spec file for package c
|
2018-02-20 10:24:29 +01:00
|
|
|
#
|
2020-07-09 08:43:45 +02:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2018-02-20 10:24:29 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-02-13 17:25:34 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-02-20 10:24:29 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-09-11 09:42:12 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "tests"
|
|
|
|
%define psuffix -tests
|
2020-09-11 09:54:43 +02:00
|
|
|
%bcond_without tests
|
|
|
|
%else
|
2020-09-11 09:42:12 +02:00
|
|
|
%bcond_with tests
|
|
|
|
%endif
|
|
|
|
%define pname c-ares
|
2020-01-07 19:03:05 +01:00
|
|
|
%define sonum 2
|
|
|
|
%define libname libcares%{sonum}
|
2020-09-11 09:42:12 +02:00
|
|
|
Name: %{pname}%{?psuffix}
|
2020-07-09 08:43:45 +02:00
|
|
|
Version: 1.16.1
|
2018-02-20 10:24:29 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Library for asynchronous name resolves
|
|
|
|
License: MIT
|
2019-11-15 08:59:48 +01:00
|
|
|
URL: https://c-ares.haxx.se/
|
2020-09-11 09:42:12 +02:00
|
|
|
Source0: http://c-ares.haxx.se/download/%{pname}-%{version}.tar.gz
|
|
|
|
Source1: http://c-ares.haxx.se/download/%{pname}-%{version}.tar.gz.asc
|
|
|
|
Source3: %{pname}.keyring
|
2018-02-20 10:24:29 +01:00
|
|
|
Source4: baselibs.conf
|
|
|
|
Patch0: 0001-Use-RPM-compiler-options.patch
|
2019-02-13 17:25:34 +01:00
|
|
|
Patch1: disable-live-tests.patch
|
2020-01-07 19:03:05 +01:00
|
|
|
BuildRequires: cmake
|
2018-02-20 10:24:29 +01:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libtool
|
2020-02-04 12:49:24 +01:00
|
|
|
# Needed for getservbyport_r function to work properly.
|
|
|
|
BuildRequires: netcfg
|
2018-02-20 10:24:29 +01:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2020-01-07 19:03:05 +01:00
|
|
|
%package utils
|
|
|
|
Summary: Tools for asynchronous name resolves
|
|
|
|
|
|
|
|
%description utils
|
|
|
|
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.
|
|
|
|
|
|
|
|
This package provides some tools that make use of c-ares.
|
|
|
|
|
|
|
|
%package -n %{libname}
|
2018-02-20 10:35:11 +01:00
|
|
|
Summary: Library for asynchronous name resolves
|
2020-02-04 12:49:24 +01:00
|
|
|
# Needed for getservbyport_r function to work properly.
|
|
|
|
Requires: netcfg
|
2018-02-20 10:35:11 +01:00
|
|
|
|
|
|
|
%description -n %{libname}
|
|
|
|
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.
|
|
|
|
|
2020-01-07 19:03:05 +01:00
|
|
|
This package provides the shared libraries for c-ares.
|
|
|
|
|
2018-02-20 10:35:11 +01:00
|
|
|
%package devel
|
2020-01-07 19:03:05 +01:00
|
|
|
Summary: Development files for %{name}
|
2018-02-20 10:35:11 +01:00
|
|
|
Requires: %{libname} = %{version}
|
2018-02-20 10:24:29 +01:00
|
|
|
Requires: glibc-devel
|
2018-02-20 10:35:11 +01:00
|
|
|
Provides: libcares-devel = %{version}
|
|
|
|
Obsoletes: libcares-devel < %{version}
|
2018-02-20 10:24:29 +01:00
|
|
|
|
2018-02-20 10:35:11 +01:00
|
|
|
%description devel
|
2018-02-20 10:24:29 +01:00
|
|
|
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.
|
|
|
|
|
2020-01-07 19:03:05 +01:00
|
|
|
This package provides the development libraries and headers needed
|
|
|
|
to build packages that depend on c-ares.
|
|
|
|
|
2018-02-20 10:24:29 +01:00
|
|
|
%prep
|
2020-09-11 09:42:12 +02:00
|
|
|
%autosetup -p1 -n %{pname}-%{version}
|
2018-02-20 10:24:29 +01:00
|
|
|
|
|
|
|
# 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
|
2020-01-07 19:03:05 +01:00
|
|
|
%cmake \
|
2020-09-11 09:54:43 +02:00
|
|
|
-DCARES_STATIC:BOOL=OFF \
|
|
|
|
-DCARES_SHARED:BOOL=ON \
|
|
|
|
-DCARES_INSTALL:BOOL=ON \
|
|
|
|
-DCARES_BUILD_TOOLS:BOOL=ON \
|
|
|
|
%if %{with tests}
|
|
|
|
-DCARES_STATIC:BOOL=ON \
|
|
|
|
-DCARES_BUILD_TESTS:BOOL=ON \
|
|
|
|
%endif
|
|
|
|
%{nil}
|
2020-09-11 09:42:12 +02:00
|
|
|
%cmake_build
|
2018-02-20 10:24:29 +01:00
|
|
|
|
|
|
|
%install
|
2020-09-11 09:54:43 +02:00
|
|
|
%if !%{with tests}
|
2020-01-07 19:03:05 +01:00
|
|
|
%cmake_install
|
|
|
|
install -m 644 -Dt %{buildroot}%{_mandir}/man1/ *.1
|
|
|
|
install -m 644 -Dt %{buildroot}%{_mandir}/man3/ *.3
|
2020-07-09 08:43:45 +02:00
|
|
|
# Tests require static lib so lets remove it so it does not get in package
|
|
|
|
find %{buildroot} -type f \( -name "*.la" -o -name "*.a" \) -delete -print
|
2020-09-11 09:42:12 +02:00
|
|
|
%endif
|
2018-02-20 10:24:29 +01:00
|
|
|
|
2020-09-11 09:54:43 +02:00
|
|
|
%if %{with tests}
|
2020-01-07 19:03:05 +01:00
|
|
|
%check
|
|
|
|
pushd build
|
2020-07-09 08:43:45 +02:00
|
|
|
%make_build -C test
|
2020-01-07 19:03:05 +01:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib
|
|
|
|
./bin/arestest
|
2020-09-11 09:42:12 +02:00
|
|
|
%endif
|
2020-01-07 19:03:05 +01:00
|
|
|
|
2020-09-11 09:54:43 +02:00
|
|
|
%if !%{with tests}
|
2020-01-07 19:03:05 +01:00
|
|
|
%post -n %{libname} -p /sbin/ldconfig
|
2018-02-20 10:35:11 +01:00
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
2018-02-20 10:24:29 +01:00
|
|
|
|
2020-01-07 19:03:05 +01:00
|
|
|
%files utils
|
|
|
|
%license LICENSE.md
|
|
|
|
%{_bindir}/acountry
|
|
|
|
%{_bindir}/adig
|
|
|
|
%{_bindir}/ahost
|
2020-07-09 08:43:45 +02:00
|
|
|
%{_mandir}/man1/acountry.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/adig.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/ahost.1%{?ext_man}
|
2020-01-07 19:03:05 +01:00
|
|
|
|
2018-02-20 10:35:11 +01:00
|
|
|
%files -n %{libname}
|
|
|
|
%license LICENSE.md
|
2018-02-20 10:24:29 +01:00
|
|
|
%{_libdir}/libcares.so.2*
|
|
|
|
|
2018-02-20 10:35:11 +01:00
|
|
|
%files devel
|
2020-01-07 19:03:05 +01:00
|
|
|
%license LICENSE.md
|
2018-02-20 10:24:29 +01:00
|
|
|
%{_libdir}/libcares.so
|
|
|
|
%{_includedir}/*.h
|
2020-07-09 08:43:45 +02:00
|
|
|
%{_mandir}/man3/ares_*.3%{?ext_man}
|
2018-02-20 10:24:29 +01:00
|
|
|
%{_libdir}/pkgconfig/libcares.pc
|
2020-01-07 19:03:05 +01:00
|
|
|
%{_libdir}/cmake/c-ares/
|
2020-09-11 09:42:12 +02:00
|
|
|
%endif
|
2018-02-20 10:24:29 +01:00
|
|
|
|
|
|
|
%changelog
|