File mingw32-json-c.spec of Package mingw32-json-c

#
# spec file for package mingw32-json-c
#
# 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/
#


%define libname libjson-c
%define libsoname %{libname}2
%define oldlibname libjson
%define filename %{libname}-2.dll
%define dll_version 2
Name:           mingw32-json-c
Version:        0.12.1
Release:        0
Summary:        JSON implementation in C
License:        MIT
Group:          Development/Libraries/C and C++
Url:            https://github.com/json-c/json-c/
#Git-Clone	git://github.com/json-c/json-c
Source:         json-c-%{version}-nodoc.tar.gz
Patch0:         json-c-0.12.1-gcc7.patch
Patch10:        json-c-0.12-mingw.patch
#!BuildIgnore: post-build-checks
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-filesystem
%_mingw32_package_header_debug
BuildArch:      noarch

%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 mingw32-%{libsoname}
Summary:        JSON-C shared library
Group:          System/Libraries
Provides:       mingw32-%{oldlibname} = %{version}
Obsoletes:      mingw32-%{oldlibname} < %{version}

%description -n mingw32-%{libsoname}
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 mingw32-%{libname}-devel
Summary:        JSON parser (development files)
Group:          Development/Libraries/C and C++
Requires:       mingw32-%{libsoname} = %{version}
Provides:       mingw32-%{oldlibname}-devel = %{version}
Obsoletes:      mingw32-%{oldlibname}-devel < %{version}

%description -n mingw32-%{libname}-devel
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.

%_mingw32_debug_package

%prep
%setup -q -n json-c-%{version}
%patch -P 0 -p1
%patch -P 10

%build
autoreconf -f -i
echo "ac_cv_func_malloc_0_nonnull='yes'" >>%{_mingw32_cache}
echo "ac_cv_func_realloc_0_nonnull='yes'" >>%{_mingw32_cache}
echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw32_cache}
%{_mingw32_configure} \
	--enable-shared --disable-static
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
#
find %{buildroot} -type f -name "*.la" -delete -print
# create a compatibilty pkg-config file for software needing it
(cd %{buildroot}%{_mingw32_libdir}/pkgconfig && ln -s json-c.pc json.pc)

%files -n mingw32-%{libsoname}
%defattr(-, root, root)
%{_mingw32_bindir}/%{filename}
%doc COPYING

%files -n mingw32-%{libname}-devel
%defattr(-, root, root)
%{_mingw32_includedir}/json-c/
%{_mingw32_libdir}/%{libname}.dll.a
%{_mingw32_libdir}/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by