Browse code

add cmocka

Change-Id: I3806b22eef0b8307bc922c82c506d58a11965a83
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5313
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Priyesh Padmavilasom authored on 2018/06/30 07:47:33
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,50 @@
0
+Summary:       unit testing framework for C
1
+Name:          cmocka
2
+Version:       1.1.1
3
+Release:       1%{?dist}
4
+Group:         Development/Libraries
5
+Vendor:        VMware, Inc.
6
+License:       Apache 2.0
7
+URL:           https://cmocka.org/
8
+Source0:       https://cmocka.org/files/1.1/%{name}-%{version}.tar.xz
9
+%define sha1 cmocka=6e872df60804462c3ee1eeb7e9a15538874bca49
10
+Distribution:  Photon
11
+BuildRequires: cmake
12
+
13
+%description
14
+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.
15
+
16
+%prep
17
+%setup
18
+
19
+%build
20
+mkdir build
21
+cd build
22
+cmake \
23
+    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
24
+    ..
25
+make
26
+
27
+%install
28
+cd build
29
+make DESTDIR=%{buildroot} install
30
+
31
+%post
32
+
33
+    /sbin/ldconfig
34
+
35
+    # First argument is 1 => New Installation
36
+    # First argument is 2 => Upgrade
37
+
38
+%clean
39
+rm -rf %{buildroot}/*
40
+
41
+%files
42
+%exclude %{_libdir}/cmake
43
+%{_libdir}/libcmocka.*
44
+%{_libdir}/pkgconfig/cmocka.pc
45
+%{_includedir}/*
46
+
47
+%changelog
48
+*  Fri Jun 29 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1.1-1
49
+-  Initial