File inkscape.spec of Package inkscape.14974

#
# spec file for package inkscape
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           inkscape
Version:        0.92.2
Release:        0
Summary:        Vector Illustration Program
License:        GPL-2.0 and LGPL-2.1
Group:          Productivity/Graphics/Vector Editors
Url:            http://www.inkscape.org/
Source:         https://inkscape.global.ssl.fastly.net/media/resources/file/%{name}-%{version}.tar.bz2
# openSUSE palette file
Source1:        openSUSE.gpl
Source2:        inkscape-split-extensions-extra.sh
# PATCH-FIX-OPENSUSE inkscape-packages.patch sbrabec@suse.cz -- Suggest packages instead of compilation from source.
Patch0:         inkscape-packages.patch
# PATCH-FIX-UPSTREAM inkscape-poppler058-fix.patch lp#1715820 zaitor@opensuse.org -- Adapt to poppler 0.58
Patch1:         inkscape-poppler058-fix.patch
# PATCH-FIX-UPSTREAM alarrosa@suse.com -- Fixes from upstream to support newer poppler releases
Patch2:         0001-Fix-compilation-with-poppler-0.64.patch
Patch3:         0002-Fix-compilation-with-poppler-0.65.patch
Patch4:         0003-Modified-fix-for-compatibility-with-poppler-0.64.patch
Patch5:         0004-fix-1789208-poppler-0.69.patch
Patch6:         0005-fix-poppler-0.71.0-build.patch
Patch7:         0006-fix-poppler-0.72.0-build.patch
Patch8:         0007-Tentative-fix-for-poppler-0.76.patch


BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gtkspell-devel
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  fdupes
BuildRequires:  gc-devel
BuildRequires:  gcc-c++
BuildRequires:  gnome-vfs2-devel
BuildRequires:  gsl-devel
BuildRequires:  gtkmm24-devel
BuildRequires:  intltool
# Disabling IM until inkscape upstream supports IM7
#BuildRequires:  libMagick++-devel
BuildRequires:  liblcms2-devel
BuildRequires:  libpoppler-glib-devel
BuildRequires:  libtool
BuildRequires:  libxslt-devel
BuildRequires:  perl
BuildRequires:  popt-devel
BuildRequires:  potrace-devel
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
BuildRequires:  python2-xml
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(libexif)
%if 0%{?suse_version} > 1310
BuildRequires:  pkgconfig(libcdr-0.1)
BuildRequires:  pkgconfig(libvisio-0.1)
%endif
BuildRequires:  pkgconfig(librevenge-0.0)
BuildRequires:  pkgconfig(libwpg-0.3)
Requires:       %{_bindir}/gs
Requires:       ghostscript-fonts-std
Requires:       gzip
Requires:       pstoedit
Requires:       python-gtk
Recommends:     %{name}-lang
Recommends:     python-lxml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Inkscape is a vector illustration program for the GNOME desktop.

%package extensions-extra
Summary:        Vector Illustration Program - Extra Extensions
Group:          Productivity/Graphics/Vector Editors
Requires:       %{name} = %{version}
# ps2pdf-ext.py is a wrapper around ps2pdf, which lives in ghostscript package.
Requires:       ghostscript
Requires:       python-lxml
Requires:       python-xml
# for cdr and wmf modules
Recommends:     yudit
Enhances:       %{name}
# python-xml is already likely installed, so the big dependency is python-lxml. Hence this supplements.
Supplements:    packageand(%{name}:python-lxml)
# Package in openSUSE <= 11.0 and SLED <= 10
Provides:       %{name}:%{_datadir}/inkscape/extensions/inkex.py

%description extensions-extra
Extra extensions for Inkscape. Recommended for everybody who wants to
use Inkscape.

Inkscape is a vector illustration program for the GNOME desktop.

%package extensions-dia
Summary:        Vector Illustration Program - Dia Import Extension
Group:          Productivity/Graphics/Vector Editors
Requires:       %{name} = %{version}
Requires:       dia
Enhances:       %{name}
Supplements:    packageand(%{name}:dia)
# Package in openSUSE <= 11.0 and SLED <= 10
Provides:       %{name}:%{_datadir}/inkscape/extensions/dia.inx

%description extensions-dia
Dia import extension for Inkscape.

