freeimage/freeimage.spec

150 lines
5.7 KiB
RPMSpec
Raw Normal View History

2020-11-09 17:38:53 +08:00
%undefine _ld_as_needed
%define major 3
2020-06-25 15:42:53 +08:00
Name: freeimage
Version: 3.18.0
Release: 11
2020-06-25 15:42:53 +08:00
Summary: FreeImage is a library project for developers who would like to support popular graphics image formats (PNG, JPEG, TIFF, BMP and others)
License: GPLv2 or GPLv3 and FIPL
URL: https://freeimage.sourceforge.io/
Source0: http://downloads.sourceforge.net/freeimage/FreeImage3180.zip
2020-11-09 17:38:53 +08:00
Patch0: CVE-2019-12211_2019-12213.patch
2020-06-25 15:42:53 +08:00
2020-09-10 19:42:53 +08:00
# https://github.com/glennrp/libpng/commit/32784523239c376dfe544bb6c7012c4934624a6d
2020-11-09 17:38:53 +08:00
Patch1: fix-libpng-arm-neon.patch
Patch2: FreeImage_unbundle.patch
# Fix incorrect path in doxyfile
Patch3: FreeImage_doxygen.patch
# Fix incorrect variable names in BIGENDIAN blocks
Patch4: FreeImage_bigendian.patch
2020-12-15 15:14:22 +08:00
Patch5: substream.patch
Patch6: Fix-build-failure-with-OpenEXR-3.0.patch
Patch7: freeimage-libtiff45.patch
Patch8: Fix-build-failure-with-LibRaw-0.21.1.patch
# https://sources.debian.org/src/freeimage/3.18.0%2Bds2-10/debian/patches/
Patch9: CVE-2020-21427-pre-r1830-minor-refactoring.patch
Patch10: CVE-2020-21427-1-r1832-improved-BMP-plugin-when-working-with-malicious-images.patch
Patch11: CVE-2020-21428-r1877-improved-DDS-plugin-against-malicious-images.patch
Patch12: CVE-2020-21427-2-r1836-improved-BMP-plugin-when-working-with-malicious-images.patch
Patch13: CVE-2020-22524-r1848-improved-PFM-plugin-against-malicious-images.patch
2020-11-09 17:38:53 +08:00
BuildRequires: doxygen gcc-c++ make jxrlib-devel libjpeg-devel libmng-devel libpng-devel libtiff-devel libwebp-devel LibRaw-devel OpenEXR-devel openjpeg2-devel
2020-09-10 19:42:53 +08:00
2020-06-25 15:42:53 +08:00
%description
FreeImage is a library project for developers who would like to support popular graphics image formats (PNG, JPEG, TIFF, BMP and others). Some highlights are: extremely simple in use, not limited to the local PC (unique FreeImageIO) and Plugin driven!
%package devel
Summary: FreeImage is a library project for developers who would like to support popular graphics image formats (PNG, JPEG, TIFF, BMP and others)
Requires: %{name} = %{version}-%{release}
%description devel
FreeImage is a library project for developers who would like to support popular graphics image formats (PNG, JPEG, TIFF, BMP and others). Some highlights are: extremely simple in use, not limited to the local PC (unique FreeImageIO) and Plugin driven!
%prep
2020-12-15 15:14:22 +08:00
%autosetup -p1 -n FreeImage
2020-11-09 17:38:53 +08:00
# remove all included libs to make sure these don't get used during compile
rm -r Source/Lib* Source/ZLib Source/OpenEXR
# clear files which cannot be built due to dependencies on private headers
# (see also unbundle patch)
> Source/FreeImage/PluginG3.cpp
> Source/FreeImageToolkit/JPEGTransform.cpp
# sanitize encodings / line endings
for file in `find . -type f -name '*.c' -or -name '*.cpp' -or -name '*.h' -or -name '*.txt' -or -name Makefile`; do
iconv --from=ISO-8859-15 --to=UTF-8 $file > $file.new && \
sed -i 's|\r||g' $file.new && \
touch -r $file $file.new && mv $file.new $file
done
2020-06-25 15:42:53 +08:00
%build
2020-11-09 17:38:53 +08:00
sh ./gensrclist.sh
sh ./genfipsrclist.sh
%ifarch %{power64} %{mips32} aarch64
%make_build -f Makefile.gnu CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LDFLAGS="%{__global_ldflags}"
%make_build -f Makefile.fip CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC" LDFLAGS="%{__global_ldflags}"
%else
%make_build -f Makefile.gnu CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
%make_build -f Makefile.fip CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
%endif
2020-06-25 15:42:53 +08:00
pushd Wrapper/FreeImagePlus/doc
doxygen FreeImagePlus.dox
popd
%install
install -Dpm 755 Dist/lib%{name}-%{version}.so %{buildroot}%{_libdir}/lib%{name}-%{version}.so
ln -s lib%{name}-%{version}.so %{buildroot}%{_libdir}/lib%{name}.so
install -Dpm 755 Dist/lib%{name}plus-%{version}.so %{buildroot}%{_libdir}/lib%{name}plus-%{version}.so
ln -s lib%{name}plus-%{version}.so %{buildroot}%{_libdir}/lib%{name}plus.so
install -Dpm 644 Source/FreeImage.h %{buildroot}%{_includedir}/FreeImage.h
install -Dpm 644 Wrapper/FreeImagePlus/FreeImagePlus.h %{buildroot}%{_includedir}/FreeImagePlus.h
# install missing symlink (was giving no-ldconfig-symlink rpmlint errors)
ldconfig -n %{buildroot}%{_libdir}
%pre
%preun
%post
%postun
%check
%files
%license license-*.txt
%doc README.linux README.md Whatsnew.txt
%{_libdir}/lib%{name}-%{version}.so
%{_libdir}/lib%{name}.so.*
%{_libdir}/lib%{name}plus-%{version}.so
%{_libdir}/lib%{name}plus.so.*
%files devel
%doc Examples Wrapper/FreeImagePlus/html
%{_includedir}/FreeImage.h
%{_libdir}/lib%{name}.so
%{_includedir}/FreeImagePlus.h
%{_libdir}/lib%{name}plus.so
%changelog
* Mon Dec 04 2023 wangkai <13474090681@163.com> - 3.18.0-11
- Fix CVE-2020-21427,CVE-2020-21428,CVE-2020-22524
* Wed Jul 5 2023 liyanan <thistleslyn@163.com> - 3.18.0-10
- Fix compilation failure caused by LibRaw upgrade
* Mon Feb 13 2023 wulei <wulei80@h-partners.com> - 3.18.0-9
- Add patch for libtiff-4.5.0 comptability
* Wed Aug 24 2022 caodongxia <caodongxia@h-partners.com> -3.18.0-8
- Add debug package to add strip
* Tue Mar 01 2022 weidong <weidong@uniontech.com> -3.18.0-7
- Fix build error
2021-02-09 16:56:01 +08:00
* Tue Feb 09 2021 Jiachen Fan <fanjiachen3@huawei.com> -3.18.0-6
- correct the substream.patch: correct the line
* Wed Dec 16 2020 Senlin <xiasenlin1@huawei.com> -3.18.0-5
- correct the substream.patch: add an empty line at end of file
2020-12-15 15:14:22 +08:00
* Tue Dec 15 2020 Senlin <xiasenlin1@huawei.com> -3.18.0-4
- Rebuild for new LibRaw
2020-11-09 17:38:53 +08:00
* Mon Nov 09 2020 weidong <weidong@uniontech.com>
- Unbundle bundled libraries
- Fix incorrect path in doxyfile
- Fix incorrect variable names in BIGENDIAN blocks
2020-09-10 19:42:53 +08:00
* Thu Sep 10 2020 weidong <weidong@uniontech.com>
- fix libpng arm neon in freeimage
2020-06-25 15:42:53 +08:00
* Mon May 4 2020 Wei Xiong <myeuler@163.com>
- Package init