and use update-alternatives for selecting configurations.
OBS-URL: https://build.opensuse.org/package/show/graphics/ImageMagick?expand=0&rev=417
This commit is contained in:
parent
1e7f7887e8
commit
63be6bc53f
@ -8,6 +8,7 @@ Thu Feb 28 11:44:05 UTC 2019 - pgajdos@suse.com
|
||||
* ImageMagick-config-SUSE (preferred)
|
||||
- provides configuration provided by SUSE (with security
|
||||
restrictions)
|
||||
and use update-alternatives for selecting configurations.
|
||||
- deleted patches
|
||||
- ImageMagick-disable-insecure-coders.patch (renamed)
|
||||
- added patches
|
||||
|
114
ImageMagick.spec
114
ImageMagick.spec
@ -27,7 +27,8 @@
|
||||
%define cwandver 6
|
||||
%define cxxlibver 4
|
||||
%define libspec -%{maj}_Q%{quantum_depth}HDRI
|
||||
%define config_dir ImageMagick%{libspec}%{clibver}
|
||||
%define config_dir ImageMagick-7
|
||||
%define config_spec config-7
|
||||
# bsc#1088463
|
||||
%define urw_base35_fonts 0
|
||||
|
||||
@ -171,7 +172,7 @@ Summary: C runtime library for ImageMagick
|
||||
Group: Productivity/Graphics/Other
|
||||
Recommends: ghostscript
|
||||
Suggests: %{name}-extra = %{version}
|
||||
Requires: imagick-config = %{version}
|
||||
Requires: imagick-%{config_spec} = %{version}
|
||||
Recommends: %{name}-config-SUSE = %{version}
|
||||
|
||||
%package -n libMagickWand%{libspec}%{cwandver}
|
||||
@ -201,32 +202,19 @@ Group: Documentation/HTML
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
%package config-upstream
|
||||
%package %{config_spec}-upstream
|
||||
Summary: Upstream Configuration Files
|
||||
Group: Development/Libraries/C and C++
|
||||
Provides: imagick-config = %{version}
|
||||
Conflicts: %{name}-config-SUSE
|
||||
Provides: imagick-%{config_spec}
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
|
||||
%description config-upstream
|
||||
ImageMagick configuration as provided by upstream. It does not
|
||||
provide any security restrictions. ImageMagick will be vulnerable
|
||||
for example by ImageTragick or PS/PDF coder issues. It should
|
||||
be used in trusted environment. Version or maintenance updates
|
||||
will not overwrite user changes in system configuration.
|
||||
|
||||
%package config-SUSE
|
||||
%package %{config_spec}-SUSE
|
||||
Summary: Upstream Configuration Files
|
||||
Group: Development/Libraries/C and C++
|
||||
Provides: imagick-config = %{version}
|
||||
Conflicts: %{name}-config-upstream
|
||||
|
||||
%description config-SUSE
|
||||
ImageMagick configuration as provide by SUSE. It is more security
|
||||
aware than config-upstream variant. It does disable some coders,
|
||||
that are insecure by design to prevent user to use them
|
||||
inadvertently. Configuration can be subject of change by future
|
||||
version and maintenance updates and system changes will not be
|
||||
preserved.
|
||||
Provides: imagick-%{config_spec}
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
|
||||
%description
|
||||
ImageMagick is a robust collection of tools and libraries to read,
|
||||
@ -326,6 +314,22 @@ support multiple generations of an image in memory at one time.
|
||||
%description doc
|
||||
HTML documentation for ImageMagick library and scene examples.
|
||||
|
||||
%description %{config_spec}-upstream
|
||||
ImageMagick configuration as supplied by upstream. It does not
|
||||
provide any security restrictions. ImageMagick will be vulnerable
|
||||
for example by ImageTragick or PS/PDF coder issues. It should
|
||||
be used in trusted environment. Version or maintenance updates
|
||||
will not overwrite user changes in system configuration.
|
||||
|
||||
%description %{config_spec}-SUSE
|
||||
ImageMagick configuration as provide by SUSE. It is more security
|
||||
aware than config-upstream variant. It does disable some coders,
|
||||
that are insecure by design to prevent user to use them
|
||||
inadvertently. Configuration can be subject of change by future
|
||||
version and maintenance updates and system changes will not be
|
||||
preserved.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n ImageMagick-%{source_version}
|
||||
%patch2 -p1
|
||||
@ -344,7 +348,6 @@ sed -i 's:\.t1:.otf:' config/type-urw-base35.xml.in
|
||||
# make library binary package parallel installable
|
||||
export MODULES_DIRNAME="modules%{libspec}%{clibver}"
|
||||
export SHAREARCH_DIRNAME="config%{libspec}%{clibver}"
|
||||
export CONFIGURE_RELATIVE_PATH="%{config_dir}"
|
||||
%if %{debug_build}
|
||||
export CFLAGS="%{optflags} -O0"
|
||||
export CXXFLAGS="%{optflags} -O0"
|
||||
@ -396,9 +399,6 @@ make -j1 perl-build
|
||||
# mostly because */demo is used later with %check
|
||||
# polutting dir with .libs etc.
|
||||
cp -r Magick++/demo Magick++/examples
|
||||
%if 0%{?suse_version} < 1315
|
||||
rm -r Magick++/examples/.deps
|
||||
%endif
|
||||
cp -r PerlMagick/demo PerlMagick/examples
|
||||
# other improvements
|
||||
chmod -x PerlMagick/demo/*.pl
|
||||
@ -442,6 +442,8 @@ mv -t %{buildroot}%{_sysconfdir}/%{name}* %{buildroot}%{_datadir}/%{name}*/*.xml
|
||||
mv %{buildroot}%{_sysconfdir}/%{config_dir}{,-upstream}
|
||||
cp -r %{buildroot}%{_sysconfdir}/%{config_dir}{-upstream,-SUSE}
|
||||
patch --dir %{buildroot}%{_sysconfdir}/%{config_dir}-SUSE < %{PATCH0}
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
|
||||
ln -sf %{_sysconfdir}/alternatives/%{config_dir} %{buildroot}%{_sysconfdir}/%{config_dir}
|
||||
# symlink header file relative to /usr/include/ImageMagick-7/
|
||||
# so that inclusions like wand/*.h and magick/*.h work
|
||||
ln -s ./MagickCore %{buildroot}%{_includedir}/%{name}-%{maj}/magick
|
||||
@ -469,22 +471,23 @@ sed -i 's:%{buildroot}::' %{buildroot}/%{_libdir}/ImageMagick-%{mfr_version}/con
|
||||
%post -n libMagick++%{libspec}%{cxxlibver} -p /sbin/ldconfig
|
||||
%postun -n libMagick++%{libspec}%{cxxlibver} -p /sbin/ldconfig
|
||||
|
||||
%post config-upstream
|
||||
ln -sf %{_sysconfdir}/%{config_dir}-upstream %{_sysconfdir}/%{config_dir}
|
||||
%post %{config_spec}-upstream
|
||||
%{_sbindir}/update-alternatives --install %{_sysconfdir}/%{config_dir} %{config_dir} %{_sysconfdir}/%{config_dir}-upstream 1
|
||||
|
||||
%postun config-upstream
|
||||
rm -f %{_sysconfdir}/%{config_dir}
|
||||
%postun %{config_spec}-upstream
|
||||
if [ ! -d %{_sysconfdir}/%{config_dir}-upstream ] ; then
|
||||
%{_sbindir}/update-alternatives --remove %{config_dir} %{_sysconfdir}/%{config_dir}-upstream
|
||||
fi
|
||||
|
||||
%post config-SUSE
|
||||
ln -sf %{_sysconfdir}/%{config_dir}-SUSE %{_sysconfdir}/%{config_dir}
|
||||
%post %{config_spec}-SUSE
|
||||
%{_sbindir}/update-alternatives --install %{_sysconfdir}/%{config_dir} %{config_dir} %{_sysconfdir}/%{config_dir}-SUSE 10
|
||||
|
||||
%postun config-SUSE
|
||||
rm -f %{_sysconfdir}/%{config_dir}
|
||||
%postun %{config_spec}-SUSE
|
||||
if [ ! -d %{_sysconfdir}/%{config_dir}-SUSE ] ; then
|
||||
%{_sbindir}/update-alternatives --remove %{config_dir} %{_sysconfdir}/%{config_dir}-SUSE
|
||||
fi
|
||||
|
||||
%files
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%license LICENSE
|
||||
%doc ChangeLog NEWS.txt
|
||||
%{_bindir}/[^MW]*
|
||||
@ -492,9 +495,6 @@ rm -f %{_sysconfdir}/%{config_dir}
|
||||
%exclude %{_mandir}/man1/*-config.1%{ext_man}
|
||||
|
||||
%files -n libMagickCore%{libspec}%{clibver}
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%license LICENSE
|
||||
%doc ChangeLog NEWS.txt
|
||||
%{_libdir}/libMagickCore*.so.%{clibver}*
|
||||
@ -514,16 +514,10 @@ rm -f %{_sysconfdir}/%{config_dir}
|
||||
%{_libdir}/ImageMagick*/config*
|
||||
|
||||
%files -n libMagickWand%{libspec}%{cwandver}
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%{_libdir}/libMagickWand*.so.%{cwandver}*
|
||||
|
||||
%if !%{debug_build}
|
||||
%files extra
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%{_libdir}/ImageMagick*/modules*/*/wmf.so
|
||||
# don't remove la files, see bnc#579798
|
||||
%if 0%{?suse_version} > 1315
|
||||
@ -535,9 +529,6 @@ rm -f %{_sysconfdir}/%{config_dir}
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%{_libdir}/libMagickCore*.so
|
||||
%{_libdir}/libMagickWand*.so
|
||||
%dir %{_includedir}/ImageMagick*
|
||||
@ -554,28 +545,16 @@ rm -f %{_sysconfdir}/%{config_dir}
|
||||
%exclude %{_mandir}/man1/Magick++-config.1%{ext_man}
|
||||
|
||||
%files -n perl-PerlMagick
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%doc PerlMagick/README.txt
|
||||
%doc PerlMagick/examples
|
||||
%{_mandir}/man3/*
|
||||
%{perl_vendorarch}/auto/Image
|
||||
%{perl_vendorarch}/Image
|
||||
%if 0%{?suse_version} < 1315
|
||||
%{_localstatedir}/adm/perl-modules/ImageMagick
|
||||
%endif
|
||||
|
||||
%files -n libMagick++%{libspec}%{cxxlibver}
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%{_libdir}/libMagick++*.so.%{cxxlibver}*
|
||||
|
||||
%files -n libMagick++-devel
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%doc Magick++/examples
|
||||
%doc Magick++/NEWS Magick++/README Magick++/AUTHORS
|
||||
%{_libdir}/libMagick++*.so
|
||||
@ -586,17 +565,18 @@ rm -f %{_sysconfdir}/%{config_dir}
|
||||
%{_mandir}/man1/Magick++-config.1%{ext_man}
|
||||
|
||||
%files doc
|
||||
%if 0%{?suse_version} < 1315
|
||||
%defattr(-,root,root)
|
||||
%endif
|
||||
%{_defaultdocdir}/%{name}-%{maj}
|
||||
|
||||
%files config-upstream
|
||||
%files %{config_spec}-upstream
|
||||
%dir %{_sysconfdir}/ImageMagick*-upstream/
|
||||
%config(noreplace) %{_sysconfdir}/ImageMagick*-upstream/*
|
||||
%{_sysconfdir}/%{config_dir}
|
||||
%ghost %{_sysconfdir}/alternatives/%{config_dir}
|
||||
|
||||
%files config-SUSE
|
||||
%files %{config_spec}-SUSE
|
||||
%dir %{_sysconfdir}/ImageMagick*-SUSE/
|
||||
%config %{_sysconfdir}/ImageMagick*-SUSE/*
|
||||
%{_sysconfdir}/%{config_dir}
|
||||
%ghost %{_sysconfdir}/alternatives/%{config_dir}
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user