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

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

spec: jsoncpp: Release version 1.9.4-1.

File size: 3.8 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.4
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 %{version}-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%else
69%scm_setup
70%endif
71
72%if %{with jsoncpp_enables_doc}
73doxygen -s -u doc/doxyfile.in
74sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
75%endif
76
77%build
78mkdir build
79cd build
80pwd
81export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
82export LIBS="-lcx"
83echo PACKAGE_VERSION="%{version}" > package_version
84
85%cmake \
86 -DBUILD_STATIC_LIBS:BOOL=OFF \
87 -DBUILD_OBJECT_LIBS:BOOL=OFF \
88 -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON \
89 -DJSONCPP_WITH_EXAMPLE:BOOL=OFF \
90 -DJSONCPP_WITH_PKGCONFIG_SUPPORT:BOOL=ON \
91 -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF \
92 -DJSONCPP_WITH_STRICT_ISO:BOOL=ON \
93 -DJSONCPP_WITH_TESTS:BOOL=ON \
94 -DJSONCPP_WITH_WARNING_AS_ERROR:BOOL=OFF \
95 ..
96
97%if !0%{?os2_version}
98 -DPYTHON_EXECUTABLE:STRING="%{__python3}"
99%cmake_build
100%else
101make %{?_smp_mflags}
102%endif
103
104%if %{with jsoncpp_enables_doc}
105# Build the doc
106cp -p %{__cmake_builddir}/version .
107%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
108rm -f version
109%endif
110
111
112%install
113%make_install INSTALL_ROOT=%{buildroot} -C build
114
115mkdir -p %{buildroot}%{_docdir}/%{name}
116install -pm 0644 README.md %{buildroot}%{_docdir}/%{name}
117
118%if %{with jsoncpp_enables_doc}
119mkdir -p %{buildroot}%{_docdir}/%{name}/html
120install -pm 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
121hardlink -cfv %{buildroot}%{_docdir}/%{name}
122%endif
123
124
125%check
126%if !0%{?os2_version}
127%ctest
128
129%ldconfig_scriptlets
130%endif
131
132%files
133%license AUTHORS LICENSE
134%doc %dir %{_docdir}/%{name}
135%doc %{_docdir}/%{name}/README.md
136%if %{with jsoncpp_enables_doc}
137%exclude %{_docdir}/%{name}/html
138%endif
139%if !0%{?os2_version}
140%{_libdir}/lib%{name}.so.%{version}
141%else
142%{_libdir}/*.dll
143%endif
144
145%files devel
146%{_libdir}/*.a
147%{_includedir}/%{jsondir}
148%{_libdir}/cmake/*
149%{_libdir}/pkgconfig/%{name}.pc
150
151%if %{with jsoncpp_enables_doc}
152%files doc
153%license %{_datadir}/licenses/%{name}
154%doc %{_docdir}/%{name}
155%endif
156
157%changelog
158* Sun Oct 25 2020 Elbert Pol <elbert.pol@gmail.com> - 1.9.4-1
159- Update to latest version
160- Update spec file
161
162* Fri Sep 18 2020 Elbert Pol <elbert.pol@gmail.com> - 1.9.3-1
163- First RPM for OS2
164
Note: See TracBrowser for help on using the repository browser.