openpkg/rpmpopt

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
child 428
f880f219c566
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 ##  rpmpopt -- OpenPKG RPM POPT Configuration
     3 ##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##  Copyright (c) 2000-2007 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 ##
    24 ##  The purpose of this configuration file is to extend and override
    25 ##  the "rpmpopt" directives in the default RPM POPT configuration with
    26 ##  OpenPKG specific extensions and adjustments.
    27 ##
    29 #   backward compatibility for old RPM extensions
    30 rpm exec --stowaway  echo "install \"openpkg-tools\" and use \"openpkg stowaway\" now please."
    31 rpm exec --makeproxy echo "install \"openpkg-tools\" and use \"openpkg makeproxy\" now please."
    32 rpm exec --fetch     echo "install \"openpkg-tools\" and use \"openpkg fetch\" now please."
    34 #   RPM exentsion: "rpm -bs --[no]restriction"
    35 rpm alias --restriction   --define "restriction yes" \
    36     --POPTdesc=$"exclude %NoSource files in .src.rpm"
    37 rpm alias --norestriction --define "restriction no" \
    38     --POPTdesc=$"include %NoSource files in .src.rpm"
    40 #   RPM extension: "rpm --with[out] <name>"
    41 rpm alias --with --define "with_!#:+ yes" \
    42     --POPTdesc=$"set '%option with_<name> yes'" \
    43     --POPTargs=$"<name>"
    44 rpm alias --without --define "with_!#:+ no" \
    45     --POPTdesc=$"set '%option with_<name> no'" \
    46     --POPTargs=$"<name>"
    48 #   RPM extension: "rpm --option <name> <value>"
    49 rpm alias --option --define "!#:+ !#:+" \
    50     --POPTdesc=$"set '%option <name> <value>'" \
    51     --POPTargs=$"<name> <value>"
    53 #   RPM extension: "rpm --tag <string>"
    54 rpm alias --tag --define "l_tag_fmt !#:+" \
    55     --POPTdesc=$"set 'binary package filename tag'" \
    56     --POPTargs=$"<string>"
    58 #   RPM extension: "rpm --db-{build,rebuild,cleanup,fixate}"
    59 rpm exec --db-build   rpmdb --build \
    60     --POPTdesc=$"RPM database administration: build new database (destructive operation; you have to know what you are doing)"
    61 rpm exec --db-rebuild rpmdb --rebuild \
    62     --POPTdesc=$"RPM database administration: rebuild new from old database (upgrading operation; reasonable after upgrades or on DB corruption)"
    63 rpm exec --db-cleanup rpmdb --cleanup \
    64     --POPTdesc=$"RPM database administration: cleanup existing database (cleaning operation; reasonable after DB out-of-sync situations)"
    65 rpm exec --db-fixate  rpmdb --fixate \
    66     --POPTdesc=$"RPM database administration: fixate existing database (harmless operation; for fixating files only)"
    68 #   RPM extension: "rpm --db-private ..."
    69 rpm alias --db-private --define "_rpmdb_private yes" \
    70     --POPTdesc=$"operate RPM database in Berkeley-DB DB_PRIVATE mode"
    72 #   RPM extension: "rpm --track"
    73 rpm alias --track -bt \
    74     --POPTdesc=$"run package vendor source tracking script (%track)"
    76 #   RPM extension: "rpm --track-dump"
    77 rpm alias --track-dump -bt --define '___track_dump yes' \
    78     --POPTdesc=$"dump the vendor source tracking script (%track)"
    80 #   RPM extension: "rpm --test"
    81 rpm alias --test -q --qf '%{TEST}\n' \
    82     --pipe "grep -v \(none\) | @l_prefix@/lib/openpkg/bash" \
    83     --POPTdesc=$"run package run-time test script (%test)"
    85 #   RPM adjustment: "rpm --setperms ..."
    86 rpm alias --setperms -q --qf \
    87     '[\[ -h %{FILENAMES:shescape} \] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \
    88     --pipe "grep -v '(none)' | sed 's/chmod .../chmod /' | @l_prefix@/lib/openpkg/bash" \
    89     --POPTdesc=$"set permissions of files in a package"
    91 #   RPM adjustment: "rpm --setugids ..."
    92 rpm alias --setugids -q --qf \
    93     '[run %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \
    94     --pipe "(echo 'run () { chown -- \"$1\" \"$3\"; chgrp -- \"$2\" \"$3\"; }'; grep -v '(none)') | @l_prefix@/lib/openpkg/bash" \
    95     --POPTdesc=$"set user/group ownership of files in a package"
    97 #   RPM adjustment: improved and cleaned up "rpm -i/--info"
    98 rpmq alias --info --qf '\
    99 Name:     %-25{NAME} Source RPM:   %{SOURCERPM}\n\
   100 Version:  %-25{VERSION} Signature:    %|DSAHEADER?{dsa:%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{rsa:%{RSAHEADER:pgpsig}}:{%|SIGGPG?{gpg:%{SIGGPG:pgpsig}}:{%|SIGPGP?{pgp:%{SIGPGP:pgpsig}}:{%|SIGMD5?{md5:%{SIGMD5}}:{(none)}|}|}|}|}|\n\
   101 Release:  %-25{RELEASE} Build Host:   %{BUILDHOST}\n\
   102 Group:    %-25{GROUP} Build System: %{ARCH}-%{OS}\n\
   103 Class:    %-25{CLASS} Build Time:   %{BUILDTIME:date}\n\
   104 Distrib:  %-25{DISTRIBUTION} Install Time: %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n\
   105 License:  %-25{LICENSE} Install Size: %{SIZE} bytes\n\
   106 Packager: %-25{PACKAGER} Relocations:  %|PREFIXES?{[%{PREFIXES} ]}:{(not relocateable)}|\n\
   107 Vendor:   %{VENDOR}\n\
   108 Summary:  %{SUMMARY}\n\
   109 URL:      %{URL}\n\
   110 Description:\n%{DESCRIPTION}\n\
   111 %|PROVIDENAME?{Provides:\n\
   112 [    %{PROVIDENAME} %|PROVIDEFLAGS?{%{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}}:{}|\n]}:{}|\
   113 ' --POPTdesc=$"list descriptive information from package(s)"

mercurial