]>
Commit | Line | Data |
---|---|---|
6e470621 JB |
1 | # TODO: |
2 | # - system boxfort (when released): https://github.com/diacritic/BoxFort | |
b91549db | 3 | # - system nanopb (0.4.5 bundled) |
6e470621 | 4 | # - system libcsptr (when some post-2017 release made): https://github.com/Snaipe/libcsptr |
286f2900 JR |
5 | # |
6 | # Conditional build: | |
7 | %bcond_without tests # build without tests | |
b91549db | 8 | %bcond_with system_nanopb # system nanopb (tests fail with nanopb 0.4.7) |
286f2900 | 9 | # |
87c05200 | 10 | Summary: A cross-platform C and C++ unit testing framework for the 21th century |
6e470621 | 11 | Summary(pl.UTF-8): Wieloplatformowy szkielet do testów jednostkowych dla C i C++ w XXI wieku |
87c05200 | 12 | Name: criterion |
2371444b | 13 | Version: 2.4.1 |
79185653 | 14 | Release: 2 |
87c05200 AM |
15 | License: LGPL v2.1+ |
16 | Group: Libraries | |
6e470621 | 17 | #Source0Download: https://github.com/Snaipe/Criterion/releases |
2371444b JP |
18 | Source0: https://github.com/Snaipe/Criterion/releases/download/v%{version}/%{name}-%{version}.tar.xz |
19 | # Source0-md5: 93e91812837a68524d76339409ed2008 | |
20 | Patch0: x32.patch | |
b91549db | 21 | Patch1: %{name}-shared-nanopb.patch |
87c05200 | 22 | URL: https://github.com/Snaipe/Criterion |
6e470621 | 23 | BuildRequires: dyncall >= 1.0 |
2371444b JP |
24 | BuildRequires: libffi-devel |
25 | BuildRequires: libgit2-devel | |
26 | BuildRequires: meson >= 0.51.0 | |
6e470621 | 27 | BuildRequires: nanomsg-devel >= 1.0.0 |
b91549db | 28 | %{?with_system_nanopb:BuildRequires: nanopb-devel >= 0.4.5} |
2371444b JP |
29 | BuildRequires: ninja |
30 | BuildRequires: rpmbuild(macros) >= 1.736 | |
b91549db | 31 | BuildRequires: sed >= 4.0 |
2371444b JP |
32 | BuildRequires: tar >= 1:1.22 |
33 | BuildRequires: xz | |
87c05200 AM |
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 | ||
6e470621 JB |
39 | %description -l pl.UTF-8 |
40 | Bardzo prosty, ale rozszerzalny szkielet testów jednostkowych dla C i | |
41 | C++. | |
42 | ||
87c05200 AM |
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 | ||
b91549db JB |
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 | ||
87c05200 | 68 | %prep |
2371444b | 69 | %setup -q |
6e470621 | 70 | %patch0 -p1 |
b91549db JB |
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 | |
87c05200 AM |
76 | |
77 | %build | |
2371444b | 78 | %meson build \ |
b91549db | 79 | --default-library=shared \ |
2371444b | 80 | -Dtests=%{__true_false tests} |
87c05200 | 81 | |
2371444b | 82 | %ninja_build -C build |
b91549db | 83 | |
2371444b | 84 | %{?with_tests:%ninja_test -C build} |
286f2900 | 85 | |
87c05200 AM |
86 | %install |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
2371444b | 89 | %ninja_install -C build |
87c05200 | 90 | |
2371444b | 91 | %find_lang criterion |
87c05200 AM |
92 | |
93 | %clean | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %post -p /sbin/ldconfig | |
97 | %postun -p /sbin/ldconfig | |
98 | ||
2371444b | 99 | %files -f criterion.lang |
87c05200 AM |
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 | |
6e470621 | 109 | %{_pkgconfigdir}/criterion.pc |
b91549db JB |
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 |