GraphicsMagick/GraphicsMagick.spec

373 lines
10 KiB
RPMSpec
Raw Normal View History

2022-12-15 16:40:57 +00:00
%global _with_quantum_depth --with-quantum-depth=16
%global _enable_quantum_library_names --enable-quantum-library-names
%global libQ -Q16
# Disable automatic .la file removal
%global __brp_remove_la_files %nil
%if ! 0%{?flatpak}
%global perl 1
%endif
%global multilib_archs x86_64 %{ix86} ppc64 ppc64le ppc s390x s390 sparc64 sparcv9
# hack for older platforms/rpm-versions that do not support %%__isa_bits (like el5)
%ifarch %{multilib_archs}
2019-12-14 22:09:40 +08:00
%if ! 0%{?__isa_bits:1}
2022-12-15 16:40:57 +00:00
%ifarch x86_64 s390x ia64 ppc64 sparc64
2019-12-14 22:09:40 +08:00
%global __isa_bits 64
2022-12-15 16:40:57 +00:00
%else
%global __isa_bits 32
2019-12-14 22:09:40 +08:00
%endif
%endif
%endif
%global __provides_exclude_from ^%{_libdir}/GraphicsMagick-%{version}/.*\\.(la|so)$
2022-12-15 16:40:57 +00:00
Summary: An ImageMagick fork, offering faster image generation and better quality
Name: GraphicsMagick
Version: 1.3.38
Release: 2
2022-12-15 16:40:57 +00:00
License: MIT
Source0: http://downloads.sourceforge.net/sourceforge/graphicsmagick/GraphicsMagick-%{version}.tar.xz
Source1: urw-fonts-1.0.7pre44.tar.bz2
#S1 URL: http://svn.ghostscript.com/ghostscript/tags/urw-fonts-1.0.7pre44/ -- urw-fonts-2.4-16.el7.src.rpm
#S1 https://gitee.com/src-openeuler/urw-base35-fonts.git
Url: http://www.graphicsmagick.org/
Patch001: GraphicsMagick-1.3.16-multilib.patch
Patch002: GraphicsMagick-1.3.31-perl_linkage.patch
BuildRequires: bzip2-devel
BuildRequires: freetype-devel
BuildRequires: gcc-c++
BuildRequires: giflib-devel
BuildRequires: lcms2-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: librsvg2-devel
BuildRequires: libtiff-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: libwmf-devel
BuildRequires: libxml2-devel
BuildRequires: libX11-devel libXext-devel libXt-devel
BuildRequires: lpr
BuildRequires: make
BuildRequires: p7zip
%if 0%{?perl}
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker)
%endif
BuildRequires: xdg-utils
BuildRequires: xz-devel
BuildRequires: zlib-devel
## %%check stuff
BuildRequires: time
BuildRequires: libwebp-devel jbigkit-devel
# upgrade path for introduction of -doc subpkg in 1.3.19-4
Obsoletes: GraphicsMagick < 1.3.19-4
%global urw_font_bundle 1
%if 0%{?urw_font_bundle}
%global urw_font_path %{_datadir}/GraphicsMagick-%{version}/urw-fonts
%else
%global urw_font_path %{_datadir}/X11/fonts/urw-fonts
BuildRequires: urw-base35-fonts-legacy
Requires: urw-base35-fonts-legacy
%endif
2019-12-14 22:09:40 +08:00
%description
2022-12-15 16:40:57 +00:00
GraphicsMagick is a comprehensive image processing package which is initially
based on ImageMagick 5.5.2, but which has undergone significant re-work by
the GraphicsMagick Group to significantly improve the quality and performance
of the software.
2019-12-14 22:09:40 +08:00
%package devel
2022-12-15 16:40:57 +00:00
Summary: Libraries and header files for GraphicsMagick app development
Requires: %{name}%{?_isa} = %{version}-%{release}
2019-12-14 22:09:40 +08:00
%description devel
2022-12-15 16:40:57 +00:00
GraphicsMagick-devel contains the Libraries and header files you'll
need to develop GraphicsMagick applications. GraphicsMagick is an image
manipulation program.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
If you want to create applications that will use GraphicsMagick code or
APIs, you need to install GraphicsMagick-devel as well as GraphicsMagick.
You do not need to install it if you just want to use GraphicsMagick,
however.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
%if 0%{?perl}
2019-12-14 22:09:40 +08:00
%package perl
2022-12-15 16:40:57 +00:00
Summary: GraphicsMagick perl bindings
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
2019-12-14 22:09:40 +08:00
%description perl
2022-12-15 16:40:57 +00:00
Perl bindings to GraphicsMagick.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
Install GraphicsMagick-perl if you want to use any perl scripts that use
GraphicsMagick.
%endif
2019-12-14 22:09:40 +08:00
%package c++
2022-12-15 16:40:57 +00:00
Summary: GraphicsMagick Magick++ library (C++ bindings)
Requires: %{name}%{?_isa} = %{version}-%{release}
2019-12-14 22:09:40 +08:00
%description c++
2022-12-15 16:40:57 +00:00
This package contains the GraphicsMagick++ library, a C++ binding to the
GraphicsMagick graphics manipulation library.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
Install GraphicsMagick-c++ if you want to use any applications that use
GraphicsMagick++.
2019-12-14 22:09:40 +08:00
%package c++-devel
2022-12-15 16:40:57 +00:00
Summary: C++ bindings for the GraphicsMagick library
Requires: %{name}-c++%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
2019-12-14 22:09:40 +08:00
%description c++-devel
2022-12-15 16:40:57 +00:00
GraphicsMagick-devel contains the Libraries and header files you'll
need to develop GraphicsMagick applications using the Magick++ C++ bindings.
GraphicsMagick is an image manipulation program.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
If you want to create applications that will use Magick++ code
or APIs, you'll need to install GraphicsMagick-c++-devel, ImageMagick-devel and
GraphicsMagick.
You don't need to install it if you just want to use GraphicsMagick, or if you
want to develop/compile applications using the GraphicsMagick C interface,
however.
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
%package help
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < %{version}-%{release}
Summary: GraphicsMagick documentation and usage introduction
Obsoletes: GraphicsMagick < 1.3.19-4
BuildArch: noarch
%description help
GraphicsMagick documentation and usage introduction.
2019-12-14 22:09:40 +08:00
%prep
2022-12-15 16:40:57 +00:00
%setup -q
%if 0%{?urw_font_bundle}
mkdir -p urw-fonts
tar --directory=urw-fonts/ -xf %{SOURCE1}
rm -f urw-fonts/ChangeLog urw-fonts/README* urw-fonts/fonts*
%endif
%patch002 -p1 -b .perl_linkage
%patch001 -p1 -b .multilib
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
for f in ChangeLog.{2006,2008,2009,2012} NEWS.txt ; do
iconv -f iso-8859-2 -t utf8 < $f > $f.utf8
touch -r $f $f.utf8 ; mv -f $f.utf8 $f
done
# Avoid lib64 rpaths (FIXME: recheck this on newer releases)
2019-12-14 22:09:40 +08:00
%if "%{_libdir}" != "/usr/lib"
2022-12-15 16:40:57 +00:00
sed -i.rpath -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure
2019-12-14 22:09:40 +08:00
%endif
%build
2022-12-15 16:40:57 +00:00
%configure \
--enable-shared --disable-static \
--docdir=%{_pkgdocdir} \
--with-lcms2 \
--with-magick_plus_plus \
--with-modules \
%if 0%{?flatpak}
--without-perl \
%else
--with-perl \
--with-perl-options="INSTALLDIRS=vendor %{?perl_prefix}" \
%endif
%{?_with_quantum_depth} \
%{?_enable_quantum_library_names} \
--with-threads \
--with-wmf \
--with-x \
--with-xml \
--without-dps \
--without-gslib \
--with-gs-font-dir=%{urw_font_path}
2019-12-14 22:09:40 +08:00
%make_build
2022-12-15 16:40:57 +00:00
%if 0%{?perl}
2019-12-14 22:09:40 +08:00
%make_build perl-build
2022-12-15 16:40:57 +00:00
%endif
2019-12-14 22:09:40 +08:00
%install
%make_install
2022-12-15 16:40:57 +00:00
%if 0%{?perl}
2019-12-14 22:09:40 +08:00
%make_install -C PerlMagick
2022-12-15 16:40:57 +00:00
# perlmagick: fix perl path of demo files
2019-12-14 22:09:40 +08:00
%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
2022-12-15 16:40:57 +00:00
find %{buildroot} -name "*.bs" |xargs rm -fv
find %{buildroot} -name ".packlist" |xargs rm -fv
find %{buildroot} -name "perllocal.pod" |xargs rm -fv
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
ls -l %{buildroot}%{perl_vendorarch}/auto/Graphics/Magick/Magick.so
2019-12-14 22:09:40 +08:00
chmod 755 %{buildroot}%{perl_vendorarch}/auto/Graphics/Magick/Magick.so
2022-12-15 16:40:57 +00:00
# perlmagick: build files list
2019-12-14 22:09:40 +08:00
find %{buildroot}/%{_libdir}/perl* -type f -print \
2022-12-15 16:40:57 +00:00
| sed "s@^%{buildroot}@@g" > perl-pkg-files
2019-12-14 22:09:40 +08:00
find %{buildroot}%{perl_vendorarch} -type d -print \
| sed "s@^%{buildroot}@%dir @g" \
| grep -v '^%dir %{perl_vendorarch}$' \
2022-12-15 16:40:57 +00:00
| grep -v '/auto$' >> perl-pkg-files
2019-12-14 22:09:40 +08:00
if [ -z perl-pkg-files ] ; then
2022-12-15 16:40:57 +00:00
echo "ERROR: EMPTY FILE LIST"
2019-12-14 22:09:40 +08:00
exit -1
fi
2022-12-15 16:40:57 +00:00
%endif
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
rm -rfv %{buildroot}%{_datadir}/GraphicsMagick
# Keep config
rm -rfv %{buildroot}%{_datadir}/%{name}-%{version}/[a-b,d-z,A-Z]*
rm -fv %{buildroot}%{_libdir}/lib*.la
%if 0%{?urw_font_bundle}
mkdir -p %{buildroot}%{urw_font_path}/
install -p -m644 urw-fonts/* \
%{buildroot}%{urw_font_path}/
%endif
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
# fix multilib issues
%ifarch %{multilib_archs}
2019-12-14 22:09:40 +08:00
mv %{buildroot}%{_includedir}/GraphicsMagick/magick/magick_types.h \
%{buildroot}%{_includedir}/GraphicsMagick/magick/magick_types-%{__isa_bits}.h
cat >%{buildroot}%{_includedir}/GraphicsMagick/magick/magick_types.h <<EOF
#ifndef MAGICK_TYPES_MULTILIB
#define MAGICK_TYPES_MULTILIB
#include <bits/wordsize.h>
#if __WORDSIZE == 32
# include "magick/magick_types-32.h"
#elif __WORDSIZE == 64
# include "magick/magick_types-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif
#endif
2019-12-14 22:09:40 +08:00
EOF
%endif
%check
2022-12-15 16:40:57 +00:00
%if 0%{?perl}
make test -C PerlMagick ||:
%endif
time \
%make_build check ||:
# multilib hack only supports 32/64 bits for now
%ifarch %{multilib_archs}
%if ! (%{__isa_bits} == 32 || %{__isa_bits} == 64)
echo "multilib hack currently only supports 64/32 bits, not %{__isa_bits} (yet)"
exit 1
%endif
%endif
%ldconfig_scriptlets
2019-12-14 22:09:40 +08:00
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%post c++ -p /sbin/ldconfig
%postun c++ -p /sbin/ldconfig
%files
%dir %{_pkgdocdir}
%license %{_pkgdocdir}/Copyright.txt
2022-12-15 16:40:57 +00:00
%{_libdir}/libGraphicsMagick%{?libQ}.so.3*
%{_libdir}/libGraphicsMagickWand%{?libQ}.so.2*
2019-12-14 22:09:40 +08:00
%{_bindir}/[a-z]*
%{_libdir}/GraphicsMagick-%{version}/
%{_datadir}/GraphicsMagick-%{version}/
%files devel
%{_bindir}/GraphicsMagick-config
%{_bindir}/GraphicsMagickWand-config
%{_libdir}/libGraphicsMagick.so
%{_libdir}/libGraphicsMagickWand.so
%{_libdir}/pkgconfig/GraphicsMagick.pc
%{_libdir}/pkgconfig/GraphicsMagickWand.pc
%dir %{_includedir}/GraphicsMagick/
%{_includedir}/GraphicsMagick/magick/
%{_includedir}/GraphicsMagick/wand/
2022-12-15 16:40:57 +00:00
%ldconfig_scriptlets c++
2019-12-14 22:09:40 +08:00
%files c++
2022-12-15 16:40:57 +00:00
%{_libdir}/libGraphicsMagick++%{?libQ}.so.12*
2019-12-14 22:09:40 +08:00
%files c++-devel
%{_bindir}/GraphicsMagick++-config
%{_includedir}/GraphicsMagick/Magick++/
%{_includedir}/GraphicsMagick/Magick++.h
%{_libdir}/libGraphicsMagick++.so
%{_libdir}/pkgconfig/GraphicsMagick++.pc
2022-12-15 16:40:57 +00:00
%if 0%{?perl}
2019-12-14 22:09:40 +08:00
%files perl -f perl-pkg-files
%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
2022-12-15 16:40:57 +00:00
%endif
2019-12-14 22:09:40 +08:00
2022-12-15 16:40:57 +00:00
%files help
%dir %{_pkgdocdir}
%{_pkgdocdir}/ChangeLog*
%{_pkgdocdir}/*.txt
%{_pkgdocdir}/www/
%{_mandir}/man[145]/[a-z]*
%{_mandir}/man1/GraphicsMagick-config.*
%{_mandir}/man1/GraphicsMagickWand-config.*
%{_mandir}/man1/GraphicsMagick++-config.*
%{_mandir}/man3/*
2019-12-14 22:09:40 +08:00
%changelog
* Tue Jan 3 2023 caodongxia <caodongxia@h-partners.com> - 1.3.38-2
- Fix the x86 compilation failure of zbar caused by missing magic_types
2022-12-15 16:40:57 +00:00
* Tue Nov 1 2022 huyab<1229981468@qq.com> - 1.3.38-1
- update version to 1.3.38-1
2022-07-11 16:43:33 +08:00
* Mon Jul 11 2022 houyingchao <houyingchao@h-partners.com> - 1.3.30-9
- Fix CVE-2022-1270
2020-12-08 09:50:37 +08:00
* Mon Dec 07 2020 caodongxia <caodongxia@huawei.com> - 1.3.30-8
- fix CVE-2019-11473 CVE-2019-11474
* Sat Sep 19 2020 maminjie <maminjie1@huawei.com> - 1.3.30-7
- fix some CVEs: CVE-2018-18544 CVE-2019-7397 CVE-2019-11005 CVE-2019-11006
CVE-2019-11010 CVE-2019-12921 CVE-2020-10938 CVE-2020-12672
2020-01-23 11:56:57 +08:00
* Thu Jan 23 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.3.30-6
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:delete the jasper
2019-12-24 17:48:12 +08:00
* Tue Dec 24 2019 shijian<shijian16@huawei.com> - 1.3.30-5
- Type:cves
- ID:CVE-2019-11007.patch CVE-2019-11505.patch CVE-2019-11008.patch CVE-2019-11506.patch CVE-2019-11009.patch
- SUG:restart
- DESC: fix CVE-2019-11007.patch CVE-2019-11505.patch CVE-2019-11008.patch CVE-2019-11506.patch CVE-2019-11009.patch
2019-12-14 22:09:40 +08:00
* Fri Dec 13 2019 yangjian<yangjian79@huawei.com> - 1.3.30-4
- Package init