shtool/shtool.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 13
cb59d6afeb61
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 ##  shtool.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##  Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
     5 ##
     6 ##  Permission to use, copy, modify, and distribute this software for
     7 ##  any purpose with or without fee is hereby granted, provided that
     8 ##  the above copyright notice and this permission notice appear in all
     9 ##  copies.
    10 ##
    11 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    12 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    13 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    14 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    15 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    16 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    17 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    18 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    19 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    20 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    21 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    22 ##  SUCH DAMAGE.
    23 ##
    25 #   package information
    26 Name:         shtool
    27 Summary:      GNU Portable Shell Tool
    28 URL:          http://www.gnu.org/software/shtool/
    29 Vendor:       Ralf S. Engelschall
    30 Packager:     OpenPKG
    31 Distribution: OpenPKG
    32 Class:        CORE
    33 Group:        Building
    34 License:      GPL
    35 Version:      2.0.8
    36 Release:      20090105
    38 #   package options
    39 %option       with_shtoolize  yes
    41 #   list of sources
    42 Source0:      ftp://ftp.gnu.org/gnu/shtool/shtool-%{version}.tar.gz
    43 Patch0:       shtool.patch
    45 #   build information
    46 Prefix:       %{l_prefix}
    47 BuildRoot:    %{l_buildroot}
    48 BuildPreReq:  OpenPKG, openpkg >= 20040130, perl
    49 PreReq:       OpenPKG, openpkg >= 20040130
    50 %if "%{with_shtoolize}" == "yes"
    51 PreReq:       perl
    52 %endif
    53 AutoReq:      no
    54 AutoReqProv:  no
    56 %description
    57     GNU shtool is a compilation of small but very stable and portable
    58     shell scripts into a single shell tool. All ingredients were in
    59     successful use over many years in various free software projects.
    60     The compiled shtool script is intended to be used inside the source
    61     tree of those free software packages. There it can take over
    62     various (usually nonportable) tasks related to the building and
    63     installation of such packages.
    65 %track
    66     prog shtool = {
    67         version   = %{version}
    68         url       = ftp://ftp.gnu.org/gnu/shtool/
    69         regex     = shtool-(__VER__)\.tar\.gz
    70     }
    72 %prep
    73     %setup -q
    74     %patch -p0
    76 %build
    77     ./configure \
    78         --prefix=%{l_prefix} \
    79         --mandir=%{l_prefix}/man
    80     %{l_make} %{l_mflags}
    82 %install
    83     rm -rf $RPM_BUILD_ROOT
    84     %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    85 %if "%{with_shtoolize}" != "yes"
    86     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/shtoolize
    87     rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/shtoolize.1
    88     rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/shtool
    89 %endif
    90     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
    91         %{l_files_std} \
    92         '%not %dir %{l_prefix}/share/aclocal'
    94 %files -f files
    96 %clean
    97     rm -rf $RPM_BUILD_ROOT

mercurial