#
# spec file for package libde265
#
# Copyright (c) 2017 Bjørn Lie, Bryne, Norway.
#
# 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.

%define so_ver 0

Name:           libde265
Version:        1.0.8
Release:        6.9
Summary:        Open H.265 video codec implementation
License:        LGPL-3.0
Group:          System/Libraries
Url:            http://www.libde265.org/
Source0:        https://github.com/strukturag/libde265/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source99:       baselibs.conf

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  c++_compiler
BuildRequires:  libtool
BuildRequires:  pkgconfig

%description
libde265 is an open source implementation of the H.265 video codec.
It is written from scratch for simplicity and efficiency. Its simple
API makes it easy to integrate it into other software.

%package -n %{name}-%{so_ver}
Group:          System/Libraries
Summary:        Open H.265 video codec implementation - libraries

%description -n %{name}-%{so_ver}
libde265 is an open source implementation of the H.265 video codec.
It is written from scratch for simplicity and efficiency. Its simple
API makes it easy to integrate it into other software.

This package contains the library files.

%package tools
Summary:        Binaries for %{name}-%{so_ver}
Requires:       %{name}-%{so_ver}

%description tools
Bunch of unnecessary cruft for %{name}-%{so_ver}

%package devel
Group:          Development/Libraries/Other
Summary:        Open H.265 video codec implementation - development files
Requires:       %{name}-%{so_ver} = %{version}

%description devel
libde265 is an open source implementation of the H.265 video codec.
It is written from scratch for simplicity and efficiency. Its simple
API makes it easy to integrate it into other software.

The development headers for compiling programs that use libde265
are provided by this package.

%prep
%autosetup -p1

%build
NOCONFIGURE=1 ./autogen.sh
%configure \
	--disable-static \
	--enable-shared \
	%{nil}
%make_build

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

%post -n %{name}-%{so_ver} -p /sbin/ldconfig
%postun -n %{name}-%{so_ver} -p /sbin/ldconfig

%files -n %{name}-%{so_ver}
%doc COPYING
%{_libdir}/%{name}.so.*

%files tools
%{_bindir}/*

%files devel
%doc AUTHORS README.md
%{_includedir}/%{name}/
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%changelog
* Mon Apr 20 2020 zaitor@opensuse.org
- Update to version 1.0.5:
  + Fixes in the CMake build system (NOMINMAX).
  + Support stdin/stdout as input/output in dec265.
  + More input stream error checking (vps_num_hrd_parameters).
- Changes from version 1.0.4:
  + Fix decoding of monochrome streams (needed for depth images in
    heif images).
  + Improved cmake build script.
- Drop libde265-use_new_FFMPEG_enum_names.patch and
  libde265-only_export_decoder_api.patch: Fixed upstream.
- Rebase libde265-disable_tools.patch.
- Pass --disable-encoder to configure, do not build binary encoder.
* Tue May  8 2018 zaitor@opensuse.org
- Update to version 1.0.3:
  + Fixes for compiler build problems.
  + Security fixes, mainly checking for corrupted input streams.
- Add debian and upstream patches:
  + libde265-only_export_decoder_api.patch
  + libde265-disable_tools.patch
  + libde265-use_new_FFMPEG_enum_names.patch
* Thu Nov 30 2017 zaitor@opensuse.org
- Add baselibs.conf, build 32bit support for x86_64.
* Sun Nov 26 2017 zaitor@opensuse.org
- Initial packaging for openSUSE.