0f808ded59f444c97370833906e478861709dc27
[profile/ivi/glib2.git] / packaging / glib2.spec
1 %define libdir /%{_lib}
2
3 Summary: A library of handy utility functions
4 Name: glib2
5 Version: 2.31.20
6 Release: 2.24
7 License: LGPLv2+
8 Group: System/Libraries
9 URL: http://www.gtk.org
10 Source: http://download.gnome.org/sources/glib/2.31/glib-%{version}.tar.xz
11 Source1: http://download.gnome.org/sources/glib/2.31/glib-%{version}.sha256sum
12 Source2: glib2.sh
13 Source3: glib2.csh
14 Source101: %{name}-rpmlintrc
15
16 Patch1: glib-2.24.0-syslog-message-handler.patch
17 BuildRequires: pkgconfig
18 BuildRequires: pkgconfig(libpcre)
19 BuildRequires: pkgconfig(libffi)
20 BuildRequires: pkgconfig(zlib)
21 BuildRequires: gettext-tools
22 # for sys/inotify.h
23 BuildRequires: glibc-devel
24 BuildRequires: libattr-devel
25 BuildRequires: python-xml
26
27 %description
28 GLib is the low-level core library that forms the basis
29 for projects such as GTK+ and GNOME. It provides data structure
30 handling for C, portability wrappers, and interfaces for such runtime
31 functionality as an event loop, threads, dynamic loading, and an
32 object system.
33
34 This package provides version 2 of GLib.
35
36 %package devel
37 Summary: A library of handy utility functions
38 Group: Development/Libraries
39 Requires: pkgconfig 
40 Requires: %{name} = %{version}-%{release}
41
42 %description devel
43 The glib2-devel package includes the header files for
44 version 2 of the GLib library.
45
46 # anaconda needs static libs, see RH bug #193143
47 %package static
48 Summary: A library of handy utility functions
49 Group: Development/Libraries
50 Requires: %{name}-devel = %{version}-%{release}
51
52 %description static
53 The glib2-static package includes static libraries
54 of version 2 of the GLib library.
55
56 %prep
57 %setup -q -n glib-%{version}
58 %patch1 -p1
59
60
61 %build
62 %configure --disable-gtk-doc --enable-static --with-runtime-libdir=../../%{_lib} --disable-selinux --disable-visibility --enable-debug=yes --with-pcre=system
63
64 #
65 # First, build glib enabled for generating the Profile Guided Optimization
66 # metadata
67 #
68 make %{?_smp_mflags} CFLAGS="$CFLAGS -pg -fprofile-generate"
69
70 #
71 # Now run the glib performance tests to create the profile dta
72 #
73 cd tests/gobject
74 make performance CFLAGS="$CFLAGS -pg -fprofile-generate"
75 cd ../..
76 tests/gobject/performance type-check
77
78 #
79 # And now compile again, using the generated profile data
80 #
81 rm `find -name "*.lo"`
82 rm `find -name "*.o"`
83 make %{?_smp_mflags} CFLAGS="$CFLAGS -fprofile-use"
84
85 %install
86
87 make DESTDIR=%{buildroot} install
88 ## glib2.sh and glib2.csh
89 ./mkinstalldirs %{buildroot}%{_sysconfdir}/profile.d
90 install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d
91 install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/profile.d
92
93 rm -f %{buildroot}%{_libdir}/*.la
94 rm -f %{buildroot}%{_libdir}/gio/modules/*.{a,la}
95
96 # we don't provide bash completion
97 rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d
98
99 %find_lang glib20
100 mv glib20.lang glib2.lang
101
102 %clean
103 rm -rf %{buildroot}
104
105 %post -p /sbin/ldconfig
106
107 %postun -p /sbin/ldconfig
108
109
110 %docs_package
111
112 %lang_package
113
114 %files
115 %defattr(-,root,root,-)
116 %doc AUTHORS COPYING
117 %{libdir}/libglib-2.0.so.*
118 %{libdir}/libgthread-2.0.so.*
119 %{libdir}/libgmodule-2.0.so.*
120 %{libdir}/libgobject-2.0.so.*
121 %{libdir}/libgio-2.0.so.*
122 %{_sysconfdir}/profile.d/*
123 %dir %{_libdir}/gio
124 %dir %{_libdir}/gio/modules
125 %{_bindir}/gio-querymodules
126 %{_bindir}/glib-compile-resources
127 %{_bindir}/glib-compile-schemas
128 %{_bindir}/gsettings
129 %{_bindir}/gdbus
130
131 %files devel
132 %defattr(-, root, root, -)
133 %{_libdir}/lib*.so
134 %{_libdir}/glib-2.0
135 %{_includedir}/*
136 %{_datadir}/aclocal/*
137 %{_libdir}/pkgconfig/*
138 %{_datadir}/glib-2.0
139 %{_datadir}/gdb/auto-load/lib/*.py*
140 %doc %{_datadir}/gtk-doc/html/*
141 %{_bindir}/gdbus-codegen
142 %{_libdir}/gdbus-2.0/codegen/*.py*
143 %{_bindir}/glib-genmarshal
144 %{_bindir}/glib-gettextize
145 %{_bindir}/glib-mkenums
146 %{_bindir}/gobject-query
147 %{_bindir}/gresource
148 %{_bindir}/gtester
149 %attr (0755, root, root) %{_bindir}/gtester-report
150
151 %files static
152 %defattr(-, root, root, -)
153 %{_libdir}/lib*.a
154