afa399e
# Reduce debuginfo verbosity
afa399e
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
afa399e
afa399e
%bcond_with check
afa399e
%bcond_with toolchain_clang
afa399e
afa399e
%if %{with toolchain_clang}
afa399e
%global toolchain clang
afa399e
%endif
8f0855d
d209568
%if %{undefined flatpak} && %{undefined rhel}
d209568
%if 0%{?fedora} >= 38
d209568
%bcond_without graphicsmagick
d209568
%else
d209568
%bcond_without imagemagick
d209568
%endif
d209568
%endif
d209568
afa399e
%global inkscape_date 2023-11-16
afa399e
%global date %(d=%{inkscape_date}; echo ${d//-/})
afa399e
%global commit 91b66b078370477bd794fe0e1db149c34333dae8
afa399e
%global shortcommit %(c=%{commit}; echo ${c:0:10})
afa399e
cvsextras d075d08
Name:           inkscape
443c463
Version:        1.3.2
afa399e
Release:        %autorelease
453d169
Summary:        Vector-based drawing program using SVG
cvsextras 2d3ca92
5b17dc5
License:        GPL-2.0-or-later AND CC-BY-3.0
25da48d
URL:            https://inkscape.org/
afa399e
Source0:        https://media.inkscape.org/dl/resources/file/inkscape-%{version}.tar.xz
afa399e
443c463
# The signatures were uploaded by the responsible release manager, and includes release date and commit, not using macros because it's inconsistent.
443c463
Source1:        https://media.inkscape.org/media/resources/sigs/inkscape-1.3.2_2023-11-25_091e20ef0f.tar.xz.sig
1327aa3
afa399e
# Keyring(s)
afa399e
Source10:       https://inkscape.org/~MarcJeanmougin/gpg/#/MarcJeanmougin.gpg
afa399e
afa399e
afa399e
# Should we split this package and mark it as a Enhance,
afa399e
# to clarify the upstream license for this package? -- mochaa, 2023-10-23
b2dde54
# Fedora Color Palette, GIMP format, CC-BY 3.0
afa399e
Source100:      Fedora-Color-Palette.gpl
afa399e
afa399e
Patch0:         0001-add-xmlmemory-include.patch
c4ea6a9
6aa1011
# Don't drop i686 until at least texlive no longer needs it -GC, 2023-08-10
6aa1011
#%%if 0%%{?fedora} >= 39
6aa1011
#ExcludeArch:    %%{ix86}
6aa1011
#%%endif
e0d31f4
afa399e
Provides: bundled(libcroco) = 0.6.99~gitb9e4b47
afa399e
Provides: bundled(autotrace) = 0.40.0~git0de6201
afa399e
Provides: bundled(libdepixelize) = 0~git19b7601
afa399e
Provides: bundled(libuemf) = 0.2.8
afa399e
Provides: bundled(adaptagrams) = 0~gitc8e3196
3bbb36c
afa399e
%if %{with toolchain_clang}
afa399e
BuildRequires:  clang
afa399e
%else
Igor Gnatenko 27f2f70
BuildRequires:  gcc-c++
afa399e
%endif
afa399e
afa399e
BuildRequires:  cmake
afa399e
afa399e
BuildRequires:  gnupg2
ea1bf04
BuildRequires:  dos2unix
cvsextras d075d08
BuildRequires:  desktop-file-utils
afa399e
BuildRequires:  libappstream-glib
afa399e
BuildRequires:  python3-rpm-macros
afa399e
afa399e
%if %{with check}
afa399e
BuildRequires:  %{_bindir}/bc
afa399e
BuildRequires:  %{_bindir}/convert
afa399e
%endif
afa399e
afa399e
BuildRequires:  gettext-devel
afa399e
BuildRequires:  pkgconfig(gtest)
afa399e
afa399e
%global gtk3_version 3.24
afa399e
afa399e
BuildRequires:  pkgconfig(gtkmm-3.0) >= %{gtk3_version}
afa399e
BuildRequires:  pkgconfig(gdkmm-3.0) >= %{gtk3_version}
afa399e
BuildRequires:  pkgconfig(gtk+-3.0) >= %{gtk3_version}
afa399e
BuildRequires:  pkgconfig(gdk-3.0) >= %{gtk3_version}
afa399e
BuildRequires:  pkgconfig(gtksourceview-4)
afa399e
BuildRequires:  pkgconfig(gspell-1)
afa399e
afa399e
BuildRequires:  cmake(double-conversion)
afa399e
BuildRequires:  pkgconfig(harfbuzz)
afa399e
BuildRequires:  pkgconfig(pangocairo) >= 1.44
afa399e
BuildRequires:  pkgconfig(pangoft2)
afa399e
BuildRequires:  pkgconfig(fontconfig)
afa399e
BuildRequires:  pkgconfig(gsl)
afa399e
BuildRequires:  pkgconfig(gmodule-2.0)
afa399e
BuildRequires:  pkgconfig(libsoup-2.4) >= 2.42
afa399e
BuildRequires:  pkgconfig(bdw-gc)
afa399e
BuildRequires:  pkgconfig(lcms2)
afa399e
%if 0%{?fedora} >= 39
afa399e
BuildRequires:  pkgconfig(2geom) >= 1.3.0
afa399e
%endif
afa399e
BuildRequires:  pkgconfig(poppler) >= 0.20.0
afa399e
BuildRequires:  pkgconfig(poppler-glib) >= 0.20.0
afa399e
BuildRequires:  pkgconfig(cairo-svg)
afa399e
BuildRequires:  pkgconfig(librevenge-0.0)
afa399e
BuildRequires:  pkgconfig(librevenge-stream-0.0)
afa399e
BuildRequires:  pkgconfig(libwpg-0.3)
afa399e
BuildRequires:  pkgconfig(libvisio-0.1)
afa399e
BuildRequires:  pkgconfig(libcdr-0.1)
afa399e
d209568
%if %{with imagemagick}
d209568
BuildRequires:  pkgconfig(ImageMagick++) < 7
d209568
%endif
d209568
%if %{with graphicsmagick}
d209568
BuildRequires:  pkgconfig(GraphicsMagick++)
9106c5b
%endif
34b90c5
afa399e
BuildRequires:  pkgconfig(libjpeg)
afa399e
BuildRequires:  pkgconfig(libpng) >= 1.2
afa399e
afa399e
BuildRequires:  pkgconfig(libxslt) >= 1.0.15
afa399e
BuildRequires:  pkgconfig(libxml-2.0) >= 2.6.11
afa399e
afa399e
BuildRequires:  pkgconfig(zlib)
afa399e
BuildRequires:  pkgconfig(readline)
afa399e
BuildRequires:  pkgconfig(epoxy)
afa399e
afa399e
BuildRequires:  boost-devel >= 1.19.0
afa399e
%if %{with toolchain_clang}
afa399e
BuildRequires:  libomp-devel
c68497f
%endif
afa399e
BuildRequires:  potrace-devel
afa399e
afa399e
Requires:       python%{python3_pkgversion}-libs >= 3.7
afa399e
Requires:       %{py3_dist inkex}
afa399e
465c2d1
# Weak dependencies for the LaTeX plugin
465c2d1
Suggests:       pstoedit
465c2d1
Suggests:       tex(latex)
465c2d1
Suggests:       tex(dvips)
465c2d1
Suggests:       texlive-amsmath
465c2d1
Suggests:       texlive-amsfonts
6ad4427
Suggests:       texlive-standalone
465c2d1
c68497f
%description
c68497f
Inkscape is a vector graphics editor, with capabilities similar to
c68497f
Illustrator, CorelDraw, or Xara X, using the W3C standard Scalable Vector
c68497f
Graphics (SVG) file format.  It is therefore a very useful tool for web
c68497f
designers and as an interchange format for desktop publishing.
cvsextras d075d08
c68497f
Inkscape supports many advanced SVG features (markers, clones, alpha
c68497f
blending, etc.) and great care is taken in designing a streamlined
c68497f
interface. It is very easy to edit nodes, perform complex path operations,
c68497f
trace bitmaps and much more.
cvsextras d075d08
afa399e
%package libs
afa399e
Summary:        Shared libraries for Inkscape
afa399e
afa399e
%description libs
afa399e
This package provides base libraries to share between Inkscape and Inkview.
afa399e
cvsextras d075d08
025104b
%package view
025104b
Summary:        Viewing program for SVG files
025104b
025104b
%description view
025104b
Viewer for files in W3C standard Scalable Vector Graphics (SVG) file
025104b
format.
025104b
025104b
025104b
%package docs
025104b
Summary:        Documentation for Inkscape
025104b
025104b
%description docs
025104b
Tutorial and examples for Inkscape, a graphics editor for vector
025104b
graphics in W3C standard Scalable Vector Graphics (SVG) file format.
025104b
025104b
cvsextras d075d08
%prep
afa399e
%{gpgverify} --keyring='%{SOURCE10}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
c68497f
443c463
%autosetup -n inkscape-1.3.2_2023-11-25_091e20ef0f -p1
afa399e
%py3_shebang_fix .
a7d8a57
c68497f
# https://bugs.launchpad.net/inkscape/+bug/314381
c68497f
# A couple of files have executable bits set,
c68497f
# despite not being executable
afa399e
find . -name '*.cpp' -print0 | xargs -0 chmod -x
afa399e
find . -name '*.h' -print0 | xargs -0 chmod -x
cvsextras d075d08
cvsextras d075d08
%build
afa399e
%cmake \
d209568
        -DWITH_GRAPHICS_MAGICK=%{?with_graphicsmagick:ON}%{!?with_graphicsmagick:OFF} \
d209568
        -DWITH_IMAGE_MAGICK=%{?with_imagemagick:ON}%{!?with_imagemagick:OFF} \
afa399e
        -DBUILD_TESTING:BOOL=%{?with_check:ON}%{!?with_check:OFF}
eb9a872
%cmake_build
cvsextras d075d08
cvsextras d075d08
cvsextras d075d08
%install
eb9a872
%cmake_install
c68497f
b2dde54
# Install Fedora Color Pallette
afa399e
install -pm 644 %{SOURCE100} %{buildroot}%{_datadir}/inkscape/palettes/
b2dde54
d641694
%find_lang %{name} --with-man
c68497f
afa399e
rm -rf %{buildroot}%{_datadir}/inkscape/doc
afa399e
rm -f %{buildroot}%{_datadir}/doc/inkscape/copyright
cvsextras d075d08
c06c674
# Use system inkex
afa399e
rm -rf %{buildroot}%{_datadir}/inkscape/extensions/inkex
afa399e
ln -s %{python3_sitelib}/inkex %{buildroot}%{_datadir}/inkscape/extensions/inkex
7725d62
6ee7c7d
%check
afa399e
%if %{with check}
afa399e
%ctest
afa399e
%endif
afa399e
6ee7c7d
# Validate appdata file
afa399e
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml
6ee7c7d
4cbe84d
# Validate desktop file
afa399e
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
4cbe84d
c06c674
%pretrans -p <lua>
c06c674
-- Remove directories that will become symlinks
c06c674
dirs = {"%{_datadir}/inkscape/extensions/inkex"}
c06c674
for i, path in ipairs(dirs) do
c06c674
  st = posix.stat(path)
c06c674
  if st and st.type == "directory" then
c06c674
    status = os.rename(path, path .. ".rpmmoved")
c06c674
    if not status then
c06c674
      suffix = 0
c06c674
      while not status do
c06c674
        suffix = suffix + 1
c06c674
        status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
c06c674
      end
c06c674
      os.rename(path, path .. ".rpmmoved")
c06c674
    end
c06c674
  end
c06c674
end
c06c674
6ee7c7d
cvsextras d075d08
%files -f %{name}.lang
ea1bf04
%{!?_licensedir:%global license %%doc}
ea1bf04
%license COPYING
b1e59b2
%doc AUTHORS NEWS.md README.md
c68497f
%{_bindir}/inkscape
025104b
%dir %{_datadir}/inkscape
4e1d251
%{_datadir}/inkscape/attributes
4e1d251
%{_datadir}/inkscape/branding
025104b
%{_datadir}/inkscape/extensions
f5f176f
%{_datadir}/inkscape/filters
025104b
%{_datadir}/inkscape/fonts
025104b
%{_datadir}/inkscape/icons
025104b
%{_datadir}/inkscape/keys
025104b
%{_datadir}/inkscape/markers
025104b
%{_datadir}/inkscape/palettes
b1e59b2
%{_datadir}/inkscape/paint
b1e59b2
%{_datadir}/inkscape/pixmaps
025104b
%{_datadir}/inkscape/screens
4e1d251
%{_datadir}/inkscape/symbols
025104b
%{_datadir}/inkscape/templates
025104b
%{_datadir}/inkscape/ui
b1e59b2
%{_datadir}/metainfo/org.inkscape.Inkscape.appdata.xml
b1e59b2
%{_datadir}/applications/org.inkscape.Inkscape.desktop
2e01eae
%{_mandir}/man1/*.1*
f5059bd
%exclude %{_mandir}/man1/inkview.1*
df069ec
%{_datadir}/inkscape/tutorials
d7a230a
%{_datadir}/inkscape/themes
b1e59b2
%{_datadir}/icons/hicolor/*/apps/*.png
d7a230a
%{_datadir}/icons/hicolor/*/apps/*.svg
1ee39b8
%{_datadir}/bash-completion/completions/inkscape
c06c674
%ghost %{_datadir}/inkscape/extensions/inkex.removed
cvsextras d075d08
afa399e
afa399e
%files libs
afa399e
%{!?_licensedir:%global license %%doc}
afa399e
%license COPYING
afa399e
%{_libdir}/inkscape/libinkscape_base.so*
afa399e
afa399e
025104b
%files view
ea1bf04
%{!?_licensedir:%global license %%doc}
ea1bf04
%license COPYING
b1e59b2
%doc AUTHORS NEWS.md README.md
ad3c2f2
%{_bindir}/inkview
6475714
%{_mandir}/man1/inkview.1*
a17fd0b
%{_mandir}/*/man1/inkview.1*
025104b
025104b
025104b
%files docs
6f2f6c9
%license COPYING
ad3c2f2
%dir %{_datadir}/inkscape
ad3c2f2
%{_datadir}/inkscape/examples
025104b
025104b
cvsextras d075d08
%changelog
afa399e
%autochangelog