jsoncpp/jsoncpp.spec

124 lines
4.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package jsoncpp
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: jsoncpp
Version: 1.0.0
Release: 0
Summary: C++ library that allows manipulating with JSON
License: MIT
Group: Devel/Libraries/C and C++
Url: https://github.com/open-source-parsers/jsoncpp
Source0: https://github.com/open-source-parsers/%{name}/archive/%{version}.tar.gz
Patch0: jsoncpp-1.0.0-lib_suffix.patch
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: pkg-config
BuildRequires: python
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# On i386, jsoncpp fails it's own unittests
ExcludeArch: i586
%description
JSON is a lightweight data-interchange format. It can represent numbers,
strings, ordered sequences of values, and collections of name/value pairs.
JsonCpp is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
%package devel
Summary: Development files for %{name}
Group: Development/Languages/C and C++
Requires: lib%{name}1 = %{version}
%description devel
JSON is a lightweight data-interchange format. It can represent numbers,
strings, ordered sequences of values, and collections of name/value pairs.
JsonCpp is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
%package doc
Summary: Documentation for %{name}
Group: Development/Languages/C and C++
%description doc
JSON is a lightweight data-interchange format. It can represent numbers,
strings, ordered sequences of values, and collections of name/value pairs.
JsonCpp is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
%package -n lib%{name}1
Summary: Shared library for %{name}
Group: Development/Languages/C and C++
%description -n lib%{name}1
JSON is a lightweight data-interchange format. It can represent numbers,
strings, ordered sequences of values, and collections of name/value pairs.
JsonCpp is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
%prep
%setup -q
%patch0 -p1
%build
python doxybuild.py --doxygen=%{_bindir}/doxygen
# path needs to be exported otherwise unit tests will fail
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/build/lib
%cmake -DJSONCPP_LIB_BUILD_SHARED=ON
make %{?_smp_mflags}
%install
%cmake_install
%post -n lib%{name}1 -p /sbin/ldconfig
%postun -n lib%{name}1 -p /sbin/ldconfig
%files -n lib%{name}1
%defattr(-,root,root)
%doc LICENSE
%{_libdir}/lib%{name}.so.*
%files devel
%defattr(-,root,root)
%doc AUTHORS LICENSE NEWS.txt README.md
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/lib%{name}.so
%{_includedir}/json/
%files doc
%defattr(-,root,root)
%doc dist/doxygen/jsoncpp*
%changelog