SHA256
1
0
forked from pool/c-ares

Accepting request 761665 from home:TheBlackCat:branches:devel:libraries:c_c++

- Switch to cmake-based build.
  Some packages need the cmake build files.

This version runs atest

OBS-URL: https://build.opensuse.org/request/show/761665
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/c-ares?expand=0&rev=15
This commit is contained in:
Tomáš Chvátal 2020-01-07 18:03:05 +00:00 committed by Git OBS Bridge
parent 4b8c0756e2
commit 90605f4d8d
2 changed files with 58 additions and 24 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 6 17:54:05 UTC 2020 - Todd R <toddrme2178@gmail.com>
- Switch to cmake-based build.
Some packages need the cmake build files.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Nov 15 07:59:27 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> Fri Nov 15 07:59:27 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package c-ares # spec file for package c-ares
# #
# Copyright (c) 2019 SUSE LLC. # Copyright (c) 2020 SUSE LLC.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,14 +16,14 @@
# #
%define libname libcares2 %define sonum 2
%define libname libcares%{sonum}
%define realver 1.15.0-20191108 %define realver 1.15.0-20191108
Name: c-ares Name: c-ares
Version: 1.15.0+20191108 Version: 1.15.0+20191108
Release: 0 Release: 0
Summary: Library for asynchronous name resolves Summary: Library for asynchronous name resolves
License: MIT License: MIT
Group: Development/Libraries/C and C++
URL: https://c-ares.haxx.se/ URL: https://c-ares.haxx.se/
#Source0: https://c-ares.haxx.se/daily-snapshot/c-ares-%{realver}.tar.gz #Source0: https://c-ares.haxx.se/daily-snapshot/c-ares-%{realver}.tar.gz
Source0: c-ares-%{realver}.tar.gz Source0: c-ares-%{realver}.tar.gz
@ -33,8 +33,7 @@ Source3: %{name}.keyring
Source4: baselibs.conf Source4: baselibs.conf
Patch0: 0001-Use-RPM-compiler-options.patch Patch0: 0001-Use-RPM-compiler-options.patch
Patch1: disable-live-tests.patch Patch1: disable-live-tests.patch
BuildRequires: autoconf BuildRequires: cmake
BuildRequires: automake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libtool BuildRequires: libtool
BuildRequires: pkgconfig BuildRequires: pkgconfig
@ -44,18 +43,30 @@ 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 asynchronously. c-ares is a fork of the library named 'ares', written
by Greg Hudson at MIT. by Greg Hudson at MIT.
%package -n %{libname} %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}
Summary: Library for asynchronous name resolves Summary: Library for asynchronous name resolves
Group: System/Libraries
%description -n %{libname} %description -n %{libname}
c-ares is a C library that performs DNS requests and name resolves 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 asynchronously. c-ares is a fork of the library named 'ares', written
by Greg Hudson at MIT. by Greg Hudson at MIT.
This package provides the shared libraries for c-ares.
%package devel %package devel
Summary: Library for asynchronous name resolves Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version} Requires: %{libname} = %{version}
Requires: glibc-devel Requires: glibc-devel
Provides: libcares-devel = %{version} Provides: libcares-devel = %{version}
@ -66,6 +77,10 @@ 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 asynchronously. c-ares is a fork of the library named 'ares', written
by Greg Hudson at MIT. by Greg Hudson at MIT.
This package provides the development libraries and headers needed
to build packages that depend on c-ares.
%prep %prep
%autosetup -p1 -n %{name}-%{realver} %autosetup -p1 -n %{name}-%{realver}
@ -74,35 +89,48 @@ sed -i -e '/XC_CHECK_BUILD_FLAGS/d' configure.ac
sed -i -e '/XC_CHECK_USER_FLAGS/d' m4/xc-cc-check.m4 sed -i -e '/XC_CHECK_USER_FLAGS/d' m4/xc-cc-check.m4
%build %build
autoreconf -fiv %cmake \
%configure \ -DCARES_STATIC:BOOL=OFF \
--disable-silent-rules \ -DCARES_SHARED:BOOL=ON \
--enable-symbol-hiding \ -DCARES_INSTALL:BOOL=ON \
--enable-nonblocking \ -DCARES_BUILD_TESTS:BOOL=ON \
--enable-shared \ -DCARES_BUILD_TOOLS:BOOL=ON
--disable-static \
--enable-tests
make %{?_smp_mflags} make %{?_smp_mflags}
%check
make -C test %{?_smp_mflags}
./test/arestest
%install %install
%make_install %cmake_install
install -m 644 -Dt %{buildroot}%{_mandir}/man1/ *.1
install -m 644 -Dt %{buildroot}%{_mandir}/man3/ *.3
find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot} -type f -name "*.la" -delete -print
%post -n %{libname} -p /sbin/ldconfig %check
pushd build
make -C test %{?_smp_mflags}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib
./bin/arestest
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig
%files utils
%license LICENSE.md
%{_bindir}/acountry
%{_bindir}/adig
%{_bindir}/ahost
%{_mandir}/man1/acountry.1%{ext_man}
%{_mandir}/man1/adig.1%{ext_man}
%{_mandir}/man1/ahost.1%{ext_man}
%files -n %{libname} %files -n %{libname}
%license LICENSE.md %license LICENSE.md
%{_libdir}/libcares.so.2* %{_libdir}/libcares.so.2*
%files devel %files devel
%license LICENSE.md
%{_libdir}/libcares.so %{_libdir}/libcares.so
%{_includedir}/*.h %{_includedir}/*.h
%{_mandir}/man3/ares_* %{_mandir}/man3/ares_*.3%{ext_man}
%{_libdir}/pkgconfig/libcares.pc %{_libdir}/pkgconfig/libcares.pc
%{_libdir}/cmake/c-ares/
%changelog %changelog