• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name:           jsoncpp
2Version:        1.9.5
3Release:        3
4Summary:        JSON C++ library
5License:        Public Domain or MIT
6URL:            https://github.com/open-source-parsers/jsoncpp
7Source0:        https://github.com/open-source-parsers/jsoncpp/archive/%{version}/%{name}-%{version}.tar.gz
8BuildRequires:  gcc-c++ cmake >= 3.1 python3-devel
9
10%description
11JsonCpp is a C++ library that allows manipulating JSON values,
12including serialization and deserialization to and from strings.
13It can also preserve existing comment in unserialization/serialization steps,
14making it a convenient format to store user input files.
15
16%package        devel
17Summary:        Development files for jsoncpp
18Requires:       %{name} = %{version}-%{release}
19
20%description    devel
21Document files contain library and head files for jsoncpp.
22
23%package        help
24Summary:        Document for jsoncpp
25BuildRequires:  doxygen graphviz hardlink
26BuildArch:      noarch
27Provides:       jsoncpp-doc = %{version}-%{release}
28Obsoletes:      jsoncpp-doc < %{version}-%{release}
29
30%description    help
31Help document for jsoncpp.
32
33%prep
34%autosetup -p 1
35doxygen -s -u doc/doxyfile.in
36sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
37
38%build
39install -d %{_vpath_builddir}
40cd %{_vpath_builddir}
41%cmake -DBUILD_STATIC_LIBS=OFF -DJSONCPP_WITH_WARNING_AS_ERROR=OFF \
42       -DBUILD_OBJECT_LIBS:BOOL=OFF \
43       -DJSONCPP_WITH_PKGCONFIG_SUPPORT=ON -DJSONCPP_WITH_CMAKE_PACKAGE=ON \
44       -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF -DPYTHON_EXECUTABLE="%{__python3}" \
45       ..
46cd ..
47%make_build -C %{_vpath_builddir}
48cp -p %{_vpath_builddir}/version .
49%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
50rm -f version
51
52%install
53%make_install -C %{_vpath_builddir}
54mkdir -p %{buildroot}%{_docdir}/%{name}
55cp README.md %{buildroot}%{_docdir}/%{name}
56chmod 644 %{buildroot}%{_docdir}/%{name}/README.md
57touch %{buildroot}%{_docdir}/%{name}//README.md
58mkdir -p %{buildroot}%{_docdir}/%{name}/html
59cp dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
60chmod 644 %{buildroot}%{_docdir}/%{name}/html/*.{html,png}
61touch %{buildroot}%{_docdir}/%{name}/html
62hardlink -cfv %{buildroot}%{_docdir}/%{name}
63
64# When the .so file name changes during version upgrade, you need to copy the lower version of .so file
65# cp -a %{_libdir}/libjsoncpp.so.* $RPM_BUILD_ROOT%{_libdir}
66
67%check
68%make_build -C %{_vpath_builddir} jsoncpp_check
69
70%post
71/sbin/ldconfig
72
73%postun
74/sbin/ldconfig
75
76%files
77%license AUTHORS LICENSE
78%doc %dir %{_docdir}/%{name}
79%exclude %{_docdir}/%{name}/html
80%{_libdir}/lib%{name}.so.*
81
82%files devel
83%{_libdir}/lib%{name}.so
84%{_includedir}/json
85%{_libdir}/cmake/*
86%{_libdir}/pkgconfig/%{name}.pc
87
88%files help
89%doc %{_docdir}/%{name}
90%doc %{_docdir}/%{name}/README.md
91
92
93%changelog
94* Mon Jan 10 2022 shixuantong <shixuantong@huawei.com> - 1.9.5-3
95- Delete so files of lower versions
96
97* Wed Jan 05 2022 shangyibin <shangyibin1@huawei.com> - 1.9.5-2
98- copy the .so file of the old version.
99
100* Wed Dec 22 2021 shangyibin <shangyibin1@huawei.com> - 1.9.5-1
101- upgrade version to 1.9.5
102
103* Wed Feb 3 2021 liudabo <liudabo1@huawei.com> - 1.9.4-1
104- upgrade version to 1.9.4
105
106* Sat Aug 08 2020 lingsheng<lingsheng@huawei.com> - 1.9.3-2
107- Remove old version so
108
109* Fri Jul 31 2020 wenzhanli<wenzhanli2@huawei.com> - 1.9.3-1
110- Type:NA
111- ID:NA
112- SUG:NA
113- DESC:update version 1.9.3
114
115* Mon Nov 25 2019 zhujunhao <zhujunhao5@huawei.com> - 1.8.4-6
116- Package init
117