]>
Commit | Line | Data |
---|---|---|
4c254caf JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # don't build static libraries | |
4 | # | |
5 | Summary: Belledonne Communications' vCard 4 parsing library | |
6 | Summary(pl.UTF-8): Biblioteka Belledonne Communications do analizy formatu vCard 4 | |
7 | Name: belcard | |
0bafb1c5 | 8 | Version: 4.5.20 |
4c254caf JB |
9 | Release: 1 |
10 | License: GPL v2+ | |
11 | Group: Libraries | |
0bafb1c5 JB |
12 | #Source0Download: https://gitlab.linphone.org/BC/public/belcard/-/tags |
13 | Source0: https://gitlab.linphone.org/BC/public/belcard/-/archive/%{version}/%{name}-%{version}.tar.bz2 | |
14 | # Source0-md5: 6c0ebca77e42cc8591bc2c895458e3ef | |
36e8b22a | 15 | Patch0: %{name}-static.patch |
4c254caf | 16 | URL: https://linphone.org/ |
4c254caf JB |
17 | BuildRequires: bctoolbox-devel >= 0.0.3 |
18 | BuildRequires: bcunit-devel | |
f826c37e JB |
19 | BuildRequires: belr-devel >= 4.5.0 |
20 | BuildRequires: cmake >= 3.1 | |
4c254caf | 21 | BuildRequires: libstdc++-devel >= 6:4.7 |
4c254caf JB |
22 | BuildRequires: pkgconfig |
23 | BuildRequires: xxd | |
24 | Requires: bctoolbox >= 0.0.3 | |
f826c37e | 25 | Requires: belr >= 4.5.0 |
4c254caf JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %description | |
29 | Belcard is a C++ library to manipulate VCard standard format. | |
30 | ||
31 | %description -l pl.UTF-8 | |
32 | Belcard to biblioteka C++ do operacji na danych w standardzie VCard. | |
33 | ||
34 | %package devel | |
35 | Summary: Header files for BelCard library | |
36 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki BelCard | |
37 | Group: Development/Libraries | |
38 | Requires: %{name} = %{version}-%{release} | |
39 | Requires: bctoolbox-devel >= 0.0.3 | |
f826c37e | 40 | Requires: belr-devel >= 4.5.0 |
4c254caf JB |
41 | Requires: libstdc++-devel >= 6:4.7 |
42 | ||
43 | %description devel | |
44 | Header files for BelCard library. | |
45 | ||
46 | %description devel -l pl.UTF-8 | |
47 | Pliki nagłówkowe biblioteki BelCard. | |
48 | ||
49 | %package static | |
50 | Summary: Static BelCard library | |
51 | Summary(pl.UTF-8): Statyczna biblioteka BelCard | |
52 | Group: Development/Libraries | |
53 | Requires: %{name}-devel = %{version}-%{release} | |
54 | ||
55 | %description static | |
56 | Static BelCard library. | |
57 | ||
58 | %description static -l pl.UTF-8 | |
59 | Statyczna biblioteka BelCard. | |
60 | ||
61 | %prep | |
0bafb1c5 | 62 | %setup -q |
4c254caf JB |
63 | %patch0 -p1 |
64 | ||
65 | %build | |
36e8b22a JB |
66 | install -d build |
67 | cd build | |
f826c37e JB |
68 | %cmake .. \ |
69 | %{!?with_static_libs:-DENABLE_STATIC=OFF} | |
36e8b22a JB |
70 | |
71 | %{__make} | |
4c254caf JB |
72 | |
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
36e8b22a | 76 | %{__make} -C build install \ |
4c254caf JB |
77 | DESTDIR=$RPM_BUILD_ROOT |
78 | ||
36e8b22a JB |
79 | # disable completeness check incompatible with split packaging |
80 | %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_datadir}/belcard/cmake/belcardTargets.cmake | |
81 | ||
82 | # missing from cmake | |
83 | test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belcard.pc | |
84 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
85 | %{__sed} -e 's,@CMAKE_INSTALL_PREFIX@,%{_prefix},' \ | |
86 | -e 's,@PROJECT_NAME@,belcard,' \ | |
87 | -e 's,@PROJECT_VERSION@,%{version},' \ | |
88 | -e 's,@CMAKE_INSTALL_FULL_LIBDIR@,%{_libdir},' \ | |
89 | -e 's,@LIBS_PRIVATE@,-lbelr -lbctoolbox,' \ | |
90 | -e 's,@CMAKE_INSTALL_FULL_INCLUDEDIR@,%{_includedir},' \ | |
91 | belcard.pc.in >$RPM_BUILD_ROOT%{_pkgconfigdir}/belcard.pc | |
f826c37e | 92 | |
4c254caf JB |
93 | %clean |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %post -p /sbin/ldconfig | |
97 | %postun -p /sbin/ldconfig | |
98 | ||
99 | %files | |
100 | %defattr(644,root,root,755) | |
0bafb1c5 | 101 | %doc CHANGELOG.md README.md |
4c254caf JB |
102 | %attr(755,root,root) %{_bindir}/belcard-folder |
103 | %attr(755,root,root) %{_bindir}/belcard-parser | |
104 | %attr(755,root,root) %{_bindir}/belcard-unfolder | |
36e8b22a JB |
105 | %attr(755,root,root) %{_bindir}/belcard_tester |
106 | %attr(755,root,root) %{_libdir}/libbelcard.so.1 | |
107 | %{_datadir}/belcard_tester | |
108 | # dirs should belong to belr? | |
109 | %dir %{_datadir}/belr | |
110 | %dir %{_datadir}/belr/grammars | |
111 | %{_datadir}/belr/grammars/vcard_grammar | |
4c254caf JB |
112 | |
113 | %files devel | |
114 | %defattr(644,root,root,755) | |
115 | %attr(755,root,root) %{_libdir}/libbelcard.so | |
116 | %{_includedir}/belcard | |
117 | %{_pkgconfigdir}/belcard.pc | |
36e8b22a JB |
118 | %dir %{_datadir}/belcard |
119 | %{_datadir}/belcard/cmake | |
4c254caf JB |
120 | |
121 | %if %{with static_libs} | |
122 | %files static | |
123 | %defattr(644,root,root,755) | |
124 | %{_libdir}/libbelcard.a | |
125 | %endif |