json-c/json-c.spec

115 lines
3.0 KiB
RPMSpec

#
# spec file for package json-c
#
# Copyright (c) 2011 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/
#
# norootforbuild
%define libname libjson
%define libsoname %{libname}0
Name: json-c
Summary: JSON implementation in C
Version: 0.9
Release: 1
License: MIT
Group: System/Libraries
Url: http://oss.metaparadigm.com/%{name}
Source0: http://oss.metaparadigm.com/json-c/json-c-0.9.tar.gz
Source1: baselibs.conf
Patch0: %{name}-0.9-base.patch
Patch1: %{name}-0.9-json_object_from_file.patch
Patch2: %{name}-0.9-json_tokener.patch
Patch3: %{name}-0.9-linkhash.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pkg-config
%description
JSON-C implements a reference counting object model that allows you to
easily construct JSON objects in C, output them as JSON formatted
strings and parse JSON formatted strings back into the C
representation of JSON objects.
%package -n %{libsoname}
Summary: JSON shared lib
Group: System/Libraries
%description -n %{libsoname}
This package includes the JSON library.
%package -n %{libname}-devel
Summary: Development headers and libraries for json-c
Group: Development/Libraries/C and C++
Requires: %{libsoname} = %{version}
%description -n %{libname}-devel
This package includes header files and scripts needed for developers
using the json-c library
%package -n %{libname}-doc
Summary: Dokumentation files
Group: Documentation/Other
%if 0%{suse_version} >= 1120
BuildArch: noarch
%endif
%description -n %{libname}-doc
This package includes alls docs
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
autoreconf -fi
%configure --disable-static --with-pic
%{__make} %{?_smp_mflags}
%check
%{__make} %{?_smp_mflags} check
%install
make DESTDIR=$RPM_BUILD_ROOT install libdir=%{_libdir} mandir=%{_mandir}
%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%files -n %{libsoname}
%defattr(-,root,root)
%{_libdir}/%{libname}.so.*
%files -n %{libname}-devel
%defattr(-,root,root)
%{_libdir}/%{libname}.so
%{_libdir}/%{libname}.*a
%{_includedir}/json
%{_libdir}/pkgconfig/*.pc
%files -n %{libname}-doc
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README README.html doc
%changelog