Name:		exempi
Version:	2.4.5
Release:	5
Summary:	Exempi is an implementation of XMP (Adobe's Extensible Metadata Platform)
License:	BSD
URL:		https://wiki.freedesktop.org/libopenraw/Exempi/
Source0:	http://libopenraw.freedesktop.org/download/%{name}-%{version}.tar.bz2

Patch6000:	CVE-2018-12648-Issue-9-Fix-null-pointer-dereference-CVE-2018-12648.patch

#https://gitlab.freedesktop.org/libopenraw/exempi/issues/13
#https://gitlab.freedesktop.org/libopenraw/exempi/commit/fdd4765a699f9700850098b43b9798b933acb32f
Patch6001:      0001-Issue-13-Fix-a-buffer-a-overflow-in-ID3-support.patch
#https://gitlab.freedesktop.org/libopenraw/exempi/commit/acee2894ceb91616543927c2a6e45050c60f98f7
#https://gitlab.freedesktop.org/libopenraw/exempi/issues/12
Patch6002:      0002-Bug-12-Invalid-WebP-cause-memory-overflow.patch
Patch6003:      202107.patch
Patch6004:      202108-1.patch
Patch6005:      202108-2.patch

BuildRequires:	gcc-c++ autoconf automake libtool
BuildRequires:	boost-devel expat-devel zlib-devel pkgconfig
Provides:	bundled(md5-polstra)

%description
Exempi is an implementation of XMP.
Version 2.x is based on Adobe XMP SDK and released under a BSD-style license like Adobe's.

%package devel
Summary:	exempi's development files
Requires:	%{name} = %{version}-%{release}
Requires:	pkgconfig

%description devel
this package provides development files, including headers and libraries.

%package help
Summary:	Help information for user

%description help
Help information for user

%prep
%autosetup -n exempi-2.4.5 -p1

%build
libtoolize -vi
./autogen.sh
%configure CPPFLAGS="-I%{_includedir} -fno-strict-aliasing -DBanAllEntityUsage=1"
# Disable rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build

%check
make check

%install
%make_install

%files
%doc AUTHORS ChangeLog COPYING README
%{_libdir}/*.so.*
%{_bindir}/exempi

%files devel
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/exempi-2.0/
%exclude %{_libdir}/*.a
%exclude %{_libdir}/*.la

%files help
%{_mandir}/man1/exempi.1*

%changelog
* Wed Sep 20 2023 dillon chen <dillon.chen@gmail.com> - 2.4.5-5
- CVE-2020-18651,CVE-2020-18652
- CVE-2021-36048,CVE-2021-39847,CVE-2021-42530,CVE-2021-36046,CVE-2021-36055
- CVE-2021-40716,CVE-2018-12648,CVE-2021-36054,CVE-2021-36047,CVE-2021-36052
- CVE-2021-36058,CVE-2021-36045,CVE-2021-42531,CVE-2021-36064,CVE-2021-42529
- CVE-2021-42528,CVE-2021-36050,CVE-2021-40732
- CVE-2021-36056,CVE-2021-42532,CVE-2021-36053,CVE-2021-36051

* Fri Sep 06 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.4.5-4
- Package init