Inkscape is a vector illustration program for the GNOME desktop.

%package extensions-fig
Summary:        Vector Illustration Program - Fig Import Extension
Group:          Productivity/Graphics/Vector Editors
Requires:       %{name} = %{version}
Requires:       transfig
Enhances:       %{name}
Supplements:    packageand(%{name}:transfig)
# Package in openSUSE <= 11.0 and SLED <= 10
Provides:       %{name}:%{_datadir}/inkscape/extensions/fig_input.inx

%description extensions-fig
Fig family (XFig, Figurine, JFig, WinFig,...) import extension for
Inkscape.

Inkscape is a vector illustration program for the GNOME desktop.

%package extensions-gimp
Summary:        Vector Illustration Program - The GIMP Extensions
Group:          Productivity/Graphics/Vector Editors
Requires:       %{name} = %{version}
Requires:       gimp-2.0
Enhances:       %{name}
Supplements:    packageand(%{name}:gimp)
Supplements:    packageand(%{name}:gimp-2.0)
# Package in openSUSE <= 11.0 and SLED <= 10
Provides:       %{name}:%{_datadir}/inkscape/extensions/gimp_xcf.inx

%description extensions-gimp
The GIMP import and export extensions for Inkscape.

Inkscape is a vector illustration program for the GNOME desktop.

%if 0%{?is_opensuse} && 0%{?sle_version} > 0 && 0%{?sle_version} < 150200
%package extensions-skencil
Summary:        Vector Illustration Program - Skencil Import Extension
Group:          Productivity/Graphics/Vector Editors
Requires:       %{name} = %{version}
Requires:       skencil
Enhances:       %{name}
Supplements:    packageand(%{name}:skencil)
# Package in openSUSE <= 11.0 and SLED <= 10
Provides:       %{name}:%{_datadir}/inkscape/extensions/sk_input.inx

%description extensions-skencil
Skencil import extension for Inkscape.

Inkscape is a vector illustration program for the GNOME desktop.
%endif

%lang_package

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

%build
./autogen.sh
RPM_OPT_FLAGS="%{optflags}"
%ifarch %{arm}
export LDFLAGS+="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
%endif
export CFLAGS="%{optflags} -fno-strict-aliasing"
# This (-std=c++11) is still needed with gcc6 until this is fixed:
# https://bugs.launchpad.net/inkscape/+bug/1488079
export CXXFLAGS="%{optflags} -std=c++11 -fno-strict-aliasing"

%configure\
	--enable-lcms \
	--enable-poppler-cairo \
	--disable-strict-build

make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
rm -rf %{buildroot}%{_datadir}/locale/en_US@piglatin
rm -rf %{buildroot}%{_datadir}/inkscape/filters/filters.svg.h
rm -rf %{buildroot}%{_datadir}/inkscape/patterns/patterns.svg.h

# its not really an extension (missing .inx), but a standalone script
# avoid perl dependency, same can be achieved with 'cat foo.svg | extensions/embedimage.py'
rm -rf %{buildroot}%{_datadir}/inkscape/extensions/embed_raster_in_svg.pl
# only useful for translators
rm -rf %{buildroot}%{_datadir}/inkscape/extensions/genpofiles.sh
# ruby port of simplepath.py, which is not used anywhere
rm -rf %{buildroot}%{_datadir}/inkscape/extensions/simplepath.rb
# only required on Windows
rm -rf %{buildroot}%{_datadir}/inkscape/extensions/print_win32_vector.*

install -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/inkscape/palettes

%suse_update_desktop_file -N "Inkscape" -G "SVG Vector Illustrator" inkscape

%find_lang %{name} %{?no_lang_C}

bash %{SOURCE2} %{buildroot}%{_datadir}/inkscape/extensions "%%{_datadir}/inkscape/extensions/"

