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 1 |
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.28.0 |
27 |
%define req_pango_version 1.24.0 |
28 |
%define req_atk_version 1.30 |
29 |
%define req_cairo_version 1.10.0 |
30 |
%define req_gdk_pixbuf_version 2.22.0 |
31 |
|
32 |
%define pkgname gtk+ |
33 |
%define api 3 |
34 |
%define api_version 3.0 |
35 |
%define binary_version 3.0.0 |
36 |
%define lib_major 0 |
37 |
%define libname %mklibname %{pkgname} %{api} %{lib_major} |
38 |
%define develname %mklibname -d %pkgname %api_version |
39 |
|
40 |
%define gail_major 0 |
41 |
%define gail_libname %mklibname gail %{api} %gail_major |
42 |
%define gaildevelname %mklibname -d gail %api_version |
43 |
|
44 |
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs |
45 |
Name: %{pkgname}%{api_version} |
46 |
Version: 3.0.11 |
47 |
Release: %mkrel 1 |
48 |
License: LGPLv2+ |
49 |
Group: System/Libraries |
50 |
Source0: http://ftp.gnome.org/pub/GNOME/sources/%pkgname/%{pkgname}-%{version}.tar.xz |
51 |
Source1: im-cedilla.conf |
52 |
%if !%{enable_bootstrap} |
53 |
# use oxygen gtk3 theme by default if available |
54 |
Patch12: gtk+-defaulttheme.patch |
55 |
%endif |
56 |
URL: http://www.gtk.org |
57 |
Requires: common-licenses |
58 |
BuildRequires: gettext-devel |
59 |
BuildRequires: libglib2-devel >= %{req_glib_version} |
60 |
BuildRequires: libatk1.0-devel >= %{req_atk_version} |
61 |
BuildRequires: cairo-devel >= %{req_cairo_version} |
62 |
BuildRequires: pango-devel >= %{req_pango_version} |
63 |
BuildRequires: libgdk_pixbuf2.0-devel >= %req_gdk_pixbuf_version |
64 |
BuildRequires: gobject-introspection-devel >= 0.10.1 |
65 |
BuildRequires: cups-devel |
66 |
BuildRequires: libx11-devel |
67 |
BuildRequires: libxrandr-devel |
68 |
BuildRequires: libxrender-devel |
69 |
BuildRequires: libxcursor-devel |
70 |
BuildRequires: libxfixes-devel |
71 |
BuildRequires: libxinerama-devel |
72 |
BuildRequires: libxcomposite-devel |
73 |
BuildRequires: libxdamage-devel |
74 |
BuildRequires: libxi-devel |
75 |
#gw needed for gtk-update-icon-cache in gtk+3.0 3.0.9 |
76 |
BuildRequires: gtk+2.0 |
77 |
%if %enable_tests |
78 |
BuildRequires: x11-server-xvfb |
79 |
%endif |
80 |
%if %enable_gtkdoc |
81 |
BuildRequires: gtk-doc >= 0.9 |
82 |
BuildRequires: sgml-tools |
83 |
BuildRequires: texinfo |
84 |
%endif |
85 |
# gw tests will fail without this |
86 |
BuildRequires: fonts-ttf-dejavu |
87 |
%if !%{enable_bootstrap} |
88 |
Suggests: xdg-user-dirs-gtk |
89 |
Suggests: oxygen-gtk3 |
90 |
%endif |
91 |
Requires: %{libname} = %{version} |
92 |
Obsoletes: gtk-engines3 < 3.0.0 |
93 |
Provides: %{pkgname}%{api} = %{version}-%{release} |
94 |
|
95 |
%description |
96 |
The gtk+ package contains the GIMP ToolKit (GTK+), a library for creating |
97 |
graphical user interfaces for the X Window System. GTK+ was originally |
98 |
written for the GIMP (GNU Image Manipulation Program) image processing |
99 |
program, but is now used by several other programs as well. |
100 |
|
101 |
If you are planning on using the GIMP or another program that uses GTK+, |
102 |
you'll need to have the gtk+ package installed. |
103 |
|
104 |
%post |
105 |
gtk-query-immodules-3.0-%{__isa_bits} --update-cache |
106 |
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : |
107 |
|
108 |
if [ -d %{_datadir}/icons ]; then |
109 |
for i in `/bin/ls %{_datadir}/icons` ; do |
110 |
[ -d "%{_datadir}/icons/$i" -a -e "%{_datadir}/icons/$i/icon-theme.cache" -a -e "%{_datadir}/icons/$i/index.theme" ] && gtk-update-icon-cache-%{api_version} --force --quiet %{_datadir}/icons/$i |
111 |
done |
112 |
exit 0 |
113 |
fi |
114 |
|
115 |
|
116 |
%files -f gtk30.lang |
117 |
%defattr(-, root, root) |
118 |
%doc README |
119 |
%_mandir/man1/gtk-query-immodules-%{api_version}.1* |
120 |
%{_datadir}/themes |
121 |
%{_datadir}/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml |
122 |
%dir %{_sysconfdir}/gtk-%{api_version} |
123 |
%config(noreplace) %{_sysconfdir}/gtk-%{api_version}/im-multipress.conf |
124 |
%{_sysconfdir}/X11/xinit/xinput.d/im-cedilla.conf |
125 |
|
126 |
#-------------------------------------------------------------------- |
127 |
|
128 |
%package -n %{libname} |
129 |
Summary: %{summary} |
130 |
Group: %{group} |
131 |
Provides: lib%{pkgname}%{api} = %{version}-%{release} |
132 |
Provides: lib%{name} = %{version}-%{release} |
133 |
Obsoletes: %{_lib}gtk+3.0_0 < 3.0.0 |
134 |
Obsoletes: %{_lib}gtk+-x11-3.0_0 < 3.0.0 |
135 |
Obsoletes: %{_lib}gtk-engines3 < 3.0.0 |
136 |
Requires: libglib2.0 >= %{req_glib_version} |
137 |
Requires: libpango1.0 >= %{req_pango_version} |
138 |
Requires: libatk1.0 >= %{req_atk_version} |
139 |
|
140 |
%description -n %{libname} |
141 |
This package contains the library needed to run programs dynamically |
142 |
linked with gtk+. |
143 |
|
144 |
%post -n %{libname} |
145 |
if [ "$1" = "2" ]; then |
146 |
if [ -f %{_sysconfdir}/gtk-%{api_version}/gtk.immodules ]; then |
147 |
rm -f %{_sysconfdir}/gtk-%{api_version}/gtk.immodules |
148 |
fi |
149 |
fi |
150 |
gtk-query-immodules-3.0-%{__isa_bits} --update-cache |
151 |
%{_libdir}/gtk-%{api_version}/bin/gtk-query-immodules-%{api_version} > %_libdir/gtk-%{api_version}/3.0.0/immodules.cache |
152 |
|
153 |
%files -n %{libname} |
154 |
%defattr(-, root, root) |
155 |
%doc README |
156 |
%{_bindir}/gtk-query-immodules-%{api_version}-* |
157 |
%ghost %verify (not md5 mtime size) %_libdir/gtk-%{api_version}/3.0.0/immodules.cache |
158 |
%dir %{_libdir}/gtk-%{api_version} |
159 |
%dir %{_libdir}/gtk-%{api_version}/modules |
160 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version} |
161 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}/immodules |
162 |
%{_libdir}/gtk-%{api_version}/%{binary_version}/immodules/*.so |
163 |
%dir %{_libdir}/gtk-%{api_version}/%{binary_version}/printbackends |
164 |
%{_libdir}/gtk-%{api_version}/%{binary_version}/printbackends/*.so |
165 |
%{_libdir}/libgtk-3.so.%{lib_major} |
166 |
%{_libdir}/libgtk-3.so.%{lib_major}.* |
167 |
%{_libdir}/libgdk-3.so.%{lib_major} |
168 |
%{_libdir}/libgdk-3.so.%{lib_major}.* |
169 |
%_libdir/girepository-1.0/Gdk-%{api_version}.typelib |
170 |
%_libdir/girepository-1.0/GdkX11-%{api_version}.typelib |
171 |
%_libdir/girepository-1.0/Gtk-%{api_version}.typelib |
172 |
|
173 |
#-------------------------------------------------------------------- |
174 |
|
175 |
%package -n %{develname} |
176 |
Summary: Development files for GTK+ (GIMP ToolKit) applications |
177 |
Group: Development/GNOME and GTK+ |
178 |
Provides: %{pkgname}%{api}-devel = %{version}-%{release} |
179 |
Provides: lib%{pkgname}%{api}-devel = %{version}-%{release} |
180 |
Provides: lib%{pkgname}%{api_version}-devel = %{version}-%{release} |
181 |
Provides: lib%{pkgname}-x11-%{api_version}-devel = %{version}-%{release} |
182 |
Provides: %{name}-devel = %{version}-%{release} |
183 |
Requires: %{libname} = %{version} |
184 |
Requires: libgdk_pixbuf2.0-devel >= %req_gdk_pixbuf_version |
185 |
Requires: libatk1.0-devel >= %{req_atk_version} |
186 |
Requires: libpango1.0-devel >= %{req_pango_version} |
187 |
|
188 |
%description -n %{develname} |
189 |
The libgtk+-devel package contains the static libraries and header files |
190 |
needed for developing GTK+ (GIMP ToolKit) applications. The libgtk+-devel |
191 |
package contains GDK (the General Drawing Kit, which simplifies the interface |
192 |
for writing GTK+ widgets and using GTK+ widgets in applications), and GTK+ |
193 |
(the widget set). |
194 |
|
195 |
%files -n %{develname} |
196 |
%defattr(-, root, root) |
197 |
%doc docs/*.txt AUTHORS ChangeLog NEWS* README* |
198 |
%doc %{_datadir}/gtk-doc/html/gdk3 |
199 |
%doc %{_datadir}/gtk-doc/html/gtk3 |
200 |
%{_bindir}/gtk3-demo |
201 |
%{_datadir}/aclocal/* |
202 |
%{_datadir}/gtk-%{api_version} |
203 |
%{_includedir}/gtk-%{api_version} |
204 |
%{_libdir}/libgtk-%{api}.so |
205 |
%{_libdir}/libgtk-%{api}.la |
206 |
%{_libdir}/libgdk-%{api}.so |
207 |
%{_libdir}/libgdk-%{api}.la |
208 |
%{_libdir}/pkgconfig/gdk-*%{api_version}.pc |
209 |
%{_libdir}/pkgconfig/gtk+-*%{api_version}.pc |
210 |
%_datadir/gir-1.0/Gdk-%{api_version}.gir |
211 |
%_datadir/gir-1.0/GdkX11-%{api_version}.gir |
212 |
%_datadir/gir-1.0/Gtk-%{api_version}.gir |
213 |
|
214 |
#-------------------------------------------------------------------- |
215 |
|
216 |
%package -n %{gail_libname} |
217 |
Summary: GNOME Accessibility Implementation Library |
218 |
Group: System/Libraries |
219 |
Provides: libgail = %{version}-%{release} |
220 |
Obsoletes: %{_lib}gail3.0_0 < 3.0.0 |
221 |
|
222 |
%description -n %{gail_libname} |
223 |
Gail is the GNOME Accessibility Implementation Library |
224 |
|
225 |
%files -n %gail_libname |
226 |
%defattr(-,root,root) |
227 |
%{_libdir}/libgailutil-%{api}.so.%{gail_major}* |
228 |
%{_libdir}/gtk-%{api_version}/modules/libferret.so |
229 |
%{_libdir}/gtk-%{api_version}/modules/libgail.so |
230 |
|
231 |
#-------------------------------------------------------------------- |
232 |
|
233 |
%package -n %gaildevelname |
234 |
Summary: Static libraries, include files for GAIL |
235 |
Group: Development/GNOME and GTK+ |
236 |
Provides: libgail-%{api_version}-devel = %{version}-%{release} |
237 |
Requires: %{gail_libname} = %{version} |
238 |
|
239 |
%description -n %gaildevelname |
240 |
Gail is the GNOME Accessibility Implementation Library |
241 |
|
242 |
%files -n %gaildevelname |
243 |
%defattr(-,root,root) |
244 |
%{_datadir}/gtk-doc/html/gail-libgail-util3 |
245 |
%{_libdir}/libgailutil-%{api}.so |
246 |
%{_libdir}/libgailutil-%{api}.la |
247 |
%{_includedir}/gail-%{api_version} |
248 |
%{_libdir}/pkgconfig/gail-%{api_version}.pc |
249 |
|
250 |
#-------------------------------------------------------------------- |
251 |
|
252 |
%prep |
253 |
%setup -qn %{pkgname}-%{version} |
254 |
%apply_patches |
255 |
|
256 |
%build |
257 |
|
258 |
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi; |
259 |
%configure $CONFIGFLAGS \ |
260 |
--enable-gtk2-dependency \ |
261 |
--enable-xkb \ |
262 |
--enable-xinerama \ |
263 |
--enable-xinput \ |
264 |
--enable-xrandr \ |
265 |
--enable-xfixes \ |
266 |
--enable-xcomposite \ |
267 |
--enable-xdamage \ |
268 |
--enable-x11-backend \ |
269 |
) |
270 |
|
271 |
# fight unused direct deps |
272 |
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool |
273 |
|
274 |
%make |
275 |
|
276 |
%check |
277 |
%if %enable_tests |
278 |
XDISPLAY=$(i=1; while [ -f /tmp/.X$i-lock ]; do i=$(($i+1)); done; echo $i) |
279 |
%{_bindir}/Xvfb :$XDISPLAY & |
280 |
export DISPLAY=:$XDISPLAY |
281 |
make check |
282 |
kill $(cat /tmp/.X$XDISPLAY-lock) ||: |
283 |
%endif |
284 |
|
285 |
%install |
286 |
rm -rf $RPM_BUILD_ROOT |
287 |
|
288 |
%makeinstall_std RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false |
289 |
|
290 |
touch $RPM_BUILD_ROOT%_libdir/gtk-%{api_version}/%{binary_version}/immodules.cache |
291 |
mkdir -p $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/modules |
292 |
|
293 |
(cd $RPM_BUILD_ROOT%{_bindir} |
294 |
mv gtk-query-immodules-3.0 gtk-query-immodules-3.0-%{__isa_bits} |
295 |
) |
296 |
|
297 |
# Input method frameworks want this |
298 |
install -D %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinput.d/im-cedilla.conf |
299 |
%{find_lang} gtk30 gtk30 gtk30-properties |
300 |
|
301 |
#remove not packaged files |
302 |
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}/immodules/*.la \ |
303 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}/loaders/*.la \ |
304 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}/engines/*.la \ |
305 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/%{binary_version}/printbackends/*.la \ |
306 |
$RPM_BUILD_ROOT%{_libdir}/gtk-%{api_version}/modules/*.la \ |
307 |
$RPM_BUILD_ROOT%_mandir/man1/gtk-update-icon-cache.1* |
308 |
|
309 |
%clean |
310 |
rm -rf $RPM_BUILD_ROOT |
311 |
|