]> git.pld-linux.org Git - packages/librsvg.git/blob - librsvg.spec
add vendor crates; rel 2
[packages/librsvg.git] / librsvg.spec
1 #
2 # Conditional build
3 %bcond_without  apidocs         # gi-docgen based API documentation
4 %bcond_without  static_libs     # static library
5 %bcond_without  vala            # Vala API (vala up to 0.38.x already contains librsvg-2.0.vapi)
6
7 %define         crates_ver      2.56.0
8
9 Summary:        A Raph's Library for Rendering SVG Data
10 Summary(pl.UTF-8):      Biblioteka Raph's SVG do renderowania danych SVG
11 Summary(pt_BR.UTF-8):   Biblioteca SVG
12 Summary(ru.UTF-8):      SVG библиотека
13 Summary(uk.UTF-8):      SVG бібліотека
14 Name:           librsvg
15 Version:        2.56.0
16 Release:        2
17 Epoch:          1
18 License:        LGPL v2+
19 Group:          X11/Libraries
20 Source0:        https://download.gnome.org/sources/librsvg/2.56/%{name}-%{version}.tar.xz
21 # Source0-md5:  ee5fa3ce1653b5b313e52007c53ab190
22 Source1:        %{name}-crates-%{crates_ver}.tar.xz
23 # Source1-md5:  1b301d70073e295aee1a284e6bef4aac
24 Source2:        rsvg
25 Patch0:         x32.patch
26 URL:            https://wiki.gnome.org/Projects/LibRsvg
27 BuildRequires:  autoconf >= 2.69
28 BuildRequires:  automake >= 1:1.9
29 BuildRequires:  cairo-devel >= 1.16.0
30 BuildRequires:  cairo-gobject-devel >= 1.16.0
31 BuildRequires:  cargo
32 BuildRequires:  docbook-dtd43-xml
33 BuildRequires:  docutils
34 BuildRequires:  fontconfig-devel
35 # pkgconfig(freetype) >= 20.0.14
36 BuildRequires:  freetype-devel >= 1:2.8
37 BuildRequires:  gdk-pixbuf2-devel >= 2.20
38 %{?with_apidocs:BuildRequires:  gi-docgen}
39 BuildRequires:  glib2-devel >= 1:2.50.0
40 BuildRequires:  gobject-introspection-devel >= 0.10.8
41 BuildRequires:  harfbuzz-devel >= 2.0.0
42 BuildRequires:  libtool >= 2:2.0
43 BuildRequires:  libxml2-devel >= 1:2.9.0
44 BuildRequires:  pango-devel >= 1:1.48.11
45 BuildRequires:  pkgconfig
46 BuildRequires:  rpm-build >= 4.6
47 BuildRequires:  rpm-pythonprov
48 BuildRequires:  rpmbuild(macros) >= 1.752
49 BuildRequires:  rust >= 1.64.0
50 BuildRequires:  sed >= 4.0
51 BuildRequires:  tar >= 1:1.22
52 %{?with_vala:BuildRequires:     vala >= 2:0.18}
53 BuildRequires:  xz
54 Requires(post,postun):  /sbin/ldconfig
55 Requires(post,postun):  gdk-pixbuf2
56 Requires:       cairo-gobject >= 1.16.0
57 Requires:       freetype >= 1:2.8
58 Requires:       gdk-pixbuf2 >= 2.20
59 Requires:       glib2 >= 1:2.50.0
60 Requires:       harfbuzz >= 2.0.0
61 Requires:       libxml2 >= 1:2.9.0
62 Requires:       pango >= 1:1.48.11
63 Obsoletes:      browser-plugin-librsvg < 1:2.15
64 Obsoletes:      librsvg-gtk+2 < 1:2.40
65 Obsoletes:      librsvg-gtk+3 < 1:2.46
66 Obsoletes:      librsvg0 < 2
67 Obsoletes:      mozilla-plugin-rsvg < 1:2.16.1
68 # rust archs
69 ExclusiveArch:  %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 # see gdk-pixbuf2.spec for source of these ifdefs
73 %if "%{_lib}" != "lib"
74 %define         libext          %(lib="%{_lib}"; echo ${lib#lib})
75 %define         pqext           -%{libext}
76 %else
77 %define         pqext           %{nil}
78 %endif
79
80 %description
81 An library to render SVG (scalable vector graphics), databased upon
82 libart.
83
84 %description -l pl.UTF-8
85 Biblioteka do renderowania SVG (skalowalnej grafiki wektorowej) oparta
86 na kodzie libart.
87
88 %description -l ru.UTF-8
89 Библиотека SVG, базирующаяся на libart.
90
91 %description -l uk.UTF-8
92 Бібліотека SVG, базована на libart.
93
94 %package devel
95 Summary:        Include files for developing with librsvg
96 Summary(pl.UTF-8):      Pliki nagłówkowe do tworzenia oprogramowania z użyciem librsvg
97 Summary(pt_BR.UTF-8):   Bibliotecas e arquivos de inclusão para desenvolvimento com a librsvg
98 Summary(ru.UTF-8):      Библиотечные линки и файлы заголовков для разработки с librsvg
99 Summary(uk.UTF-8):      Бібліотечні лінки та файли заголовків для розробки з librsvg
100 Group:          X11/Development/Libraries
101 Requires:       %{name} = %{epoch}:%{version}-%{release}
102 Requires:       cairo-gobject-devel >= 1.16.0
103 Requires:       freetype-devel >= 1:2.8
104 Requires:       gdk-pixbuf2-devel >= 2.20
105 Requires:       glib2-devel >= 1:2.50.0
106 Requires:       libxml2-devel >= 1:2.9.0
107 Requires:       pango-devel >= 1:1.48.11
108 Obsoletes:      librsvg0-devel < 2
109
110 %description devel
111 This package provides the necessary development libraries and include
112 files to allow you to develop with librsvg.
113
114 %description devel -l pl.UTF-8
115 Pakiet zawiera pliki nagłówkowe potrzebne do tworzenia oprogramowania
116 z wykorzystaniem librsvg.
117
118 %description devel -l pt_BR.UTF-8
119 Este pacote contém os arquivos necessários para desenvolver com base
120 na biblioteca librsvg.
121
122 %description devel -l ru.UTF-8
123 Этот пакет содержит необходимые файлы для разработки программ с
124 использованием librsvg.
125
126 %description devel -l uk.UTF-8
127 Цей пакет містить необхідні файли для розробки програм з використанням
128 librsvg.
129
130 %package static
131 Summary:        Static libraries for developing with librsvg
132 Summary(es.UTF-8):      Archivos estáticos necesarios para el desarrollo de aplicaciones con librsvg
133 Summary(pl.UTF-8):      Statyczne biblioteki librsvg
134 Summary(pt_BR.UTF-8):   Arquivos estáticos necessários para o desenvolvimento de aplicações com librsvg
135 Group:          X11/Development/Libraries
136 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
137
138 %description static
139 This package contains static version of librsvg libraries.
140
141 %description static -l pl.UTF-8
142 Statyczna wersja bibliotek librsvg.
143
144 %description static -l pt_BR.UTF-8
145 Bibliotecas estáticas para o desenvolvimento de aplicações com
146 librsvg.
147
148 %package apidocs
149 Summary:        librsvg API documentation
150 Summary(pl.UTF-8):      Dokumentacja API biblioteki librsvg
151 Group:          Documentation
152 Requires:       gtk-doc-common
153 BuildArch:      noarch
154
155 %description apidocs
156 librsvg API documentation.
157
158 %description apidocs -l pl.UTF-8
159 Dokumentacja API biblioteki librsvg.
160
161 %package -n vala-librsvg
162 Summary:        Vala API for librsvg library
163 Summary(pl.UTF-8):      API języka Vala do biblioteki librsvg
164 Group:          Development/Libraries
165 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
166 Requires:       vala >= 2:0.40
167 BuildArch:      noarch
168
169 %description -n vala-librsvg
170 Vala API for librsvg library.
171
172 %description -n vala-librsvg -l pl.UTF-8
173 API języka Vala do biblioteki librsvg.
174
175 %prep
176 %setup -q -a1
177 %patch0 -p1
178
179 %ifarch x32
180 %{__sed} -i -e 's/test "\?x\?\$cross_compiling"\? = "\?x\?yes"\?/true/' configure.ac
181 %endif
182
183 %{__mv} librsvg-%{crates_ver}/* .
184 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
185
186 # use our offline registry
187 export CARGO_HOME="$(pwd)/.cargo"
188
189 mkdir -p "$CARGO_HOME"
190 cat >.cargo/config <<EOF
191 [source.crates-io]
192 registry = 'https://github.com/rust-lang/crates.io-index'
193 replace-with = 'vendored-sources'
194
195 [source.vendored-sources]
196 directory = '$PWD/vendor'
197 EOF
198
199 %build
200 export CARGO_HOME="$(pwd)/.cargo"
201 %{__libtoolize}
202 %{__aclocal} -I m4
203 %{__autoconf}
204 %{__autoheader}
205 %{__automake}
206 %configure \
207 %ifarch x32
208         RUST_TARGET=x86_64-unknown-linux-gnux32 \
209 %endif
210         %{__enable_disable apidocs gtk-doc} \
211         --enable-introspection \
212         --disable-silent-rules \
213         %{__enable_disable static_libs static} \
214         %{?with_vala:--enable-vala}
215
216 %{__make}
217
218 %install
219 rm -rf $RPM_BUILD_ROOT
220
221 export CARGO_HOME="$(pwd)/.cargo"
222
223 %{__make} install \
224         DESTDIR=$RPM_BUILD_ROOT \
225         pkgconfigdir=%{_pkgconfigdir}
226
227 %{__rm} $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/2.*.*/loaders/*.la
228 %if %{with static_libs}
229 %{__rm} $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/2.*.*/loaders/*.a
230 %endif
231 %{__rm} $RPM_BUILD_ROOT%{_libdir}/librsvg-2.la
232
233 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
234
235 %if %{with apidocs}
236 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
237 %{__mv} $RPM_BUILD_ROOT%{_datadir}/doc/Rsvg-2.0 $RPM_BUILD_ROOT%{_gtkdocdir}
238 %endif
239 # README.md packaged as %doc, the rest useful just for developers
240 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/librsvg
241
242 %clean
243 rm -rf $RPM_BUILD_ROOT
244
245 %post
246 /sbin/ldconfig
247 umask 022
248 %{_bindir}/gdk-pixbuf-query-loaders%{pqext} --update-cache || :
249
250 %postun
251 /sbin/ldconfig
252 umask 022
253 if [ -x %{_bindir}/gdk-pixbuf-query-loaders%{pqext} ]; then
254         %{_bindir}/gdk-pixbuf-query-loaders%{pqext} --update-cache
255 fi
256
257 %files
258 %defattr(644,root,root,755)
259 %doc AUTHORS NEWS README.md
260 %attr(755,root,root) %{_bindir}/rsvg
261 %attr(755,root,root) %{_bindir}/rsvg-convert
262 %attr(755,root,root) %{_libdir}/librsvg-2.so.*.*.*
263 %attr(755,root,root) %ghost %{_libdir}/librsvg-2.so.2
264 %{_libdir}/girepository-1.0/Rsvg-2.0.typelib
265 %attr(755,root,root) %{_libdir}/gdk-pixbuf-2.0/2.*.*/loaders/libpixbufloader-svg.so
266 %{_datadir}/thumbnailers/librsvg.thumbnailer
267 %{_mandir}/man1/rsvg-convert.1*
268
269 %files devel
270 %defattr(644,root,root,755)
271 %attr(755,root,root) %{_libdir}/librsvg-2.so
272 %{_includedir}/librsvg-2.0
273 %{_datadir}/gir-1.0/Rsvg-2.0.gir
274 %{_pkgconfigdir}/librsvg-2.0.pc
275
276 %if %{with static_libs}
277 %files static
278 %defattr(644,root,root,755)
279 %{_libdir}/librsvg-2.a
280 %endif
281
282 %if %{with apidocs}
283 %files apidocs
284 %defattr(644,root,root,755)
285 %{_gtkdocdir}/Rsvg-2.0
286 %endif
287
288 %if %{with vala}
289 %files -n vala-librsvg
290 %defattr(644,root,root,755)
291 %{_datadir}/vala/vapi/librsvg-2.0.vapi
292 %endif
This page took 0.103388 seconds and 4 git commands to generate.