Use libcmocka instead of libatf

Upstream no longer ships bundled libatf library and no longer uses ATF
in sources. kyua and cmocka are mandatory for unit tests now. Removes
--with KYUA, use --with UNITTEST on different builds when cmocka and
kyua are available.
This commit is contained in:
Petr Menšík 2019-03-14 11:41:44 +01:00
parent bcfdb893b9
commit 395fbedb17

View File

@ -8,7 +8,6 @@
# bcond_without is built by default, unless --without X is passed
# bcond_with is built only when --with X is passed to build
%bcond_without UNITTEST
%bcond_with SYSTEMTEST
%bcond_without SDB
%bcond_without GSSTSIG
@ -21,10 +20,10 @@
%bcond_without DNSTAP
%bcond_with DLZ
%bcond_without EXPORT_LIBS
%if 0%{?fedora} >= 17
%bcond_without KYUA
%if 0%{?fedora} >= 28
%bcond_without UNITTEST
%else
%bcond_with KYUA
%bcond_with UNITTEST
%endif
%{?!bind_uid: %global bind_uid 25}
@ -180,12 +179,9 @@ BuildRequires: findutils sed
BuildRequires: openldap-devel, libpq-devel, sqlite-devel, mariadb-connector-c-devel
BuildRequires: libdb-devel
%endif
%if %{with KYUA}
%if %{with UNITTEST}
# make unit dependencies
BuildRequires: libatf-c-devel kyua
%else
# shipped atf library requires c++
BuildRequires: gcc-c++
BuildRequires: libcmocka-devel kyua
%endif
%if %{with PKCS11}
BuildRequires: softhsm
@ -591,14 +587,6 @@ done
cp -Tuav bin/tests "%{1}/bin/tests/" \
cp -uv version "%{1}" \
%if %{with KYUA}
# Use system installed libatf-c library with kyua tool
ATF_PATH=/usr
%else
# Disable tests, no longer shipped inside
ATF_PATH=no
%endif
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE"
export STD_CDEFINES="$CPPFLAGS"
@ -665,7 +653,7 @@ export LIBDIR_SUFFIX
--enable-dnstap \
%endif
%if %{with UNITTEST}
--with-atf=${ATF_PATH} \
--with-cmocka \
%endif
--enable-fixed-rrset \
--with-docbook-xsl=%{_datadir}/sgml/docbook/xsl-stylesheets \
@ -737,7 +725,7 @@ export LIBDIR_SUFFIX
--disable-isc-spnego \
%endif
%if %{with UNITTEST}
--with-atf=${ATF_PATH} \
--with-cmocka \
%endif
--enable-fixed-rrset \
--disable-rpz-nsip \