1 |
# enable_gtkdoc: Toggle if gtk-doc files should be rebuilt. |
2 |
# 0 = no |
3 |
# 1 = yes |
4 |
%define enable_gtkdoc 0 |
5 |
|
6 |
# enable_bootstrap: Toggle if bootstrapping package |
7 |
# 0 = no |
8 |
# 1 = yes |
9 |
%define enable_bootstrap 0 |
10 |
|
11 |
# enable_tests: Run test suite in build |
12 |
# 0 = no |
13 |
# 1 = yes |
14 |
%define enable_tests 0 |
15 |
|
16 |
%{?_without_gtkdoc: %{expand: %%define enable_gtkdoc 0}} |
17 |
%{?_without_bootstrap: %{expand: %%define enable_bootstrap 0}} |
18 |
%{?_without_tests: %{expand: %%define enable_tests 0}} |
19 |
|
20 |
%{?_with_gtkdoc: %{expand: %%define enable_gtkdoc 1}} |
21 |
%{?_with_bootstrap: %{expand: %%define enable_bootstrap 1}} |
22 |
%{?_with_tests: %{expand: %%define enable_tests 1}} |
23 |
|
24 |
|
25 |
# required version of various libraries |
26 |
%define req_glib_version 2.25.8 |
27 |
%define req_pango_version 1.20.0 |
28 |
%define req_atk_version 1.29.4 |
29 |
%define req_cairo_version 1.6.0 |
30 |
%define req_gdk_pixbuf_version 2.21.0 |
31 |
|
32 |
%define pkgname gtk+ |
33 |
%define api_version 2.0 |
34 |
%define binary_version 2.10 |
35 |
%define lib_major 0 |
36 |
%define libname %mklibname %{pkgname} %{api_version} %{lib_major} |
37 |
%define libname_x11 %mklibname %{pkgname}-x11- %{api_version} %{lib_major} |
38 |
%define develname %mklibname -d %pkgname %api_version |
39 |
|
40 |
%define gail_major 18 |
41 |
%define gail_libname %mklibname gail %gail_major |
42 |
%define gaildevelname %mklibname -d gail |
43 |
|
44 |
%define git_url git://git.gnome.org/gtk+ |
45 |
|
46 |
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs |
47 |
Name: %{pkgname}%{api_version} |
48 |
Version: 2.22.1 |
49 |
Release: %mkrel 2 |
50 |
License: LGPLv2+ |
51 |
Group: System/Libraries |
52 |
Source0: http://ftp.gnome.org/pub/GNOME/sources/%pkgname/%{pkgname}-%{version}.tar.bz2 |
53 |
# extra IM modules (vietnamese and tamil) -- pablo |
54 |
#gw TODO, needs to be fixed for 2.21.3 |
55 |
Patch4: gtk+-2.13.1-extra_im.patch |
56 |
# (fc) 2.0.6-8mdk fix infinite loop and crash in file selector when / and $HOME are not readable (bug #90) |
57 |
Patch5: gtk+-2.6.9-fileselectorfallback.patch |
58 |
# (fc) 2.4.0-2mdk use Ia Ora theme by default if available |
59 |
Patch12: gtk+-defaulttheme.patch |
60 |
# (gb) 2.4.4-2mdk handle biarch |
61 |
Patch13: gtk+-2.2.4-lib64.patch |
62 |
# (fc) 2.18.2-2mdv fix nautilus crash (GNOME bug #596977) (pterjan) |
63 |
Patch15: gtk+-2.18.1-fixnautiluscrash.patch |
64 |
# (fc) 2.20.0-2mdv improve tooltip appareance (GNOME bug #599617) (Fedora) |
65 |
Patch18: gtk+-2.21.1-fresh-tooltips.patch |
66 |
# (fc) 2.20.0-2mdv improve tooltip positioning (GNOME bug #599618) (Fedora) |
67 |
Patch19: gtk+-2.20.0-tooltip-positioning.patch |
68 |
# (fc) 2.20.0-2mdv allow window dragging toolbars / menubar (GNOME bug #611313) |
69 |
Patch20: gtk+-2.20.0-window-dragging.patch |
70 |
# (fc) 2.20.0-3mdv allow specifying icon padding for tray icon (GNOME bug #583273) (Fedora) |
71 |
Patch21: gtk+-2.20.0-icon-padding.patch |
72 |
|
73 |
Conflicts: perl-Gtk2 < 1.113 |
74 |
|
75 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
76 |
|
77 |
URL: http://www.gtk.org |
78 |
Requires: common-licenses |
79 |
BuildRequires: gettext-devel |
80 |
BuildRequires: libglib2.0-devel >= %{req_glib_version} |
81 |
BuildRequires: libatk1.0-devel >= %{req_atk_version} |
82 |
BuildRequires: cairo-devel >= %{req_cairo_version} |
83 |
BuildRequires: pango-devel >= %{req_pango_version} |
84 |
BuildRequires: gobject-introspection-devel >= 0.9.5 |
85 |
BuildRequires: libgdk_pixbuf2.0-devel >= %req_gdk_pixbuf_version |
86 |
BuildRequires: X11-devel |
87 |
BuildRequires: cups-devel |
88 |
BuildRequires: fam-devel |
89 |
%if %enable_tests |
90 |
BuildRequires: x11-server-xvfb |
91 |
%endif |
92 |
%if %enable_gtkdoc |
93 |
BuildRequires: gtk-doc >= 0.9 |
94 |
BuildRequires: sgml-tools |
95 |
BuildRequires: texinfo |
96 |
%endif |
97 |
# gw tests will fail without this |
98 |
BuildRequires: fonts-ttf-dejavu |
99 |
%if !%{enable_bootstrap} |
100 |
Suggests: xdg-user-dirs-gtk |
101 |
Suggests: ia_ora-gnome |
102 |
%endif |
103 |
Requires: %{libname} = %{version} |
104 |
Provides: %{pkgname}2 = %{version}-%{release} |
105 |
Obsoletes: %{pkgname}2 |
106 |
Provides: gail = %version-%release |
107 |
Obsoletes: gail |
108 |
|
109 |
%description |
110 |
The gtk+ package contains the GIMP ToolKit (GTK+), a library for creating |
111 |
graphical user interfaces for the X Window System. GTK+ was originally |
112 |
written for the GIMP (GNU Image Manipulation Program) image processing |
113 |
program, but is now used by several other programs as well. |
114 |
|
115 |
If you are planning on using the GIMP or another program that uses GTK+, |
116 |
you'll need to have the gtk+ package installed. |
117 |
|
118 |
%package -n %{libname} |
119 |
Summary: %{summary} |
120 |
Group: %{group} |
121 |
Obsoletes: lib%{pkgname}2 |
122 |
Provides: lib%{pkgname}2 = %{version}-%{release} |
123 |
Provides: lib%{name} = %{version}-%{release} |
124 |
Provides: gtk2 = %{version}-%{release} |
125 |
Requires: libglib2.0 >= %{req_glib_version} |
126 |
Requires: libpango1.0 >= %{req_pango_version} |
127 |
Requires: libatk1.0 >= %{req_atk_version} |
128 |
Requires(post): %{libname_x11} = %{version} |
129 |
%if !%{enable_bootstrap} |
130 |
Suggests: %{_lib}ia_ora-gnome |
131 |
%endif |
132 |
|
133 |
%description -n %{libname} |
134 |
This package contains the library needed to run programs dynamically |
135 |
linked with gtk+. |
136 |
|
137 |
%package -n %{develname} |
138 |
Summary: Development files for GTK+ (GIMP ToolKit) applications |
139 |
Group: Development/GNOME and GTK+ |
140 |
Obsoletes: %{libname_x11}-devel |
141 |
Provides: %{libname_x11}-devel = %{version}-%{release} |
142 |
Provides: gtk2-devel = %{version}-%{release} |
143 |
Obsoletes: %{pkgname}2-devel |
144 |
Obsoletes: lib%{pkgname}2-devel |
145 |
Obsoletes: %mklibname -d %{pkgname} 2.0 0 |
146 |
Provides: %{pkgname}2-devel = %{version}-%{release} |
147 |
Provides: lib%{pkgname}2-devel = %{version}-%{release} |
148 |
Provides: lib%{pkgname}%{api_version}-devel = %{version}-%{release} |
149 |
Provides: %{libname}-devel = %{version}-%{release} |
150 |
Provides: lib%{pkgname}-x11-%{api_version}-devel = %{version}-%{release} |
151 |
Requires: %{libname} = %{version} |
152 |
Requires: %{libname_x11} = %{version} |
153 |
Requires: libgdk_pixbuf2.0-devel >= %req_gdk_pixbuf_version |
154 |
Requires: libatk1.0-devel >= %{req_atk_version} |
155 |
Requires: libpango1.0-devel >= %{req_pango_version} |
156 |
|
157 |
|
158 |
%description -n %{develname} |
159 |
The libgtk+-devel package contains the static libraries and header files |
160 |
needed for developing GTK+ (GIMP ToolKit) applications. The libgtk+-devel |
161 |
package contains GDK (the General Drawing Kit, which simplifies the interface |
162 |
for writing GTK+ widgets and using GTK+ widgets in applications), and GTK+ |
163 |
(the widget set). |
164 |
|
165 |
|
166 |
%package -n %{libname_x11} |
167 |
Summary: X11 backend of The GIMP ToolKit (GTK+) |
168 |
Group: System/Libraries |
169 |
Provides: lib%{pkgname}-x11-%{api_version} = %{version}-%{release} |
170 |
Provides: %{name}-backend = %{version}-%{release} |
171 |
Requires: %{libname} = %{version} |
172 |
Requires: %{name} >= %{version}-%{release} |
173 |
Conflicts: gir-repository < 0.6.5-4 |
174 |
|
175 |
%description -n %{libname_x11} |
176 |
This package contains the X11 version of library needed to run |
177 |
programs dynamically linked with gtk+. |
178 |
|
179 |
%package -n %{gail_libname} |
180 |
Summary: GNOME Accessibility Implementation Library |
181 |
Group: System/Libraries |
182 |
Provides: libgail = %{version}-%{release} |
183 |
|
184 |
%description -n %{gail_libname} |
185 |
Gail is the GNOME Accessibility Implementation Library |
186 |
|
187 |
%package -n %gaildevelname |
188 |
Summary: Static libraries, include files for GAIL |
189 |
Group: Development/GNOME and GTK+ |
190 |
Provides: gail-devel = %{version}-%{release} |
191 |
Provides: libgail-devel = %{version}-%{release} |
192 |
Requires: %{gail_libname} = %{version} |
193 |
Conflicts: %{_lib}gail17-devel |
194 |
Obsoletes: %mklibname -d gail 18 |
195 |
|
196 |
%description -n %gaildevelname |
197 |
Gail is the GNOME Accessibility Implementation Library |
198 |
|
199 |
%prep |
200 |
%setup -n %{pkgname}-%{version} -q |
201 |
%patch4 -p1 -b .extra_im |
202 |
%patch5 -p1 -b .fileselectorfallback |
203 |
%patch12 -p1 -b .defaulttheme |
204 |
%if !%{enable_bootstrap} |
205 |
#gw disabled for bootstrapping |
206 |
%patch13 -p1 -b .lib64 |
207 |
%endif |
208 |
#patch15 -p1 -b .fixnautiluscrash |
209 |
%patch18 -p1 -b .fresh-tooltips |
210 |
#%patch19 -p1 -b .tooltip-positioning |
211 |
%patch20 -p1 -b .window-dragging |
212 |
%patch21 -p1 -b .icon-padding |
213 |
|
214 |
#needed by patches 4 & 13 |
215 |
%if !%{enable_bootstrap} |
216 |
#gw disabled for bootstrapping |
217 |
autoreconf -fi |
218 |
%endif |
219 |
|
220 |
%build |
221 |
%ifarch ppc64 |
222 |
export CFLAGS="$RPM_OPT_FLAGS -mminimal-toc" |
223 |
%endif |
224 |
|
225 |
# Build X11 backend |
226 |
#[ -d X11-build ] || mkdir X11-build |
227 |
#cd X11-build |
228 |
|
229 |
# fix crash in nautilus (GNOME bug #596977) |
230 |
export CFLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/-fomit-frame-pointer//g'` |
231 |
|
232 |
#CONFIGURE_TOP=.. |
233 |
export CPPFLAGS="-DGTK_COMPILATION" |
234 |
# --with-included-immodules=yes \ |
235 |
%configure2_5x --enable-xinerama \ |
236 |
--with-xinput=xfree \ |
237 |
%if !%enable_gtkdoc |
238 |
--enable-gtk-doc=no |
239 |
%endif |
240 |
|
241 |
%make |
242 |
|
243 |
%check |
244 |
%if %enable_tests |
245 |
#cd X11-build |
246 |
XDISPLAY=$(i=1; while [ -f /tmp/.X$i-lock ]; do i=$(($i+1)); done; echo $i) |
247 |
%{_bindir}/Xvfb :$XDISPLAY & |
248 |
export DISPLAY=:$XDISPLAY |
249 |
make check |
250 |
kill $(cat /tmp/.X$XDISPLAY-lock) ||: |
251 |
#cd .. |
252 |
%endif |
253 |
|
254 |
%install |
255 |
rm -rf $RPM_BUILD_ROOT |
256 |
|
257 |
#cd X11-build |
258 |
%makeinstall_std mandir=%{_mandir} RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false |
259 |
|
260 |
|
261 |
#cd .. |
262 |
|
263 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gtk-%{api_version} |
264 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/gtk-%{api_version}/gtk.immodules.%{_lib} |
265 |
mkdir -p $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/modules |
266 |
|
267 |
# handle biarch packages |
268 |
progs="gtk-query-immodules-%{api_version}" |
269 |
mkdir -p $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/bin |
270 |
for f in $progs; do |
271 |
mv -f $RPM_BUILD_ROOT%{_bindir}/$f $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/bin/ |
272 |
cat > $RPM_BUILD_ROOT%{_bindir}/$f << EOF |
273 |
#!/bin/sh |
274 |
lib=%{_lib} |
275 |
case ":\$1:" in |
276 |
:lib*:) lib="\$1"; shift 1;; |
277 |
esac |
278 |
exec %{_prefix}/\$lib/gtk-%{api_version}/bin/$f \${1+"\$@"} |
279 |
EOF |
280 |
chmod +x $RPM_BUILD_ROOT%{_bindir}/$f |
281 |
done |
282 |
|
283 |
%{find_lang} gtk20 |
284 |
%find_lang gtk20-properties |
285 |
cat gtk20-properties.lang >> gtk20.lang |
286 |
|
287 |
#remove not packaged files |
288 |
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/*.la \ |
289 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}.*/loaders/*.la \ |
290 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}.*/engines/*.la \ |
291 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}.*/printbackends/*.la \ |
292 |
$RPM_BUILD_ROOT%{_libdir}/gtk-2.0/modules/*.la |
293 |
|
294 |
%clean |
295 |
rm -rf $RPM_BUILD_ROOT |
296 |
|
297 |
%post -n %{libname} |
298 |
if [ "$1" = "2" ]; then |
299 |
if [ -f %{_sysconfdir}/gtk-%{api_version}/gtk.immodules ]; then |
300 |
rm -f %{_sysconfdir}/gtk-%{api_version}/gtk.immodules |
301 |
fi |
302 |
fi |
303 |
|
304 |
%{_libdir}/gtk-%{api_version}/bin/gtk-query-immodules-%{api_version} > %{_sysconfdir}/gtk-%{api_version}/gtk.immodules.%{_lib} |
305 |
|
306 |
%post |
307 |
if [ -d %{_datadir}/icons ]; then |
308 |
for i in `/bin/ls %{_datadir}/icons` ; do |
309 |
[ -d "%{_datadir}/icons/$i" -a -e "%{_datadir}/icons/$i/icon-theme.cache" -a -e "%{_datadir}/icons/$i/index.theme" ] && gtk-update-icon-cache --force --quiet %{_datadir}/icons/$i |
310 |
done |
311 |
exit 0 |
312 |
fi |
313 |
|
314 |
%files -f gtk20.lang |
315 |
%defattr(-, root, root) |
316 |
%doc README |
317 |
%{_bindir}/gtk-query-immodules-%{api_version} |
318 |
%{_bindir}/gtk-update-icon-cache |
319 |
%{_datadir}/themes |
320 |
%dir %{_sysconfdir}/gtk-%{api_version} |
321 |
%config(noreplace) %{_sysconfdir}/gtk-%{api_version}/im-multipress.conf |
322 |
|
323 |
%files -n %{libname} |
324 |
%defattr(-, root, root) |
325 |
%doc README |
326 |
%ghost %verify (not md5 mtime size) %config(noreplace) %{_sysconfdir}/gtk-%{api_version}/gtk.immodules.%{_lib} |
327 |
%dir %{_libdir}/gtk-%{api_version} |
328 |
%dir %{_libdir}/gtk-%{api_version}/bin |
329 |
%{_libdir}/gtk-%{api_version}/bin/gtk-query-immodules-%{api_version} |
330 |
%dir %{_libdir}/gtk-%{api_version}/modules |
331 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}.* |
332 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules |
333 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-am-et.so |
334 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-cedilla.so |
335 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-cyrillic-translit.so |
336 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-inuktitut.so |
337 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-ipa.so |
338 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-multipress.so |
339 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-thai.so |
340 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-ti-er.so |
341 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-ti-et.so |
342 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-viqr.so |
343 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-xim.so |
344 |
#%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-tamilvp-tsc.so |
345 |
#%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-tamilvp-uni.so |
346 |
#%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-telex.so |
347 |
#%{_libdir}/gtk-%{api_version}/%{binary_version}.*/immodules/im-vni.so |
348 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}.*/engines |
349 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/engines/*.so |
350 |
%{_libdir}/gtk-%{api_version}/%{binary_version}.*/printbackends/*.so |
351 |
|
352 |
%files -n %develname |
353 |
%defattr(-, root, root) |
354 |
%doc docs/*.txt AUTHORS ChangeLog NEWS* README* |
355 |
%doc %{_datadir}/gtk-doc/html/gdk |
356 |
%doc %{_datadir}/gtk-doc/html/gtk |
357 |
%{_bindir}/gtk-demo |
358 |
%_bindir/gtk-builder-convert |
359 |
%{_datadir}/aclocal/* |
360 |
%{_datadir}/gtk-%{api_version} |
361 |
%{_includedir}/gtk-unix-print-%{api_version}/ |
362 |
%{_includedir}/gtk-%{api_version}/gdk |
363 |
%{_includedir}/gtk-%{api_version}/gtk |
364 |
%{_libdir}/gtk-%{api_version}/include |
365 |
%{_libdir}/pkgconfig/gdk-%{api_version}.pc |
366 |
%{_libdir}/pkgconfig/gtk+-%{api_version}.pc |
367 |
%{_libdir}/pkgconfig/gtk+-unix-print-%{api_version}.pc |
368 |
%{_libdir}/*x11*.so |
369 |
%_datadir/gir-1.0/Gdk-2.0.gir |
370 |
%_datadir/gir-1.0/GdkX11-2.0.gir |
371 |
%_datadir/gir-1.0/Gtk-2.0.gir |
372 |
%attr(644,root,root) %{_libdir}/*x11*.la |
373 |
%{_libdir}/pkgconfig/*x11* |
374 |
|
375 |
%files -n %{libname_x11} |
376 |
%defattr(-, root, root) |
377 |
%{_libdir}/*x11*.so.* |
378 |
%_libdir/girepository-1.0/Gdk-2.0.typelib |
379 |
%_libdir/girepository-1.0/GdkX11-2.0.typelib |
380 |
%_libdir/girepository-1.0/Gtk-2.0.typelib |
381 |
|
382 |
%files -n %gail_libname |
383 |
%defattr(-,root,root) |
384 |
%{_libdir}/libgailutil.so.%{gail_major}* |
385 |
%{_libdir}/gtk-2.0/modules/libferret.so |
386 |
%{_libdir}/gtk-2.0/modules/libgail.so |
387 |
|
388 |
%files -n %gaildevelname |
389 |
%defattr(-,root,root) |
390 |
%{_datadir}/gtk-doc/html/gail-libgail-util |
391 |
%{_libdir}/libgailutil.so |
392 |
%attr(644,root,root) %{_libdir}/libgailutil.la |
393 |
%{_includedir}/gail-1.0 |
394 |
%{_libdir}/pkgconfig/gail.pc |
395 |
|
396 |
|