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

Last change on this file since 1807 was 1807, checked in by tellie, 4 years ago

spec: libsndfile: Release version 1.1.0-1.

File size: 3.7 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.5
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++
30BuildRequires: python3-devel
31
32%description
33%{name} is an implementation of a JSON (http://json.org) reader and writer in
34C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format.
35It is easy for humans to read and write. It is easy for machines to parse and
36generate.
37
38
39%package devel
40Summary: Development headers and library for %{name}
41Requires: %{name}%{?_isa} = %{version}-%{release}
42
43%description devel
44This package contains the development headers and library for %{name}.
45
46
47%if %{with jsoncpp_enables_doc}
48%package doc
49Summary: Documentation for %{name}
50
51BuildRequires: doxygen
52%if !0%{?os2_version}
53BuildRequires: graphviz
54BuildRequires: hardlink
55%endif
56BuildArch: noarch
57
58%description doc
59This package contains the documentation for %{name}.
60%endif
61
62
63%prep
64%if !0%{?os2_version}
65%autosetup -p 1
66%else
67%scm_setup
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
75%build
76mkdir build
77cd build
78pwd
79export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
80export LIBS="-lcx"
81echo PACKAGE_VERSION="%{version}" > package_version
82
83%cmake \
84 -DBUILD_SHARED=true \
85 -DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON \
86 -DJSONCPP_WITH_EXAMPLE:BOOL=OFF \
87 -DJSONCPP_WITH_PKGCONFIG_SUPPORT:BOOL=ON \
88 -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF \
89 -DJSONCPP_WITH_STRICT_ISO:BOOL=ON \
90 -DJSONCPP_WITH_TESTS:BOOL=ON \
91 -DJSONCPP_WITH_WARNING_AS_ERROR:BOOL=OFF \
92 -DPYTHON_EXECUTABLE:STRING="%{__python3}" \
93 ..
94
95%if !0%{?os2_version}
96%cmake_build
97%else
98make %{?_smp_mflags}
99%endif
100
101%if %{with jsoncpp_enables_doc}
102# Build the doc
103cp -p %{__cmake_builddir}/version .
104%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
105rm -f version
106%endif
107
108
109%install
110%make_install INSTALL_ROOT=%{buildroot} -C build
111
112mkdir -p %{buildroot}%{_docdir}/%{name}
113install -pm 0644 README.md %{buildroot}%{_docdir}/%{name}
114
115%if %{with jsoncpp_enables_doc}
116mkdir -p %{buildroot}%{_docdir}/%{name}/html
117install -pm 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
118hardlink -cfv %{buildroot}%{_docdir}/%{name}
119%endif
120
121
122%check
123%if !0%{?os2_version}
124%ctest
125
126%ldconfig_scriptlets
127%endif
128
129%files
130%license AUTHORS LICENSE
131%doc %dir %{_docdir}/%{name}
132%doc %{_docdir}/%{name}/README.md
133%if %{with jsoncpp_enables_doc}
134%exclude %{_docdir}/%{name}/html
135%endif
136%if !0%{?os2_version}
137%{_libdir}/lib%{name}.so.%{version}
138%else
139%{_libdir}/*.dll
140%endif
141
142%files devel
143%{_libdir}/*.a
144%{_includedir}/%{jsondir}
145%{_libdir}/cmake/*
146%{_libdir}/pkgconfig/%{name}.pc
147
148%if %{with jsoncpp_enables_doc}
149%files doc
150%license %{_datadir}/licenses/%{name}
151%doc %{_docdir}/%{name}
152%endif
153
154%changelog
155* Sun Oct 25 2020 Elbert Pol <elbert.pol@gmail.com> - 1.9.4-1
156- Update to latest version
157- Update spec file
158
159* Fri Sep 18 2020 Elbert Pol <elbert.pol@gmail.com> - 1.9.3-1
160- First RPM for OS2
161
Note: See TracBrowser for help on using the repository browser.