| 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 |
|
|---|
| 14 | Name: jsoncpp
|
|---|
| 15 | Version: 1.9.4
|
|---|
| 16 | Release: 1%{?dist}
|
|---|
| 17 | Summary: JSON library implemented in C++
|
|---|
| 18 |
|
|---|
| 19 | License: Public Domain or MIT
|
|---|
| 20 | URL: https://github.com/open-source-parsers/%{name}
|
|---|
| 21 | %if !0%{?os2_version}
|
|---|
| 22 | Source0: %{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 |
|
|---|
| 27 | BuildRequires: cmake >= 3.1
|
|---|
| 28 | BuildRequires: gcc
|
|---|
| 29 | BuildRequires: gcc-c++
|
|---|
| 30 | %if !0%{?os2_version}
|
|---|
| 31 | BuildRequires: python3-devel
|
|---|
| 32 | %endif
|
|---|
| 33 |
|
|---|
| 34 | %description
|
|---|
| 35 | %{name} is an implementation of a JSON (http://json.org) reader and writer in
|
|---|
| 36 | C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format.
|
|---|
| 37 | It is easy for humans to read and write. It is easy for machines to parse and
|
|---|
| 38 | generate.
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | %package devel
|
|---|
| 42 | Summary: Development headers and library for %{name}
|
|---|
| 43 | Requires: %{name}%{?_isa} = %{version}-%{release}
|
|---|
| 44 |
|
|---|
| 45 | %description devel
|
|---|
| 46 | This package contains the development headers and library for %{name}.
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | %if %{with jsoncpp_enables_doc}
|
|---|
| 50 | %package doc
|
|---|
| 51 | Summary: Documentation for %{name}
|
|---|
| 52 |
|
|---|
| 53 | BuildRequires: doxygen
|
|---|
| 54 | %if !0%{?os2_version}
|
|---|
| 55 | BuildRequires: graphviz
|
|---|
| 56 | BuildRequires: hardlink
|
|---|
| 57 | %endif
|
|---|
| 58 | BuildArch: noarch
|
|---|
| 59 |
|
|---|
| 60 | %description doc
|
|---|
| 61 | This 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}
|
|---|
| 73 | doxygen -s -u doc/doxyfile.in
|
|---|
| 74 | sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
|
|---|
| 75 | %endif
|
|---|
| 76 |
|
|---|
| 77 | %build
|
|---|
| 78 | mkdir build
|
|---|
| 79 | cd build
|
|---|
| 80 | pwd
|
|---|
| 81 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 82 | export LIBS="-lcx"
|
|---|
| 83 | echo 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
|
|---|
| 101 | make %{?_smp_mflags}
|
|---|
| 102 | %endif
|
|---|
| 103 |
|
|---|
| 104 | %if %{with jsoncpp_enables_doc}
|
|---|
| 105 | # Build the doc
|
|---|
| 106 | cp -p %{__cmake_builddir}/version .
|
|---|
| 107 | %{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
|
|---|
| 108 | rm -f version
|
|---|
| 109 | %endif
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | %install
|
|---|
| 113 | %make_install INSTALL_ROOT=%{buildroot} -C build
|
|---|
| 114 |
|
|---|
| 115 | mkdir -p %{buildroot}%{_docdir}/%{name}
|
|---|
| 116 | install -pm 0644 README.md %{buildroot}%{_docdir}/%{name}
|
|---|
| 117 |
|
|---|
| 118 | %if %{with jsoncpp_enables_doc}
|
|---|
| 119 | mkdir -p %{buildroot}%{_docdir}/%{name}/html
|
|---|
| 120 | install -pm 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
|
|---|
| 121 | hardlink -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 |
|
|---|