source: spec/trunk/SPECS/jsoncpp.spec@ 1711

Last change on this file since 1711 was 1709, checked in by tellie, 5 years ago

spec: jsoncpp: Release version 1.9.3-1

File size: 3.6 KB
Line 
1%if !0%{?os2_version}
2# Build documentation in HTML with images
3%bcond_without jsoncpp_enables_doc
4%endif
5
6%global jsondir json
7
8# Avoid accidental so-name bumps.
9# ATTENTION!!! You need to run a bootstrap build
10# of cmake *BEFORE* bumping the so-name here!
11%global sover 24
12
13
14Name: jsoncpp
15Version: 1.9.3
16Release: 1%{?dist}
17Summary: JSON library implemented in C++
18
19License: Public Domain or MIT
20URL: https://github.com/open-source-parsers/%{name}
21%if !0%{?os2_version}
22Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
23%else
24%scm_source github https://github.com/tellie/%{name}-os2 master-os2
25%endif
26
27BuildRequires: cmake >= 3.1
28BuildRequires: gcc
29BuildRequires: gcc-c++
30%if !0%{?os2_version}
31BuildRequires: python3-devel
32%endif
33
34%description
35%{name} is an implementation of a JSON (http://json.org) reader and writer in
36C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format.
37It is easy for humans to read and write. It is easy for machines to parse and
38generate.
39
40
41%package devel
42Summary: Development headers and library for %{name}
43Requires: %{name}%{?_isa} = %{version}-%{release}
44
45%description devel
46This package contains the development headers and library for %{name}.
47
48
49%if %{with jsoncpp_enables_doc}
50%package doc
51Summary: Documentation for %{name}
52
53BuildRequires: doxygen
54%if !0%{?os2_version}
55BuildRequires: graphviz
56BuildRequires: hardlink
57%endif
58BuildArch: noarch
59
60%description doc
61This package contains the documentation for %{name}.
62%endif
63
64
65%prep
66%if !0%{?os2_version}
67%autosetup -p 1
68%endif
69
70%if %{with jsoncpp_enables_doc}
71doxygen -s -u doc/doxyfile.in
72sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
73%endif
74%scm_setup
75
76%build
77mkdir build
78cd build
79pwd
80export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
81export LIBS="-lcx"
82
83%cmake \
84 -DBUILD_SHARED_LIBS:BOOL=OFF \
85 -DBUILD_SHARED_LIBS:BOOL=ON \
86 -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON \
87 -DJSONCPP_WITH_EXAMPLE:BOOL=OFF \
88 -DJSONCPP_WITH_PKGCONFIG_SUPPORT:BOOL=ON \
89 -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF \
90 -DJSONCPP_WITH_STRICT_ISO:BOOL=ON \
91 -DJSONCPP_WITH_TESTS:BOOL=ON \
92 -DJSONCPP_WITH_WARNING_AS_ERROR:BOOL=OFF \
93 ..
94%if !0%{?os2_version}
95 -DPYTHON_EXECUTABLE:STRING="%{__python3}"
96%cmake_build
97%endif
98make %{?_smp_mflags}
99
100%if %{with jsoncpp_enables_doc}
101# Build the doc
102cp -p %{__cmake_builddir}/version .
103%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
104rm -f version
105%endif
106
107
108%install
109%make_install INSTALL_ROOT=%{buildroot} -C build
110
111mkdir -p %{buildroot}%{_docdir}/%{name}
112install -pm 0644 README.md %{buildroot}%{_docdir}/%{name}
113
114%if %{with jsoncpp_enables_doc}
115mkdir -p %{buildroot}%{_docdir}/%{name}/html
116install -pm 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
117hardlink -cfv %{buildroot}%{_docdir}/%{name}
118%endif
119
120
121%check
122%if !0%{?os2_version}
123%ctest
124
125%ldconfig_scriptlets
126%endif
127
128%files
129%license AUTHORS LICENSE
130%doc %dir %{_docdir}/%{name}
131%doc %{_docdir}/%{name}/README.md
132%if %{with jsoncpp_enables_doc}
133%exclude %{_docdir}/%{name}/html
134%endif
135%{_libdir}/*.dll
136%if !0%{?os2_version}
137%{_libdir}/lib%{name}.so.%{version}
138%endif
139
140%files devel
141%{_libdir}/*.a
142%{_includedir}/%{jsondir}
143%{_libdir}/cmake/*
144%{_libdir}/pkgconfig/%{name}.pc
145
146%if %{with jsoncpp_enables_doc}
147%files doc
148%license %{_datadir}/licenses/%{name}
149%doc %{_docdir}/%{name}
150%endif
151
152%changelog
153* Fri Sep 18 2020 Elbert Pol <elbert.pol@gmail.com> - 1.9.3-1
154- First RPM for OS2
155
Note: See TracBrowser for help on using the repository browser.