Sat, 04 Aug 2012 22:02:31 +0200
Update to new vendor software version and modernize packaging to 20100101.
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 >= 20120101, perl, make
50 PreReq: OpenPKG, openpkg >= 20120101, 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 case "%{l_platform -t}" in
112 *-sunos* )
113 %{l_shtool} subst \
114 -e 's;^\(LIBELF_LIBS =\);\1 -lelf;' \
115 gio/Makefile.in
116 ;;
117 esac
118 libs=""
119 %if "%{with_threads}" == "yes"
120 case "%{l_platform -t}" in
121 *-netbsd* ) libs="-lpthread" ;;
122 *-sunos* ) libs="-lnsl -lsocket" ;;
123 esac
124 %endif
125 CC="%{l_cc}" \
126 CFLAGS="%{l_cflags -O}" \
127 CPPFLAGS="%{l_cppflags}" \
128 LDFLAGS="%{l_ldflags}" \
129 LIBS="$libs" \
130 LIBFFI_CFLAGS="%{l_cppflags}" \
131 LIBFFI_LIBS="%{l_ldflags} -lffi" \
132 PCRE_CFLAGS="%{l_cppflags pcre .}" \
133 PCRE_LIBS="%{l_ldflags} -lpcre" \
134 PERL="%{l_prefix}/bin/perl" \
135 PERL_PATH="%{l_prefix}/bin/perl" \
136 GREP="grep" \
137 ./configure \
138 --prefix=%{l_prefix} \
139 --mandir=%{l_prefix}/man \
140 --with-libiconv=gnu \
141 --with-pcre=system \
142 %if "%{with_threads}" == "yes"
143 --with-threads=posix \
144 %endif
145 --disable-gtk-doc \
146 --disable-dtrace \
147 --disable-fam \
148 --disable-debug \
149 --disable-shared
151 # build package
152 %{l_make} %{l_mflags -O}
154 %install
155 # install package
156 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
158 # strip down installation
159 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
160 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
161 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
162 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/glib-2.0
163 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc
164 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gdb
165 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
166 rm $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
168 # determine installation files
169 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
171 %files -f files
173 %clean