2013-01-14 11:49:38 +01:00
|
|
|
#
|
2013-01-14 11:50:31 +01:00
|
|
|
# spec file for package cmocka
|
2013-01-14 11:49:38 +01:00
|
|
|
#
|
2015-03-12 15:55:35 +01:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2013-01-14 11:50:31 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2013-01-14 11:49:38 +01:00
|
|
|
|
2013-01-14 11:50:31 +01:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: glibc-devel
|
2014-08-26 15:24:06 +02:00
|
|
|
BuildRequires: pkg-config
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
Name: cmocka
|
2015-03-12 15:55:35 +01:00
|
|
|
Version: 1.0.1
|
2013-01-14 11:50:31 +01:00
|
|
|
Release: 0
|
2013-01-14 11:49:38 +01:00
|
|
|
#
|
2013-01-14 11:50:31 +01:00
|
|
|
Summary: Lightweight library to simplify and generalize unit tests for C
|
2013-01-14 11:49:38 +01:00
|
|
|
License: Apache-2.0
|
|
|
|
Group: Productivity/Networking/Other
|
|
|
|
Url: http://open.cryptomilk.org/cmocka
|
|
|
|
#
|
2013-11-11 14:18:02 +01:00
|
|
|
Source0: %{name}-%{version}.tar.xz
|
2014-09-01 15:57:41 +02:00
|
|
|
Source1: baselibs.conf
|
2013-01-14 11:49:38 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
2015-02-17 10:18:18 +01:00
|
|
|
cmocka is an elegant unit testing framework for C with support for mock
|
|
|
|
objects. It only requires the standard C library, works on a range of computing
|
|
|
|
platforms (including embedded) and with different compilers.
|
|
|
|
|
|
|
|
Features:
|
|
|
|
* Support for mock objects
|
|
|
|
* Only requires the C library
|
|
|
|
* Several supported output formats (Subunit, TAP, jUnit XML)
|
|
|
|
* Fully documented API
|
|
|
|
* Test fixtures
|
|
|
|
* Exception handling for signals (SIGSEGV, SIGILL, ...)
|
|
|
|
* No fork() used
|
|
|
|
* Very well tested
|
|
|
|
* Testing of memory leaks, buffer overflows and underflows.
|
|
|
|
|
|
|
|
Also, CMocka tries to avoid the use of some of the newer features of C
|
|
|
|
compilers.
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
%package -n libcmocka0
|
|
|
|
Summary: Lightweight library to simplify and generalize unit tests for C
|
2013-01-14 11:50:31 +01:00
|
|
|
Group: System/Libraries
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
%description -n libcmocka0
|
2015-02-17 10:18:18 +01:00
|
|
|
cmocka is an elegant unit testing framework for C with support for mock
|
|
|
|
objects. It only requires the standard C library, works on a range of computing
|
|
|
|
platforms (including embedded) and with different compilers.
|
|
|
|
|
|
|
|
Features:
|
|
|
|
* Support for mock objects
|
|
|
|
* Only requires the C library
|
|
|
|
* Several supported output formats (Subunit, TAP, jUnit XML)
|
|
|
|
* Fully documented API
|
|
|
|
* Test fixtures
|
|
|
|
* Exception handling for signals (SIGSEGV, SIGILL, ...)
|
|
|
|
* No fork() used
|
|
|
|
* Very well tested
|
|
|
|
* Testing of memory leaks, buffer overflows and underflows.
|
|
|
|
|
|
|
|
Also, CMocka tries to avoid the use of some of the newer features of C
|
|
|
|
compilers.
|
|
|
|
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
%package -n libcmocka-devel
|
|
|
|
Summary: Development headers for the cmocka library
|
2013-01-14 11:50:31 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2015-02-17 10:18:18 +01:00
|
|
|
Requires: cmake
|
2013-01-14 11:49:38 +01:00
|
|
|
Requires: libcmocka0 = %{version}
|
2015-02-17 10:18:18 +01:00
|
|
|
Requires: pkg-config
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
%description -n libcmocka-devel
|
|
|
|
Development headers for the cmocka unit testing library.
|
|
|
|
|
2013-02-05 11:51:47 +01:00
|
|
|
%package -n libcmocka-devel-static
|
|
|
|
Summary: Static cmocka library
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: libcmocka-devel = %{version}
|
|
|
|
|
|
|
|
%description -n libcmocka-devel-static
|
|
|
|
Static cmocka unit testing library.
|
|
|
|
|
2013-01-14 11:49:38 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
%build
|
2014-04-11 16:16:47 +02:00
|
|
|
if test ! -e "obj"; then
|
|
|
|
mkdir obj
|
2013-01-14 11:49:38 +01:00
|
|
|
fi
|
2014-04-11 16:16:47 +02:00
|
|
|
pushd obj
|
2013-01-14 11:49:38 +01:00
|
|
|
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
|
2015-02-17 10:18:18 +01:00
|
|
|
-DUNIT_TESTING=ON \
|
2013-01-14 11:49:38 +01:00
|
|
|
%{_builddir}/%{name}-%{version}
|
|
|
|
|
2015-02-17 10:18:18 +01:00
|
|
|
%__make %{?_smp_mflags} VERBOSE=1
|
2015-03-12 20:14:51 +01:00
|
|
|
popd
|
2013-01-14 11:49:38 +01:00
|
|
|
|
|
|
|
%install
|
2014-04-11 16:16:47 +02:00
|
|
|
pushd obj
|
2013-01-14 11:49:38 +01:00
|
|
|
%makeinstall
|
|
|
|
popd
|
|
|
|
|
2015-02-17 10:18:18 +01:00
|
|
|
%check
|
|
|
|
pushd obj
|
|
|
|
%__make test || cat Testing/Temporary/LastTest.log
|
|
|
|
popd
|
|
|
|
|
2013-01-14 11:49:38 +01:00
|
|
|
%post -n libcmocka0
|
|
|
|
/sbin/ldconfig
|
|
|
|
|
|
|
|
%postun -n libcmocka0
|
|
|
|
/sbin/ldconfig
|
|
|
|
|
|
|
|
%clean
|
|
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
|
|
|
%files -n libcmocka0
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc AUTHORS README ChangeLog COPYING
|
|
|
|
%{_libdir}/libcmocka.so.*
|
|
|
|
|
|
|
|
%files -n libcmocka-devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_includedir}/cmocka.h
|
2015-02-17 10:18:18 +01:00
|
|
|
%{_includedir}/cmocka_pbc.h
|
2013-01-14 11:49:38 +01:00
|
|
|
%{_libdir}/libcmocka.so
|
2013-06-05 08:45:25 +02:00
|
|
|
%{_libdir}/pkgconfig/cmocka.pc
|
2014-09-11 17:33:28 +02:00
|
|
|
%dir %{_libdir}/cmake/cmocka
|
|
|
|
%{_libdir}/cmake/cmocka/cmocka-config-version.cmake
|
|
|
|
%{_libdir}/cmake/cmocka/cmocka-config.cmake
|
2013-02-05 11:51:47 +01:00
|
|
|
|
|
|
|
%files -n libcmocka-devel-static
|
|
|
|
%defattr(-,root,root)
|
2013-01-14 11:49:38 +01:00
|
|
|
%{_libdir}/libcmocka.a
|
|
|
|
|
|
|
|
%changelog
|