sed -i -e "1 s,#! */usr/bin/env python,#!/usr/bin/python2," %{buildroot}%{_datadir}/inkscape/extensions/*.py

# Localized man pages
for man in %{buildroot}%{_mandir}/*/man1/*; do
    LOCALE=`echo $man | sed "s:.*%{_mandir}/\([^/]*\)/man1/.*:\1:g"`
    echo "%%lang($LOCALE) %%dir %%{_mandir}/$LOCALE" >> %{name}.man-lang.tmp
    echo "%%lang($LOCALE) %%dir %%{_mandir}/$LOCALE/man1" >> %{name}.man-lang.tmp
    echo "%%lang($LOCALE) %%doc /${man##%{buildroot}}*" >> %{name}.man-lang.tmp
done
sort -u %{name}.man-lang.tmp > %{name}.man-lang
rm %{name}.man-lang.tmp
%fdupes %{buildroot}

%if 0%{?suse_version} > 1130

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

# We can't really move the localized manpages to the lang package, since they'd
# create a conflict between the lang subpackage and bundles

%files -f inkscape.lst -f %{name}.man-lang
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/applications/inkscape.desktop
%{_datadir}/icons/hicolor/*/apps/inkscape.png
%dir %{_datadir}/appdata
%{_datadir}/appdata/inkscape.appdata.xml
%dir %{_datadir}/inkscape
%{_datadir}/inkscape/[cf-z]*
%{_datadir}/inkscape/examples
%dir %{_datadir}/inkscape/extensions
%dir %{_datadir}/inkscape/extensions/ink2canvas
%{_datadir}/inkscape/extensions/xaml2svg
%{_datadir}/inkscape/extensions/*.xsl*
%{_datadir}/inkscape/extensions/colors.xml
%{_datadir}/inkscape/extensions/ps2*
%{_datadir}/inkscape/extensions/Poly3DObjects/
%{_datadir}/inkscape/extensions/alphabet_soup/
%{_datadir}/inkscape/extensions/inkweb.js
%{_datadir}/inkscape/extensions/jessyInk.js
%{_datadir}/inkscape/extensions/jessyInk_core_mouseHandler_noclick.js
%{_datadir}/inkscape/extensions/jessyInk_core_mouseHandler_zoomControl.js
%{_datadir}/inkscape/extensions/jessyInk_video.svg
%{_datadir}/inkscape/extensions/fontfix.conf
%{_datadir}/inkscape/extensions/ink2canvas/*
%{_datadir}/inkscape/extensions/inkscape.extension.rng
%{_datadir}/inkscape/extensions/seamless_pattern.svg
%{_datadir}/inkscape/extensions/test
%{_datadir}/inkscape/extensions/test/svg
%{_datadir}/inkscape/attributes/
%{_datadir}/inkscape/branding/
%doc %{_mandir}/man?/*.*
# exclude extensions that go in other packages:
%exclude %{_datadir}/inkscape/extensions/Barcode
%exclude %{_datadir}/inkscape/extensions/cdr*
%exclude %{_datadir}/inkscape/extensions/wmf*
%exclude %{_datadir}/inkscape/extensions/dia*
%exclude %{_datadir}/inkscape/extensions/fig*
%exclude %{_datadir}/inkscape/extensions/*gimp*
%exclude %{_datadir}/inkscape/extensions/sk*
# this one is in extras, manually added there due to large dependencies on ghostscript
%exclude %{_datadir}/inkscape/extensions/ps2pdf-ext.py

%files extensions-extra -f inkscape-extensions-extra.lst
%defattr(-,root,root)
%{_datadir}/inkscape/extensions/Barcode
%{_datadir}/inkscape/extensions/cdr*
# ps2pdf-ext is a wrapper around ps2pdf binary (part of ghostscript)
%{_datadir}/inkscape/extensions/ps2pdf-ext.py
%{_datadir}/inkscape/extensions/wmf*
# This extensions seems erronous being copied in here too.
%exclude %{_datadir}/inkscape/extensions/*gimp*
%exclude %{_datadir}/inkscape/extensions/sk*

%files extensions-dia
%defattr(-,root,root)
%{_datadir}/inkscape/extensions/dia*

%files extensions-fig
%defattr(-,root,root)
%{_datadir}/inkscape/extensions/fig*

%files extensions-gimp
%defattr(-,root,root)
# NOTE: export_gimp_palette* does not depend on gimp, but belongs here logically:
%{_datadir}/inkscape/extensions/*gimp*

%if 0%{?is_opensuse} && 0%{?sle_version} > 0 && 0%{?sle_version} < 150200
%files extensions-skencil
%defattr(-,root,root)
%{_datadir}/inkscape/extensions/sk*
%endif

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by