From e3598846b4d63ca8f6f394cdd985caed9932410f8e5fb3763ae2b10db78b0f82 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 15 Jul 2015 08:33:23 +0000 Subject: [PATCH 1/2] Accepting request 316828 from home:scarabeus_iv:branches:devel:libraries:c_c++ - Use properly %cmake macro to build nicely with all the linker/cflags - Use proper Url and Source - Properly fails on crashing tests instead of finishing build - Enable cmockery support OBS-URL: https://build.opensuse.org/request/show/316828 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/cmocka?expand=0&rev=27 --- cmocka.changes | 8 +++++++ cmocka.spec | 59 +++++++++++++++++++------------------------------- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/cmocka.changes b/cmocka.changes index 158e2fe..c859ca7 100644 --- a/cmocka.changes +++ b/cmocka.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jul 14 14:07:14 UTC 2015 - tchvatal@suse.com + +- Use properly %cmake macro to build nicely with all the linker/cflags +- Use proper Url and Source +- Properly fails on crashing tests instead of finishing build +- Enable cmockery support + ------------------------------------------------------------------- Thu Mar 12 14:57:24 UTC 2015 - asn@cryptomilk.org diff --git a/cmocka.spec b/cmocka.spec index 9225cdf..ca09a3f 100644 --- a/cmocka.spec +++ b/cmocka.spec @@ -16,21 +16,18 @@ # -BuildRequires: cmake -BuildRequires: glibc-devel -BuildRequires: pkg-config - Name: cmocka Version: 1.0.1 Release: 0 -# Summary: Lightweight library to simplify and generalize unit tests for C License: Apache-2.0 Group: Productivity/Networking/Other -Url: http://open.cryptomilk.org/cmocka -# -Source0: %{name}-%{version}.tar.xz +Url: http://cmocka.org +Source0: https://cmocka.org/files/1.0/%{name}-%{version}.tar.xz Source1: baselibs.conf +BuildRequires: cmake +BuildRequires: glibc-devel +BuildRequires: pkg-config BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -75,7 +72,6 @@ Features: Also, CMocka tries to avoid the use of some of the newer features of C compilers. - %package -n libcmocka-devel Summary: Development headers for the cmocka library Group: Development/Libraries/C and C++ @@ -98,42 +94,28 @@ Static cmocka unit testing library. %setup -q %build -if test ! -e "obj"; then - mkdir obj -fi -pushd obj -cmake \ - -DCMAKE_C_FLAGS:STRING="%{optflags}" \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DWITH_STATIC_LIB=ON \ -%if %{_lib} == lib64 - -DLIB_SUFFIX=64 \ -%endif - -DUNIT_TESTING=ON \ - %{_builddir}/%{name}-%{version} +%cmake \ + -DWITH_STATIC_LIB=ON \ + -DWITH_CMOCKERY_SUPPORT=ON \ + -DUNIT_TESTING=ON -%__make %{?_smp_mflags} VERBOSE=1 -popd +make %{?_smp_mflags} %install -pushd obj -%makeinstall -popd +%cmake_install %check -pushd obj -%__make test || cat Testing/Temporary/LastTest.log +pushd build +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +make %{?_smp_mflags} test || { + cat Testing/Temporary/LastTest.log; + exit 1; +} popd -%post -n libcmocka0 -/sbin/ldconfig +%post -n libcmocka0 -p /sbin/ldconfig -%postun -n libcmocka0 -/sbin/ldconfig - -%clean -%{__rm} -rf %{buildroot} +%postun -n libcmocka0 -p /sbin/ldconfig %files -n libcmocka0 %defattr(-,root,root) @@ -144,6 +126,9 @@ popd %defattr(-,root,root) %{_includedir}/cmocka.h %{_includedir}/cmocka_pbc.h +%dir %{_includedir}/cmockery +%{_includedir}/cmockery/cmockery.h +%{_includedir}/cmockery/pbc.h %{_libdir}/libcmocka.so %{_libdir}/pkgconfig/cmocka.pc %dir %{_libdir}/cmake/cmocka From 95ed508c1c0c92ba76da6a5e97cb2ea65769798c30696f62553044789a94856e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 15 Jul 2015 08:37:28 +0000 Subject: [PATCH 2/2] Do not turn of rpath support OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/cmocka?expand=0&rev=28 --- cmocka.changes | 5 +++++ cmocka.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmocka.changes b/cmocka.changes index c859ca7..73a7625 100644 --- a/cmocka.changes +++ b/cmocka.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 15 08:37:06 UTC 2015 - asn@cryptomilk.org + +- Do not turn of rpath support + ------------------------------------------------------------------- Tue Jul 14 14:07:14 UTC 2015 - tchvatal@suse.com diff --git a/cmocka.spec b/cmocka.spec index ca09a3f..df2bf10 100644 --- a/cmocka.spec +++ b/cmocka.spec @@ -95,6 +95,7 @@ Static cmocka unit testing library. %build %cmake \ + -DCMAKE_SKIP_RPATH=OFF \ -DWITH_STATIC_LIB=ON \ -DWITH_CMOCKERY_SUPPORT=ON \ -DUNIT_TESTING=ON @@ -106,7 +107,6 @@ make %{?_smp_mflags} %check pushd build -export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} make %{?_smp_mflags} test || { cat Testing/Temporary/LastTest.log; exit 1;