]> git.pld-linux.org Git - packages/jsoncpp.git/blob - jsoncpp.spec
0bc35184fa79526f8eb6e814bed8dad9443697ef
[packages/jsoncpp.git] / jsoncpp.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs # doxygen apidocs build
4 %bcond_without  tests   # tests during build
5
6 Summary:        API for manipulating JSON
7 Summary(pl.UTF-8):      API do operacji na strukturach JSON
8 Name:           jsoncpp
9 Version:        1.0.0
10 Release:        1
11 License:        MIT or Public Domain
12 Group:          Libraries
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
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  python >= 2
21 %if %{with apidocs}
22 BuildRequires:  doxygen
23 BuildRequires:  graphviz
24 %endif
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
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
35 %package devel
36 Summary:        Header files for JSONCPP library
37 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki JSONCPP
38 Group:          Development/Libraries
39 Requires:       %{name} = %{version}-%{release}
40
41 %description devel
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.
57
58 %prep
59 %setup -q
60 %patch0 -p1
61 %patch1 -p1
62
63 %build
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 ..
74
75 %if %{with apidocs}
76 %{__python} doxybuild.py \
77         --dot=/usr/bin/dot \
78         --doxygen=/usr/bin/doxygen
79 %endif
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83
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}
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93 %post   -p /sbin/ldconfig
94 %postun -p /sbin/ldconfig
95
96 %files
97 %defattr(644,root,root,755)
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
101
102 %files devel
103 %defattr(644,root,root,755)
104 %attr(755,root,root) %{_libdir}/libjsoncpp.so
105 %{_includedir}/jsoncpp
106 %{_pkgconfigdir}/jsoncpp.pc
107 %{_libdir}/cmake/jsoncpp
108
109 %if %{with apidocs}
110 %files apidocs
111 %defattr(644,root,root,755)
112 %doc dist/doxygen/jsoncpp-api-html-*/*
113 %endif
This page took 0.070088 seconds and 2 git commands to generate.