glib/glib.spec

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
parent 526
7ddfdb42afce
child 671
f82939c12e5f
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

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

mercurial