#
# Conditional build
%bcond_without apidocs # disable gtk-doc
-%bcond_with gtk2 # enable gtk+2
-%bcond_without libgsf # build without libgsf (used for run-time decompression)
-%bcond_without libcroco # build without CSS support through libcroco
+%bcond_without gtk2 # legacy gtk+2 support
%bcond_without static_libs # don't build static library
-#
-
-%define ver 2.36
-%define pver 0
+%bcond_without vala # Vala API (vala up to 0.38.x already contains librsvg-2.0.vapi)
+%define mver 2.44
+%define pver 12
Summary: A Raph's Library for Rendering SVG Data
Summary(pl.UTF-8): Biblioteka Raph's SVG do renderowania danych SVG
Summary(pt_BR.UTF-8): Biblioteca SVG
Summary(ru.UTF-8): SVG библиотека
Summary(uk.UTF-8): SVG бібліотека
Name: librsvg
-Version: %{ver}.%{pver}
-Release: 2
+Version: %{mver}.%{pver}
+Release: 1
Epoch: 1
License: LGPL v2+
Group: X11/Libraries
-Source0: http://ftp.gnome.org/pub/GNOME/sources/librsvg/%{ver}/%{name}-%{version}.tar.xz
-# Source0-md5: 1dbd07bbc870433ce6c5edcfba13a102
+Source0: http://ftp.gnome.org/pub/GNOME/sources/librsvg/%{mver}/%{name}-%{version}.tar.xz
+# Source0-md5: 300f6a5981323c9ac2b65a98d24c7005
Source1: rsvg
+Patch0: x32.patch
URL: http://librsvg.sourceforge.net/
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.50
BuildRequires: automake >= 1:1.9
+BuildRequires: cairo-devel >= 1.15.12
+BuildRequires: cargo
BuildRequires: docbook-dtd412-xml
-BuildRequires: gdk-pixbuf2-devel >= 2.0
-BuildRequires: glib2-devel >= 1:2.24.0
-BuildRequires: gobject-introspection-devel >= 0.18.8
+# pkgconfig(freetype) >= 20.0.14
+BuildRequires: freetype-devel >= 1:2.8
+BuildRequires: gdk-pixbuf2-devel >= 2.20
+BuildRequires: glib2-devel >= 1:2.48.0
+BuildRequires: gobject-introspection-devel >= 0.10.8
%{?with_gtk2:BuildRequires: gtk+2-devel >= 2:2.16.0}
-BuildRequires: gtk+3-devel >= 3.0.0
+BuildRequires: gtk+3-devel >= 3.10.0
%{?with_apidocs:BuildRequires: gtk-doc >= 1.13}
%{?with_apidocs:BuildRequires: gtk-doc-automake >= 1.13}
-%{?with_libcroco:BuildRequires: libcroco-devel >= 0.6.1}
-%{?with_libgsf:BuildRequires: libgsf-devel >= 1.14.4}
-BuildRequires: libtool
-BuildRequires: libxml2-devel >= 1:2.6.31
-BuildRequires: pango-devel >= 1:1.10.0
+BuildRequires: libcroco-devel >= 0.6.1
+BuildRequires: libtool >= 2:2.0
+BuildRequires: libxml2-devel >= 1:2.9.0
+BuildRequires: pango-devel >= 1:1.38.0
BuildRequires: pkgconfig
BuildRequires: rpm-pythonprov
+BuildRequires: rust >= 1.27
BuildRequires: sed >= 4.0
BuildRequires: tar >= 1:1.22
+%{?with_vala:BuildRequires: vala >= 2:0.18}
BuildRequires: xz
Requires(post,postun): /sbin/ldconfig
-Requires(post,postun): gdk-pixbuf2 >= 2.0
-Requires: gdk-pixbuf2 >= 2.0
-Requires: glib2 >= 1:2.24.0
-%{?with_libcroco:Requires: libcroco >= 0.6.1}
-%{?with_libgsf:Requires: libgsf >= 1.14.4}
-Requires: libxml2 >= 1:2.6.31
-Requires: pango >= 1:1.10.0
+Requires: cairo >= 1.15.12
+Requires: freetype >= 1:2.8
+Requires: gdk-pixbuf2 >= 2.20
+Requires: glib2 >= 1:2.48.0
+Requires: libcroco >= 0.6.1
+Requires: libxml2 >= 1:2.9.0
+Requires: pango >= 1:1.38.0
Obsoletes: browser-plugin-librsvg
+Obsoletes: librsvg-gtk+2
Obsoletes: librsvg0
Obsoletes: mozilla-plugin-rsvg
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(uk.UTF-8): Бібліотечні лінки та файли заголовків для розробки з librsvg
Group: X11/Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: glib2-devel >= 1:2.24.0
-Requires: gdk-pixbuf2-devel >= 2.0
-Requires: gtk+3-devel >= 3.0.0
-%{?with_libcroco:Requires: libcroco-devel >= 0.6.1}
-%{?with_libgsf:Requires: libgsf-devel >= 1.14.4}
-Requires: libxml2-devel >= 1:2.6.31
-Requires: pango-devel >= 1:1.10.0
+Requires: cairo-devel >= 1.15.12
+Requires: freetype-devel >= 1:2.8
+Requires: gdk-pixbuf2-devel >= 2.20
+Requires: glib2-devel >= 1:2.48.0
+Requires: gtk+3-devel >= 3.10.0
+Requires: libcroco-devel >= 0.6.1
+Requires: libxml2-devel >= 1:2.9.0
+Requires: pango-devel >= 1:1.38.0
Obsoletes: librsvg0-devel
%description devel
Summary(pl.UTF-8): Dokumentacja API biblioteki librsvg
Group: Documentation
Requires: gtk-doc-common
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description apidocs
librsvg API documentation.
%description apidocs -l pl.UTF-8
Dokumentacja API biblioteki librsvg.
-%package gtk+2
-Summary: librsvg/GTK+2 based SVG theme engine and viewer
-Summary(pl.UTF-8): Silnik motywów oraz przeglądarka plików SVG oparte na bibliotekach librsvg/GTK+2
-Group: X11/Libraries
-Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: gtk+2 >= 2:2.16.0
+%package -n vala-librsvg
+Summary: Vala API for librsvg library
+Summary(pl.UTF-8): API języka Vala do biblioteki librsvg
+Group: Development/Libraries
+Requires: vala >= 2:0.40
-%description gtk+2
-librsvg/GTK+2 based SVG theme engine and viewer.
+%description -n vala-librsvg
+Vala API for librsvg library.
-%description gtk+2 -l pl.UTF-8
-Silnik motywów oraz przeglądarka plików SVG oparte na bibliotekach
-librsvg/GTK+2.
+%description -n vala-librsvg -l pl.UTF-8
+API języka Vala do biblioteki librsvg.
%package gtk+3
-Summary: librsvg/GTK+3 based SVG theme and viewer
-Summary(pl.UTF-8): Motyw i przeglądarka plików SVG oparte na bibliotekach librsvg/GTK+3
-Group: X11/Libraries
+Summary: librsvg/GTK+3 based SVG viewer
+Summary(pl.UTF-8): Przeglądarka plików SVG oparta na bibliotekach librsvg/GTK+3
+Group: X11/Applications/Graphics
Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: gtk+3 >= 3.0.0
+Requires: gtk+3 >= 3.10.0
%description gtk+3
-librsvg/GTK+3 based SVG theme and viewer.
+librsvg/GTK+3 based SVG viewer.
%description gtk+3 -l pl.UTF-8
-Motyw i przeglądarka plików SVG oparte na bibliotekach librsvg/GTK+3.
+Przeglądarka plików SVG oparta na bibliotekach librsvg/GTK+3.
%prep
%setup -q
+%patch0 -p1
-%if !%{with apidocs}
+%if %{without apidocs}
echo 'CLEANFILES=' > gtk-doc.make
echo 'AC_DEFUN([GTK_DOC_CHECK],[])' >> acinclude.m4
%endif
%{__autoheader}
%{__automake}
%configure \
- --disable-silent-rules \
- %{!?with_static_libs:--disable-static} \
- %{?with_apidocs:--enable-gtk-doc} \
+ %{__enable_disable apidocs gtk-doc} \
--enable-introspection \
- %{!?with_libcroco:--without-croco} \
- %{!?with_libgsf:--without-svgz} \
+ --disable-silent-rules \
+ %{__enable_disable static_libs static} \
+ %{?with_vala:--enable-vala} \
--with-html-dir=%{_gtkdocdir}/%{name}
%{__make}
DESTDIR=$RPM_BUILD_ROOT \
pkgconfigdir=%{_pkgconfigdir}
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/2.*/engines/*.{la,a}
%{__rm} $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/2.*.*/loaders/*.{la,a}
%{__rm} $RPM_BUILD_ROOT%{_libdir}/librsvg-2.la
%{__ln_s} rsvg-view-3 $RPM_BUILD_ROOT%{_bindir}/rsvg-view
-install %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc ChangeLog AUTHORS NEWS
+%doc AUTHORS NEWS
%attr(755,root,root) %{_bindir}/rsvg
%attr(755,root,root) %{_bindir}/rsvg-convert
%attr(755,root,root) %{_libdir}/librsvg-2.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/librsvg-2.so.2
%{_libdir}/girepository-1.0/Rsvg-2.0.typelib
%attr(755,root,root) %{_libdir}/gdk-pixbuf-2.0/2.*.*/loaders/libpixbufloader-svg.so
-%dir %{_datadir}/themes/bubble
-%{_mandir}/man1/rsvg.1*
-#%{_pixmapsdir}/svg-viewer.svg
+%{_datadir}/thumbnailers/librsvg.thumbnailer
+%{_mandir}/man1/rsvg-convert.1*
%files devel
%defattr(644,root,root,755)
%{_gtkdocdir}/%{name}
%endif
-%if %{with gtk2}
-%files gtk+2
+%if %{with vala}
+%files -n vala-librsvg
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/gtk-2.0/2.*/engines/libsvg.so
-%{_datadir}/themes/bubble/gtk-2.0
+%{_datadir}/vala/vapi/librsvg-2.0.vapi
%endif
%files gtk+3
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/rsvg-view-3
%attr(755,root,root) %{_bindir}/rsvg-view
+%attr(755,root,root) %{_bindir}/rsvg-view-3