From 075e6e9435ecf34c9a8d0fcc7608aa4ed17e9d083d1d48fbaca466abb869dad1 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 17 Nov 2020 20:20:20 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/c-ares?expand=0&rev=28 --- _multibuild | 1 + c-ares.spec | 55 ++++++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/_multibuild b/_multibuild index 0bc293a..d342409 100644 --- a/_multibuild +++ b/_multibuild @@ -1,3 +1,4 @@ + main tests diff --git a/c-ares.spec b/c-ares.spec index 085ef07..9be64f8 100644 --- a/c-ares.spec +++ b/c-ares.spec @@ -1,13 +1,5 @@ -DEBUG: set_current_pkg receiving %package utils -DEBUG: set_current_pkg returning c-utils, -DEBUG: set_current_pkg receiving %package -n libcares2 -DEBUG: set_current_pkg returning libcares2, -DEBUG: set_current_pkg receiving %package devel -DEBUG: set_current_pkg returning c-devel, -DEBUG: set_current_pkg receiving %prep -DEBUG: set_current_pkg returning c, # -# spec file for package c +# spec file for package c-ares # # Copyright (c) 2020 SUSE LLC # @@ -25,24 +17,37 @@ DEBUG: set_current_pkg returning c, %global flavor @BUILD_FLAVOR@%{nil} -%if "%{flavor}" == "tests" -%define psuffix -tests -%bcond_without tests -%else -%bcond_with tests + +%if "%{flavor}" == "%{nil}" +ExclusiveArch: do_not_build %endif -%define pname c-ares + +%if "%{flavor}" == "tests" +%define pname c-ares-tests +%bcond_without tests +%endif + +%if "%{flavor}" == "main" +%define pname c-ares +%bcond_with tests +%endif + %define sonum 2 %define libname libcares%{sonum} -Name: %{pname}%{?psuffix} + +%if 0%{!?cmake_build:1} +%define cmake_build make -O VERBOSE=1 %{?_smp_mflags} +%endif + +Name: %{pname} Version: 1.17.0 Release: 0 Summary: Library for asynchronous name resolves License: MIT URL: https://c-ares.haxx.se/ -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 +Source0: http://c-ares.haxx.se/download/c-ares-%{version}.tar.gz +Source1: http://c-ares.haxx.se/download/c-ares-%{version}.tar.gz.asc +Source3: c-ares.keyring Source4: baselibs.conf Source5: libcares.pc.cmake Source6: c-ares-config.cmake.in @@ -97,22 +102,20 @@ by Greg Hudson at MIT. This package provides the development libraries and headers needed to build packages that depend on c-ares. + %prep -%autosetup -p1 -n %{pname}-%{version} +%autosetup -p1 -n c-ares-%{version} cp %{S:5} %{S:6} . -# 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 + %cmake \ %if %{with tests} -DCARES_BUILD_TESTS:BOOL=ON \ %endif %{nil} -make -O VERBOSE=1 %{?_smp_mflags} +%cmake_build %install %if !%{with tests} @@ -122,7 +125,7 @@ make -O VERBOSE=1 %{?_smp_mflags} %if %{with tests} %check pushd build -make -O VERBOSE=1 %{?_smp_mflags} -C test +%cmake_build -C test ./bin/arestest %endif