Mon, 01 Jul 2013 21:23:57 +0200
Whoops, repeat the correction from 21ce05ebf344 using a hammer instead.
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.37
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: 20130000
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 -e 's; *@GLIB_WARN_CFLAGS@;;g' \
98 `find . -name Makefile.in -print` \
99 m4macros/glib-2.0.m4
100 %{l_shtool} subst \
101 -e 's;/glib-2\.0;/glib;g' \
102 -e 's;/gobject-2\.0;/gobject;g' \
103 -e 's;/gthread-2\.0;/gthread;g' \
104 -e 's;/gmodule-2\.0;/gmodule;g' \
105 -e 's;/gio-unix-2\.0;/gio-unix;g' \
106 -e 's;/gio-2\.0;/gio;g' \
107 -e 's;-l\(g[a-z]*\)-2\.0;-l\1;g' \
108 *-2.0.pc.in
109 %{l_shtool} subst \
110 -e 's;\(#define _XOPEN_SOURCE\) 600;\1 601;' \
111 glib/tests/strfuncs.c
112 %{l_shtool} subst \
113 -e 's;\(completiondir =\) \$(sysconfdir)/bash_completion.d;\1 $(pkgdatadir)/giobash;' \
114 gio/Makefile.in
115 case "%{l_platform -t}" in
116 *-sunos* )
117 %{l_shtool} subst \
118 -e 's;^\(LIBELF_LIBS =\);\1 -lelf;' \
119 gio/Makefile.in
120 %{l_shtool} subst \
121 -e 's;\(Libs.private:.*\) *$;\1 -lsocket -lnsl;' \
122 glib-2.0.pc.in
123 ;;
124 esac
125 case "%{l_platform -t}" in
126 *sun4[uv]-* ) l_cflags="$l_cflags -march=v9" ;;
127 *sun*-* ) l_cflags="$l_cflags -march=v8" ;;
128 *i?86-* | *amd64-* | *ia64-* ) l_cflags="$l_cflags -march=native" ;;
129 esac
130 libs=""
131 case "%{l_platform -t}" in
132 *-sunos* ) libs="-lnsl -lsocket" ;;
133 esac
134 %if "%{with_threads}" == "yes"
135 case "%{l_platform -t}" in
136 *-netbsd* ) libs="-lpthread" ;;
137 *-sunos* ) libs="-lnsl -lsocket" ;;
138 esac
139 %endif
140 CC="%{l_cc}" \
141 CFLAGS="%{l_cflags -O} $l_cflags" \
142 CPPFLAGS="%{l_cppflags}" \
143 LDFLAGS="%{l_ldflags}" \
144 LIBS="$libs" \
145 LIBFFI_CFLAGS="%{l_cppflags}" \
146 LIBFFI_LIBS="%{l_ldflags} -lffi" \
147 PCRE_CFLAGS="%{l_cppflags pcre .}" \
148 PCRE_LIBS="%{l_ldflags} -lpcre" \
149 PERL="%{l_prefix}/bin/perl" \
150 PERL_PATH="%{l_prefix}/bin/perl" \
151 GREP="grep" \
152 ./configure \
153 --prefix=%{l_prefix} \
154 --mandir=%{l_prefix}/man \
155 --with-libiconv=gnu \
156 --with-pcre=system \
157 %if "%{with_threads}" == "yes"
158 --with-threads=posix \
159 %endif
160 --disable-gtk-doc \
161 --disable-dtrace \
162 --disable-fam \
163 --disable-debug \
164 --disable-shared
166 # build package
167 %{l_make} %{l_mflags -O}
169 %install
170 # install package
171 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
173 # strip down installation
174 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
175 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
176 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
177 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/glib-2.0
178 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc
179 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gdb
180 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
181 rm $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
183 # determine installation files
184 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
186 %files -f files
188 %clean