| 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.3
|
|---|
| 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 master-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 | %endif
|
|---|
| 69 |
|
|---|
| 70 | %if %{with jsoncpp_enables_doc}
|
|---|
| 71 | doxygen -s -u doc/doxyfile.in
|
|---|
| 72 | sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
|
|---|
| 73 | %endif
|
|---|
| 74 | %scm_setup
|
|---|
| 75 |
|
|---|
| 76 | %build
|
|---|
| 77 | mkdir build
|
|---|
| 78 | cd build
|
|---|
| 79 | pwd
|
|---|
| 80 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 81 | export 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
|
|---|
| 98 | make %{?_smp_mflags}
|
|---|
| 99 |
|
|---|
| 100 | %if %{with jsoncpp_enables_doc}
|
|---|
| 101 | # Build the doc
|
|---|
| 102 | cp -p %{__cmake_builddir}/version .
|
|---|
| 103 | %{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
|
|---|
| 104 | rm -f version
|
|---|
| 105 | %endif
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | %install
|
|---|
| 109 | %make_install INSTALL_ROOT=%{buildroot} -C build
|
|---|
| 110 |
|
|---|
| 111 | mkdir -p %{buildroot}%{_docdir}/%{name}
|
|---|
| 112 | install -pm 0644 README.md %{buildroot}%{_docdir}/%{name}
|
|---|
| 113 |
|
|---|
| 114 | %if %{with jsoncpp_enables_doc}
|
|---|
| 115 | mkdir -p %{buildroot}%{_docdir}/%{name}/html
|
|---|
| 116 | install -pm 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
|
|---|
| 117 | hardlink -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 |
|
|---|