#
# spec file for package libyaml
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           libyaml
Version:        0.2.5
Release:        1.5
Summary:        A YAML parser and emitter written in C
License:        MIT
Group:          Development/Libraries/C and C++
URL:            https://pyyaml.org/wiki/LibYAML
Source:         http://pyyaml.org/download/libyaml/yaml-%{version}.tar.gz
BuildRequires:  pkgconfig

%description
A YAML parser and emitter written in C

%define lib_name libyaml-0-2

%package -n %{lib_name}
Summary:        A YAML parser and emitter written in C
Group:          System/Libraries

%description -n %{lib_name}
This package holds the shared library of libyaml.

%package devel
Summary:        Development files for libyaml
Group:          Development/Libraries/C and C++
Requires:       %{lib_name} = %{version}

%description devel
This package holds the development files for libyaml,
a YAML parser and emitter written in C.

%prep
%setup -q -n yaml-%{version}

%build
%configure --disable-static
%make_build

%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print

%check
%make_build check

%post   -n %{lib_name} -p /sbin/ldconfig
%postun -n %{lib_name} -p /sbin/ldconfig

%files -n %{lib_name}
%{_libdir}/libyaml-0.so.2
%{_libdir}/libyaml-0.so.2.0.*

%files devel
%{_includedir}/yaml.h
%{_libdir}/libyaml.so
%{_libdir}/pkgconfig/yaml-0.1.pc

%changelog
* Sat Aug 15 2020 Dirk Mueller <dmueller@suse.com>
- update to 0.2.5:
  * Allow question marks in plain scalars in flow collections
  * Emitter: Don't output trailing space for empty scalar nodes
  * Emitter: Output space after an alias mapping key
  * Add -h and --flow (on|off|keep) to run-*-test-suite
  * Remove unnecessary include and malloc
  * Add specific files back to .gitignore
  * Output error position in run-parser-test-suite.c
  * A couple patches to improve test suite support
* Mon Apr 20 2020 Paolo Stivanin <info@paolostivanin.com>
- update to 0.2.4
  * Support %%YAML 1.2 directives
  * Multiple fixes
* Wed Jul 31 2019 Tina Müller <tina.mueller@suse.com>
- Remove patch
  * Patch libyaml-revert-emitter-changes.patch is not needed anymore
* Thu Apr 18 2019 Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.2.2
- refreshed libyaml-revert-emitter-changes.patch
  * Fix comparison in tests/run-emitter.c
  * Allow colons in plain scalars inside flow collections
  * The closing single quote needs to be indented...
  * Revert removing of open_ended after top level plain scalar
* Mon Jan 28 2019 Jan Engelhardt <jengelh@inai.de>
- --with-pic is useless without static libs, remove it.
- Update RPM groups and descriptions.
* Thu Jan 17 2019 bjorn.lie@gmail.com
- Add libyaml-revert-emitter-changes.patch: Revert "This code is
  not needed and breaks tests" (gh#yaml/libyaml#122).
* Tue Dec  4 2018 Ondřej Súkup <mimi.vx@gmail.com>
- update to 0.2.1
  * Fixed most compiler warnings -Wall -Wextra
  * Support static and dynamic libraries
  * Add support for `make test`
  * Apply old fix for `\/` that is not in master.
  * Port bug fix from Perl binding
  * Removed trailing-whitespaces
  * Fix -Wformat compilation errors in tests
  * Added missing Cflags path in pkg-config file
  * Forbid escaped singlequote in doublequotes
* Sun Dec 31 2017 avindra@opensuse.org
- update to 0.1.7
  * Fixed segfault in yaml_string_write_handler
  * Fixed invalid simple key assertion (CVE-2014-9130)
  * Fixed error handling in some examples
- remove CVE-2014-9130.patch
  - fixed upstream in 946596172d140497b560e016e581accb0a92cca4
- cleanup spec file with spec-cleaner
* Wed Dec  3 2014 jmassaguerpla@suse.com
- fix CVE-2014-9130: libyaml: assert failure when processing
  wrapped strings (bnc#907809)
  CVE-2014-9130.patch contains the fix
* Fri Mar 28 2014 jmassaguerpla@suse.com
- update to 0.1.6 is a security update release for:
  * CVE-2014-2525: heap overflow during parsing (bnc#868944)
  bnc#860617)
* Fri Feb  7 2014 dmueller@suse.com
- update to 0.1.5:
  * Manually define PTRDIFF_MAX for VS C compiler
  * Limit input size to SIZE_MAX/2
  * Guard against overflows in indent and flow_level (CVE-2013-6393, bnc#860617)
  * Prevent node index overflow (Reported by Florian Weimer).
  * Fixed invalid size_t->int cast (Thank to Florian Weimer).
* Tue Mar 26 2013 dmueller@suse.com
- update to 0.1.4:
  * documentation update
  * add pkgconfig support
* Sun Jan 29 2012 jengelh@medozas.de
- Remove redundant tags/sections per specfile guideline suggestions
* Wed Feb  9 2011 pascal.bleser@opensuse.org
- fixed erroneous license from GPLv2 to MIT, bnc#670525
* Tue Apr  6 2010 mrueckert@suse.de
- initial package of version 0.1.3