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