glib/glib.spec

Fri, 10 Aug 2012 14:45:40 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 10 Aug 2012 14:45:40 +0200
changeset 520
35bba3448acd
parent 455
eb5f1f7ac5ff
child 526
7ddfdb42afce
permissions
-rw-r--r--

Use parallel make to avoid delay in this particularly parallel buildconf.

     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     case "%{l_platform -t}" in
   119         *sun4[uv]-*                  ) l_cflags="$l_cflags -march=v9" ;;
   120         *sun*-*                      ) l_cflags="$l_cflags -march=v8" ;;
   121         *i?86-* | *amd64-* | *ia64-* ) l_cflags="$l_cflags -march=native" ;;
   122     esac
   123     libs=""
   124 %if "%{with_threads}" == "yes"
   125     case "%{l_platform -t}" in
   126         *-netbsd*  ) libs="-lpthread" ;;
   127         *-sunos*   ) libs="-lnsl -lsocket" ;;
   128     esac
   129 %endif
   130     CC="%{l_cc}" \
   131     CFLAGS="%{l_cflags -O} $l_cflags" \
   132     CPPFLAGS="%{l_cppflags}" \
   133     LDFLAGS="%{l_ldflags}" \
   134     LIBS="$libs" \
   135     LIBFFI_CFLAGS="%{l_cppflags}" \
   136     LIBFFI_LIBS="%{l_ldflags} -lffi" \
   137     PCRE_CFLAGS="%{l_cppflags pcre .}" \
   138     PCRE_LIBS="%{l_ldflags} -lpcre" \
   139     PERL="%{l_prefix}/bin/perl" \
   140     PERL_PATH="%{l_prefix}/bin/perl" \
   141     GREP="grep" \
   142     ./configure \
   143         --prefix=%{l_prefix} \
   144         --mandir=%{l_prefix}/man \
   145         --with-libiconv=gnu \
   146         --with-pcre=system \
   147 %if "%{with_threads}" == "yes"
   148         --with-threads=posix \
   149 %endif
   150         --disable-gtk-doc \
   151         --disable-dtrace \
   152         --disable-fam \
   153         --disable-debug \
   154         --disable-shared
   156     #   build package
   157     %{l_make} %{l_mflags -O}
   159 %install
   160     #   install package
   161     %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   163     #   strip down installation
   164     rm -f  $RPM_BUILD_ROOT%{l_prefix}/info/dir
   165     rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
   166     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
   167     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/glib-2.0
   168     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gtk-doc
   169     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/gdb
   170     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   171     rm $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   173     #   determine installation files
   174     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   176 %files -f files
   178 %clean

mercurial