switch to cmake so we get cmake helper files, bz1687844

This commit is contained in:
Tom Callaway 2019-03-12 14:13:10 -04:00
parent a9edfcee9c
commit 4f75e1c62e
1 changed files with 28 additions and 3 deletions

View File

@ -1,18 +1,22 @@
%global use_cmake 1
Summary: A library that performs asynchronous DNS operations
Name: c-ares
Version: 1.15.0
Release: 2%{?dist}
Release: 3%{?dist}
License: MIT
URL: http://c-ares.haxx.se/
Source0: http://c-ares.haxx.se/download/%{name}-%{version}.tar.gz
# The license can be obtained at http://c-ares.haxx.se/license.html
Source1: LICENSE
Patch0: 0001-Use-RPM-compiler-options.patch
%if %{use_cmake}
BuildRequires: cmake
%else
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%endif
%description
c-ares is a C library that performs DNS requests and name resolves
@ -36,9 +40,16 @@ cp %{SOURCE1} .
f=CHANGES ; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
%build
# autoreconf -if
# %%configure --enable-shared --disable-static \
# --disable-dependency-tracking
%if %{use_cmake}
%{cmake} -DCMAKE_INSTALL_LIBDIR:PATH="%{_libdir}" -DCARES_BUILD_TOOLS:BOOL=OFF .
%else
autoreconf -if
%configure --enable-shared --disable-static \
--disable-dependency-tracking
%endif
%{__make} %{?_smp_mflags}
%install
@ -46,6 +57,14 @@ rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%{_libdir}/libcares.la
%if %{use_cmake}
# When we used autotooling, we got man pages installed automagically
# but no cmake helpers were generated.
# Now, we use cmake, so we have to copy the man pages manually.
mkdir -p %{buildroot}%{_mandir}/man3
cp -a ares_*.3 %{buildroot}%{_mandir}/man3/
%endif
%ldconfig_scriptlets
%files
@ -59,10 +78,16 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libcares.la
%{_includedir}/ares_rules.h
%{_includedir}/ares_version.h
%{_libdir}/*.so
%if %{use_cmake}
%{_libdir}/cmake/c-ares/
%endif
%{_libdir}/pkgconfig/libcares.pc
%{_mandir}/man3/ares_*
%changelog
* Tue Mar 12 2019 Tom Callaway <spot@fedoraproject.org> - 1.15.0-3
- use cmake to build so we get cmake helpers (bz1687844)
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild