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