x11/x11.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 83
02f650e4c5d8
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

     1 ##
     2 ##  x11.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2008 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 information
    25 Name:         x11
    26 Summary:      Information Resource for X11
    27 URL:          -
    28 Vendor:       The OpenPKG Project
    29 Packager:     OpenPKG Foundation e.V.
    30 Distribution: OpenPKG Community
    31 Class:        BASE
    32 Group:        Meta
    33 License:      PD
    34 Version:      0
    35 Release:      20090106
    37 #   list of sources
    38 Source0:      rc.x11
    40 #   build information
    41 Prefix:       %{l_prefix}
    42 BuildRoot:    %{l_buildroot}
    43 BuildPreReq:  OpenPKG, openpkg >= 20060823
    44 PreReq:       OpenPKG, openpkg >= 20060823
    45 AutoReq:      no
    46 AutoReqProv:  no
    47 Provides:     X11
    49 %description
    50     This is the information resource package for X11.
    52 %track
    54 %prep
    56 %build
    58 %install
    59     rm -rf $RPM_BUILD_ROOT
    61     x11_bindir=""
    62     x11_incdir=""
    63     x11_libdir=""
    65     #   search for binary directory
    66     for bindir in \
    67         `echo $PATH | sed -e 's/:/ /g'` \
    68         /usr/openwin/bin \
    69         /usr/[xX]/bin \
    70         /usr/[xX]11*/bin \
    71         /usr/[xX]386/bin \
    72         /usr/[xX]ree86/bin \
    73         /usr/bin/[xX]11* \
    74         /usr/local/[xX]/bin \
    75         /usr/local/[xX]11*/bin \
    76         /usr/local/[xX]386/bin \
    77         /usr/local/[xX]ree86/bin \
    78         /usr/athena/bin \
    79     ; do
    80         if [ -f "$bindir/xmkmf" ]; then
    81             x11_bindir="$bindir"
    82             break
    83         fi
    84     done
    86     #   search for include directory
    87     for incdir in \
    88         /usr/openwin/include \
    89         /usr/openwin/share/include \
    90         /usr/[xX]/include \
    91         /usr/[xX]11*/include \
    92         /usr/[xX]386/include \
    93         /usr/[xX]ree86/include \
    94         /usr/include \
    95         /usr/include/[xX] \
    96         /usr/include/[xX]11* \
    97         /usr/include/[xX]386 \
    98         /usr/include/[xX]free86 \
    99         /usr/local/include \
   100         /usr/local/include/[xX] \
   101         /usr/local/include/[xX]11* \
   102         /usr/local/include/[xX]386 \
   103         /usr/local/include/[xX]free86 \
   104         /usr/local/[xX]/include \
   105         /usr/local/[xX]11*/include \
   106         /usr/local/[xX]386/include \
   107         /usr/local/[xX]ree86/include \
   108         /usr/athena/include \
   109         /usr/unsupported/include \
   110     ; do
   111         if [ -f "$incdir/X11/Intrinsic.h" ]; then
   112             x11_incdir="$incdir"
   113             if [ -d "/usr/X11/include" ]; then
   114                 x11_incdir="$x11_incdir /usr/X11/include"
   115             fi
   116             break
   117         fi
   118     done
   120     #   search for library directory
   121     for libdir in \
   122         /usr/openwin/lib \
   123         /usr/openwin/share/lib \
   124         /usr/[xX]/lib64 \
   125         /usr/[xX]/lib \
   126         /usr/[xX]11*/lib64 \
   127         /usr/[xX]11*/lib \
   128         /usr/[xX]386/lib \
   129         /usr/[xX]ree86/lib \
   130         /usr/shlib \
   131         /lib64 \
   132         /lib \
   133         /usr/lib64 \
   134         /usr/lib \
   135         /usr/lib/[xX] \
   136         /usr/lib/[xX]11* \
   137         /usr/lib/[xX]386 \
   138         /usr/lib/[xX]free86 \
   139         /usr/local/lib \
   140         /usr/local/lib/[xX] \
   141         /usr/local/lib/[xX]11* \
   142         /usr/local/lib/[xX]386 \
   143         /usr/local/lib/[xX]free86 \
   144         /usr/local/[xX]/lib \
   145         /usr/local/[xX]11*/lib \
   146         /usr/local/[xX]386/lib \
   147         /usr/local/[xX]ree86/lib \
   148         /usr/athena/lib \
   149         /usr/unsupported/lib \
   150     ; do
   151         for ext in a so sl; do
   152             if [ -f "$libdir/libXt.$ext" ]; then
   153                 x11_libdir="$libdir"
   154                 break
   155             fi
   156         done
   157         if [ ".$x11_libdir" != . ]; then
   158             break
   159         fi
   160     done
   162     #   make sure everything was found
   163     if [ ".$x11_bindir" = . ] ||\
   164        [ ".$x11_incdir" = . ] ||\
   165        [ ".$x11_libdir" = . ]; then
   166        set +x
   167        ( echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
   168          echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
   169          echo ""
   170          echo "We found out:"
   171          echo ""
   172          echo "    X11 Binary  Directory: ${x11_bindir}"
   173          echo "    X11 Include Directory: ${x11_incdir}"
   174          echo "    X11 Library Directory: ${x11_libdir}"
   175          echo ""
   176          echo "Unfortunately, some information is missing here."
   177          echo ""
   178          echo "Be sure to have all system X11 components installed"
   179          echo "in standard locations before building this package!"
   180          echo ""
   181          echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
   182          echo "ERROR: SOME X11 INFORMATION COULD NOT BE DETERMINED!!"
   183        ) | %{l_rpmtool} msg -b -t error
   184        exit 1
   185     fi
   187     #   install rc file
   188     %{l_shtool} mkdir -f -p -m 755 \
   189         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   190     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   191         -e "s;@x11_bindir@;${x11_bindir};g" \
   192         -e "s;@x11_incdir@;${x11_incdir};g" \
   193         -e "s;@x11_libdir@;${x11_libdir};g" \
   194         %{SOURCE rc.x11} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   196     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   198 %files -f files
   200 %clean
   201     rm -rf $RPM_BUILD_ROOT

mercurial