Correctly build with new cmake macros

This commit is contained in:
Andreas Schneider 2020-08-05 15:02:50 +02:00
parent b47e2c96de
commit 3bd642632b

View File

@ -1,6 +1,6 @@
Name: cmocka
Version: 1.1.5
Release: 6%{?dist}
Release: 7%{?dist}
License: ASL 2.0
Summary: An elegant unit testing framework for C with support for mock objects
@ -89,32 +89,22 @@ Development headers for the cmocka unit testing library.
# Disable LTO
%define _lto_cflags %{nil}
if test ! -e "obj"; then
mkdir obj
fi
pushd obj
%cmake \
-DWITH_STATIC_LIB=ON \
-DWITH_CMOCKERY_SUPPORT=ON \
-DUNIT_TESTING=ON \
%{_builddir}/%{name}-%{version}
-DUNIT_TESTING=ON
make %{?_smp_mflags} VERBOSE=1
make docs
popd
%cmake_build
%__cmake --build %{__cmake_builddir} --target docs
%install
pushd obj
make DESTDIR=%{buildroot} install
popd
%cmake_install
ln -s libcmocka.so %{buildroot}%{_libdir}/libcmockery.so
%ldconfig_scriptlets -n libcmocka
%check
pushd obj
ctest --output-on-failure
popd
%ctest
%files -n libcmocka
%doc AUTHORS README.md ChangeLog
@ -125,7 +115,7 @@ popd
%{_libdir}/libcmocka-static.a
%files -n libcmocka-devel
%doc obj/doc/html
%doc %{__cmake_builddir}/doc/html
%{_includedir}/cmocka.h
%{_includedir}/cmocka_pbc.h
%{_includedir}/cmockery/cmockery.h
@ -137,6 +127,9 @@ popd
%{_libdir}/cmake/cmocka/cmocka-config.cmake
%changelog
* Wed Aug 05 2020 Andreas Schneider <asn@redhat.com> - 1.1.5-7
- Correctly build with new cmake macros
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.5-6
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild