]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - system boxfort (when released): https://github.com/diacritic/BoxFort | |
3 | # - system nanopb (0.4.5 bundled) | |
4 | # - system libcsptr (when some post-2017 release made): https://github.com/Snaipe/libcsptr | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_without tests # build without tests | |
8 | %bcond_with system_nanopb # system nanopb (tests fail with nanopb 0.4.7) | |
9 | # | |
10 | Summary: A cross-platform C and C++ unit testing framework for the 21th century | |
11 | Summary(pl.UTF-8): Wieloplatformowy szkielet do testów jednostkowych dla C i C++ w XXI wieku | |
12 | Name: criterion | |
13 | Version: 2.4.1 | |
14 | Release: 2 | |
15 | License: LGPL v2.1+ | |
16 | Group: Libraries | |
17 | #Source0Download: https://github.com/Snaipe/Criterion/releases | |
18 | Source0: https://github.com/Snaipe/Criterion/releases/download/v%{version}/%{name}-%{version}.tar.xz | |
19 | # Source0-md5: 93e91812837a68524d76339409ed2008 | |
20 | Patch0: x32.patch | |
21 | Patch1: %{name}-shared-nanopb.patch | |
22 | URL: https://github.com/Snaipe/Criterion | |
23 | BuildRequires: dyncall >= 1.0 | |
24 | BuildRequires: libffi-devel | |
25 | BuildRequires: libgit2-devel | |
26 | BuildRequires: meson >= 0.51.0 | |
27 | BuildRequires: nanomsg-devel >= 1.0.0 | |
28 | %{?with_system_nanopb:BuildRequires: nanopb-devel >= 0.4.5} | |
29 | BuildRequires: ninja | |
30 | BuildRequires: rpmbuild(macros) >= 1.736 | |
31 | BuildRequires: sed >= 4.0 | |
32 | BuildRequires: tar >= 1:1.22 | |
33 | BuildRequires: xz | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | A dead-simple, yet extensible, C and C++ unit testing framework. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Bardzo prosty, ale rozszerzalny szkielet testów jednostkowych dla C i | |
41 | C++. | |
42 | ||
43 | %package devel | |
44 | Summary: Header files for criterion library | |
45 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki criterion | |
46 | Group: Development/Libraries | |
47 | Requires: %{name} = %{version}-%{release} | |
48 | Requires: libstdc++-devel | |
49 | ||
50 | %description devel | |
51 | Header files for criterion library. | |
52 | ||
53 | %description devel -l pl.UTF-8 | |
54 | Pliki nagłówkowe biblioteki criterion. | |
55 | ||
56 | %package static | |
57 | Summary: Static criterion libraries | |
58 | Summary(pl.UTF-8): Statyczne biblioteki criterion | |
59 | Group: Development/Libraries | |
60 | Requires: %{name} = %{version}-%{release} | |
61 | ||
62 | %description static | |
63 | Static criterion libraries. | |
64 | ||
65 | %description static -l pl.UTF-8 | |
66 | Statyczne biblioteki criterion. | |
67 | ||
68 | %prep | |
69 | %setup -q | |
70 | %patch0 -p1 | |
71 | %patch1 -p1 | |
72 | ||
73 | %if %{without system_nanopb} | |
74 | %{__sed} -i -e '/dependency.*nanopb/ s/nanopb::protobuf-nanopb/notfound::protobuf-nanopb/' meson.build | |
75 | %endif | |
76 | ||
77 | %build | |
78 | %meson build \ | |
79 | --default-library=shared \ | |
80 | -Dtests=%{__true_false tests} | |
81 | ||
82 | %ninja_build -C build | |
83 | ||
84 | %{?with_tests:%ninja_test -C build} | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %ninja_install -C build | |
90 | ||
91 | %find_lang criterion | |
92 | ||
93 | %clean | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %post -p /sbin/ldconfig | |
97 | %postun -p /sbin/ldconfig | |
98 | ||
99 | %files -f criterion.lang | |
100 | %defattr(644,root,root,755) | |
101 | %doc ChangeLog doc/*.txt | |
102 | %attr(755,root,root) %{_libdir}/libcriterion.so.*.*.* | |
103 | %attr(755,root,root) %ghost %{_libdir}/libcriterion.so.3 | |
104 | ||
105 | %files devel | |
106 | %defattr(644,root,root,755) | |
107 | %attr(755,root,root) %{_libdir}/libcriterion.so | |
108 | %{_includedir}/criterion | |
109 | %{_pkgconfigdir}/criterion.pc | |
110 | ||
111 | %files static | |
112 | %defattr(644,root,root,755) | |
113 | %{_libdir}/libcriterion.a | |
114 | %if %{without system_nanopb} | |
115 | %{_libdir}/libprotobuf_nanopb_static.a | |
116 | %endif |