Mon, 17 Sep 2012 19:10:10 +0200
Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.
1 ##
2 ## glib.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package version
25 %define V_major 2.32
26 %define V_minor 3
28 # package information
29 Name: glib
30 Summary: The Gtk Utility Library
31 URL: http://www.gtk.org/
32 Vendor: The Gtk Project
33 Packager: OpenPKG Foundation e.V.
34 Distribution: OpenPKG Community
35 Class: BASE
36 Group: Algorithm
37 License: GPL
38 Version: %{V_major}.%{V_minor}
39 Release: 20120800
41 # package options
42 %option with_threads yes
44 # list of sources
45 Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{V_major}/glib-%{version}.tar.xz
46 Patch0: glib.patch
48 # build information
49 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make
50 PreReq: OpenPKG, openpkg >= 20100101, perl
51 BuildPreReq: gettext, libiconv, pcre, pcre::with_utf8 = yes, libffi
52 PreReq: gettext, libiconv, pcre, pcre::with_utf8 = yes, libffi
54 %description
55 GLib is the low-level core library that originally was split out
56 from Gtk+. It provides data structure handling for C, portability
57 wrappers, and interfaces for such runtime functionality as an event
58 loop, threads, dynamic loading, and an object system.
60 %track
61 prog glib = {
62 version = %{version}
63 url = http://ftp.gnome.org/pub/gnome/sources/glib/%{V_major}/
64 regex = glib-(__VER__)\.tar\.(gz|bz2)
65 }
67 %prep
68 %setup -q -n glib-%{version}
69 %patch -p0
71 %build
72 # configure package
73 %{l_shtool} subst \
74 -e 's;\$export_dynamic_flag_spec;;g' \
75 -e 's;eval echo \\\\;eval echo ;' \
76 configure
77 %{l_shtool} subst \
78 -e 's;/glib-2\.0\.pc;/glib-x.x.pc;g' \
79 -e 's;/gobject-2\.0\.pc;/gobject-x.x.pc;g' \
80 -e 's;/gthread-2\.0\.pc;/gthread-x.x.pc;g' \
81 -e 's;/gmodule-2\.0\.pc;/gmodule-x.x.pc;g' \
82 -e 's;/gio-unix-2\.0\.pc;/gio-unix-x.x.pc;g' \
83 -e 's;/gio-2\.0\.pc;/gio-x.x.pc;g' \
84 -e 's;/glib-2\.0;/glib;g' \
85 -e 's;/gobject-2\.0;/gobject;g' \
86 -e 's;/gthread-2\.0;/gthread;g' \
87 -e 's;/gmodule-2\.0;/gmodule;g' \
88 -e 's;/gio-unix-2\.0;/gio-unix;g' \
89 -e 's;/gio-2\.0;/gio;g' \
90 -e 's;/glib-x\.x\.pc;/glib-2.0.pc;g' \
91 -e 's;/gobject-x\.x\.pc;/gobject-2.0.pc;g' \
92 -e 's;/gthread-x\.x\.pc;/gthread-2.0.pc;g' \
93 -e 's;/gmodule-x\.x\.pc;/gmodule-2.0.pc;g' \
94 -e 's;/gio-unix-x\.x\.pc;/gio-unix-2.0.pc;g' \
95 -e 's;/gio-x\.x\.pc;/gio-2.0.pc;g' \
96 -e 's;lib\(g[a-z]*\)-2\.0;lib\1;g' \
97 `find . -name Makefile.in -print` \
98 m4macros/glib-2.0.m4
99 %{l_shtool} subst \
100 -e 's;/glib-2\.0;/glib;g' \
101 -e 's;/gobject-2\.0;/gobject;g' \
102 -e 's;/gthread-2\.0;/gthread;g' \
103 -e 's;/gmodule-2\.0;/gmodule;g' \
104 -e 's;/gio-unix-2\.0;/gio-unix;g' \
105 -e 's;/gio-2\.0;/gio;g' \
106 -e 's;-l\(g[a-z]*\)-2\.0;-l\1;g' \
107 *-2.0.pc.in
108 %{l_shtool} subst \
109 -e 's;\(#define _XOPEN_SOURCE\) 600;\1 601;' \
110 glib/tests/strfuncs.c
111 %{l_shtool} subst \
112 -e 's;\(completiondir =\) \$(sysconfdir)/bash_completion.d;\1 $(pkgdatadir)/giobash;' \
113 gio/Makefile.in
114 case "%{l_platform -t}" in
115 *-sunos* )
116 %{l_shtool} subst \
117 -e 's;^\(LIBELF_LIBS =\);\1 -lelf;' \
118 gio/Makefile.in
119 %{l_shtool} subst \
120 -e 's;\(Libs.private:.*\) *$;\1 -lsocket -lnsl;' \
121 glib-2.0.pc.in
122 ;;
123 esac
124 case "%{l_platform -t}" in
125 *sun4[uv]-* ) l_cflags="$l_cflags -march=v9" ;;
126 *sun*-* ) l_cflags="$l_cflags -march=v8" ;;
127 *i?86-* | *amd64-* | *ia64-* ) l_cflags="$l_cflags -march=native" ;;
128 esac
129 libs=""
130 %if "%{with_threads}" == "yes"
131 case "%{l_platform -t}" in
132 *-netbsd* ) libs="-lpthread" ;;
133 *-sunos* ) libs="-lnsl -lsocket" ;;
134 esac
135 %endif
136 CC="%{l_cc}" \
137 CFLAGS="%{l_cflags -O} $l_cflags" \
138 CPPFLAGS="%{l_cppflags}" \
139 LDFLAGS="%{l_ldflags}" \
140 LIBS="$libs" \
141 LIBFFI_CFLAGS="%{l_cppflags}" \
142 LIBFFI_LIBS="%{l_ldflags} -lffi" \
143 PCRE_CFLAGS="%{l_cppflags pcre .}" \
144 PCRE_LIBS="%{l_ldflags} -lpcre" \
145 PERL="%{l_prefix}/bin/perl" \
146 PERL_PATH="%{l_prefix}/bin/perl" \
147 GREP="grep" \
148 ./configure \
149 --prefix=%{l_prefix} \
150 --mandir=%{l_prefix}/man \
151 --with-libiconv=gnu \
152 --with-pcre=system \
153 %if "%{with_threads}" == "yes"
154 --with-threads=posix \
155 %endif
156 --disable-gtk-doc \
157 --disable-dtrace \
158 --disable-fam \
159 --disable-debug \
160 --disable-shared
162 # build package
163 %{l_make} %{l_mflags -O}
165 %install
166 # install package
167 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
169 # strip down installation
170 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
171 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
172 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
173 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/glib-2.0
174 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc
175 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gdb
176 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
177 rm $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
179 # determine installation files
180 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
182 %files -f files
184 %clean