openpkg/rc.openpkg

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 427
71503088f51b
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 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.openpkg -- Run-Commands
     4 ##
     6 %config
     7     openpkg_rc_def="yes"
     8     openpkg_rc_all="$openpkg_rc_def"
     9     openpkg_enable="$openpkg_rc_def"
    10     openpkg_envprio="high"
    11     openpkg_reghour="3"
    12     openpkg_regrand="1"
    14 %status -o
    15     openpkg_usable="unknown"
    16     openpkg_active="unknown"
    17     echo "openpkg_enable=\"$openpkg_enable\""
    18     echo "openpkg_usable=\"$openpkg_usable\""
    19     echo "openpkg_active=\"$openpkg_active\""
    21 %info -o
    22     @l_prefix@/bin/openpkg uuid info
    24 %start -p0
    25     rcService openpkg enable yes || exit 0
    26     #   update UUID information (in background to not slow down boot sequences)
    27     (nohup @l_prefix@/bin/openpkg uuid update </dev/null >/dev/null 2>&1 &) >/dev/null 2>&1
    29 %hourly -u @l_musr@
    30     rcService openpkg enable yes || exit 0
    31     #   automatic (re-)registration
    32     reregister=0
    33     #   re-register if previously registered
    34     @l_prefix@/bin/openpkg register --printstatus >/dev/null 2>&1 && reregister=1
    35     #   re-register if "openpkg" executable from community series
    36     [ $reregister -eq 0 ] && @l_prefix@/bin/openpkg --license 2>/dev/null \
    37     | sed -e 'q' | egrep '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-C' >/dev/null && reregister=1
    38     #   re-register if "openpkg release" configured to pull packages directly from openpkg.(org|com|net)
    39     [ $reregister -eq 0 ] && @l_prefix@/bin/openpkg release --fmt='%u' \
    40     | egrep '^[^:]*://(([^:]*:)?([^@]*@)?)?([^/]*\.)?openpkg\.(com|org|net)/' >/dev/null && reregister=1
    41     #   perform (re-)registration
    42     if [ $reregister -eq 1 ]; then
    43         [ $openpkg_reghour -lt 00 -o $openpkg_reghour -gt 23 ] && openpkg_reghour="3"
    44         now=`date '+%H'`
    45         [ $openpkg_reghour -eq $now ] || exit 0
    46         [ $openpkg_regrand -lt 01 -o $openpkg_regrand -gt 04 ] && openpkg_regrand="1"
    47         rnd=`expr $RANDOM \* 3600 \* $openpkg_regrand / 32768`
    48         (nohup @l_prefix@/lib/openpkg/bash -c "sleep $rnd; @l_prefix@/bin/openpkg register" </dev/null >/dev/null 2>&1 &) >/dev/null 2>&1
    49     fi
    51 %daily -p0
    52     rcService openpkg enable yes || exit 0
    53     #   update UUID information
    54     @l_prefix@/bin/openpkg uuid update >/dev/null 2>&1 || true
    56 %env -p0
    57     rcService openpkg enable yes || exit 0
    59     #   determine append (low prio) or prepend (high prio) mode
    60     opt_prepend=""
    61     if [ ".$openpkg_envprio" = ".high" ]; then
    62         opt_prepend="-p"
    63     fi
    65     #   make sure the software package executables are found
    66     export PATH
    67     rcPath -a -e PATH \
    68         /bin /sbin /usr/bin /usr/sbin
    69     rcPath -a ${opt_prepend} PATH \
    70         @l_prefix@/bin @l_prefix@/sbin \
    71         @l_prefix@/local/bin @l_prefix@/local/sbin
    73     #   make sure the software package manual pages are found
    74     export MANPATH
    75     rcPath -a -e MANPATH \
    76         /usr/man /usr/share/man
    77     rcPath -a ${opt_prepend} MANPATH \
    78         @l_prefix@/man @l_prefix@/local/man
    80     #   make sure the software package info pages are found
    81     export INFOPATH
    82     rcPath -a -e INFOPATH \
    83         /usr/info /usr/share/info
    84     rcPath -a ${opt_prepend} INFOPATH \
    85         @l_prefix@/info @l_prefix@/local/info
    87     #   make sure the software package libraries are found
    88     export LD_LIBRARY_PATH
    89     rcPath -a -e LD_LIBRARY_PATH \
    90         /lib /usr/lib
    91     rcPath -a ${opt_prepend} LD_LIBRARY_PATH \
    92         @l_prefix@/lib @l_prefix@/local/lib
    94     #   cleanup
    95     unset opt_prepend

mercurial