]>
Commit | Line | Data |
---|---|---|
0cc95b9e ER |
1 | # |
2 | # Conditional build: | |
68cefeae | 3 | %bcond_without apidocs # doxygen apidocs build |
1fe9b66c | 4 | %bcond_without tests # tests during build |
0cc95b9e | 5 | |
0cc95b9e | 6 | Summary: API for manipulating JSON |
68cefeae | 7 | Summary(pl.UTF-8): API do operacji na strukturach JSON |
0cc95b9e | 8 | Name: jsoncpp |
1fe9b66c | 9 | Version: 1.0.0 |
49e003df | 10 | Release: 2 |
0cc95b9e ER |
11 | License: MIT or Public Domain |
12 | Group: Libraries | |
1fe9b66c JB |
13 | Source0: https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz |
14 | # Source0-md5: 4c886ac3bfccc867a79f3a5280ce1152 | |
15 | Patch0: %{name}-test.patch | |
16 | Patch1: %{name}-libdir.patch | |
17 | URL: https://github.com/open-source-parsers/jsoncpp/ | |
18 | BuildRequires: cmake >= 2.8.5 | |
68cefeae JB |
19 | BuildRequires: libstdc++-devel |
20 | BuildRequires: python >= 2 | |
68cefeae JB |
21 | %if %{with apidocs} |
22 | BuildRequires: doxygen | |
23 | BuildRequires: graphviz | |
24 | %endif | |
0cc95b9e ER |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %description | |
28 | JSONCPP provides a simple API to manipulate JSON values, and handle | |
29 | serialization and unserialization to strings. | |
30 | ||
68cefeae JB |
31 | %description |
32 | JSONCPP udostępnia proste API do operacji na wartościach JSON oraz | |
33 | obsługi serializacji oraz deserializacji z łańcuchów znaków. | |
34 | ||
0cc95b9e | 35 | %package devel |
68cefeae JB |
36 | Summary: Header files for JSONCPP library |
37 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki JSONCPP | |
c4ee6642 | 38 | Group: Development/Libraries |
0cc95b9e ER |
39 | Requires: %{name} = %{version}-%{release} |
40 | ||
41 | %description devel | |
68cefeae JB |
42 | Header files for JSONCPP library. |
43 | ||
44 | %description devel -l pl.UTF-8 | |
45 | Pliki nagłówkowe biblioteki JSONCPP. | |
46 | ||
47 | %package apidocs | |
48 | Summary: API documentation for JSONCPP library | |
49 | Summary(pl.UTF-8): Dokumentacja API biblioteki JSONCPP | |
50 | Group: Documentation | |
51 | ||
52 | %description apidocs | |
53 | API documentation for JSONCPP library. | |
54 | ||
55 | %description apidocs -l pl.UTF-8 | |
56 | Dokumentacja API biblioteki JSONCPP. | |
0cc95b9e ER |
57 | |
58 | %prep | |
1fe9b66c | 59 | %setup -q |
0cc95b9e | 60 | %patch0 -p1 |
1fe9b66c | 61 | %patch1 -p1 |
0cc95b9e ER |
62 | |
63 | %build | |
1fe9b66c JB |
64 | install -d build |
65 | cd build | |
66 | %cmake .. \ | |
67 | -DARCHIVE_INSTALL_DIR:PATH=%{_lib} \ | |
68 | -DLIBRARY_INSTALL_DIR:PATH=%{_lib} \ | |
69 | -DPACKAGE_INSTALL_DIR:PATH=%{_lib}/cmake \ | |
70 | -DJSONCPP_LIB_BUILD_SHARED=ON \ | |
71 | -DJSONCPP_WITH_CMAKE_PACKAGE=ON \ | |
72 | %{!?with_tests:-DJSONCPP_WITH_TESTS=OFF} | |
73 | cd .. | |
0cc95b9e | 74 | |
68cefeae JB |
75 | %if %{with apidocs} |
76 | %{__python} doxybuild.py \ | |
77 | --dot=/usr/bin/dot \ | |
78 | --doxygen=/usr/bin/doxygen | |
79 | %endif | |
80 | ||
0cc95b9e ER |
81 | %install |
82 | rm -rf $RPM_BUILD_ROOT | |
0cc95b9e | 83 | |
1fe9b66c JB |
84 | %{__make} -C build install \ |
85 | DESTDIR=$RPM_BUILD_ROOT | |
86 | ||
87 | # <json/*> is too common, use <jsoncpp/*> | |
88 | %{__mv} $RPM_BUILD_ROOT%{_includedir}/{json,jsoncpp} | |
0cc95b9e ER |
89 | |
90 | %clean | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
68cefeae JB |
93 | %post -p /sbin/ldconfig |
94 | %postun -p /sbin/ldconfig | |
0cc95b9e ER |
95 | |
96 | %files | |
97 | %defattr(644,root,root,755) | |
1fe9b66c JB |
98 | %doc AUTHORS LICENSE NEWS.txt README.md |
99 | %attr(755,root,root) %{_libdir}/libjsoncpp.so.*.*.* | |
100 | %attr(755,root,root) %ghost %{_libdir}/libjsoncpp.so.1 | |
0cc95b9e ER |
101 | |
102 | %files devel | |
103 | %defattr(644,root,root,755) | |
68cefeae | 104 | %attr(755,root,root) %{_libdir}/libjsoncpp.so |
0cc95b9e | 105 | %{_includedir}/jsoncpp |
0cc95b9e | 106 | %{_pkgconfigdir}/jsoncpp.pc |
1fe9b66c | 107 | %{_libdir}/cmake/jsoncpp |
68cefeae JB |
108 | |
109 | %if %{with apidocs} | |
110 | %files apidocs | |
111 | %defattr(644,root,root,755) | |
112 | %doc dist/doxygen/jsoncpp-api-html-*/* | |
113 | %endif |