From 80bb0c3785d76b058729a056cbe4f42cf89c6611 Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Sat, 27 Nov 2004 13:14:54 +0000 Subject: [PATCH] Handle IRIX64 when computing _os Kill shortroot handling. This is now handled at install time. Cleanup the topinstalldir/metainstalldir etc. confusion topinstalldir now explicitly marks where the package is attached to the filesystem. Like /usr/local or /. metainstalldir is used to define the location of the metadata files like relnotes and distfiles. --- buildpkg.packaging.irix | 105 +++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 56 deletions(-) diff --git a/buildpkg.packaging.irix b/buildpkg.packaging.irix index 15336b1..248827f 100644 --- a/buildpkg.packaging.irix +++ b/buildpkg.packaging.irix @@ -69,6 +69,7 @@ pkgprefix=tgc_ pkgname=$pkgprefix$topdir os=irix`$UNAME -r` +_os=$($UNAME -sr|$SED -e 's/ //g' -e 's/\.//g' -e 's/IRIX64/IRIX/g'|$TR '[A-Z]' '[a-z]') cpu=mips3 configure_args='--prefix=$prefix' @@ -452,39 +453,30 @@ do_strip_static() # Note that parse_def does most of the work. create_idb() { - local metaprefix fetch_ops parse_def # hackish - FIXME perhaps? local pcpos=${#pc[@]} # First vacant position in the subsys list array $pc - # Compute relative metaprefix - # as $metainstalldir - $topinstalldir - metaprefix=${metainstalldir##$topinstalldir} - metaprefix="${metaprefix#/*}" - [ ! -z "$metaprefix" ] && metaprefix="${metaprefix}/" - [ ! "$metainstalldir" == "/" ] && metainstalldir="${metainstalldir}/" - if [ -d "${stagedir}${metainstalldir}/src" ]; then # We have a srcdir which means we have patches, so add them to the idb file + if [ -d "${stagedir}${metainstalldir}src" ]; then # We have a srcdir which means we have patches, so add them to the idb file add_files "${metaprefix}src" opt.src - root sys "" pc[$pcpos]="opt.src" let "pcpos = pcpos + 1" fi - if [ -d "${stagedir}${metainstalldir}/relnotes" ]; then # We have releasenotes, add them to idb file + if [ -d "${stagedir}${metainstalldir}relnotes" ]; then # We have releasenotes, add them to idb file add_files "${metaprefix}relnotes" opt.relnotes - root sys "" pc[$pcpos]="opt.relnotes" let "pcpos = pcpos + 1" fi -# if [ -d "${stagedir}${metainstalldir}/dist" ]; then # We have spec & idb files -# add_files "dist" opt.dist - root sys "" - pc[$pcpos]="opt.dist" - # Add entries for the spec & idb files (opt.dist), they will be installed later, after they've actually been created - echo "f 0644 root sys ${metainstalldir:1}dist/$topdir-$version-$pkgver/$topdir.idb ${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb ${pkgname}.opt.dist" >>$idbfile - echo "f 0644 root sys ${metainstalldir:1}dist/$topdir-$version-$pkgver/$topdir.spec ${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec ${pkgname}.opt.dist" >>$idbfile - echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb" >> $metadir/files.tmp - echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec" >> $metadir/files.tmp -# fi + # spec & idb files are added unconditionally + pc[$pcpos]="opt.dist" + # Add entries for the spec & idb files (opt.dist), they will be installed later, after they've actually been created + echo "f 0644 root sys ${metainstalldir:1}dist/$topdir-$version-$pkgver/$topdir.idb ${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb ${pkgname}.opt.dist" >>$idbfile + echo "f 0644 root sys ${metainstalldir:1}dist/$topdir-$version-$pkgver/$topdir.spec ${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec ${pkgname}.opt.dist" >>$idbfile + echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb" >> $metadir/files.tmp + echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec" >> $metadir/files.tmp $SORT +4u -6 < $idbfile > $metadir/idbtemp lines=$(wc -l < $metadir/idbtemp) @@ -565,11 +557,7 @@ make_dist() error $E_ARG_OBSO make_dist fi - if [ "$shortroot" -eq 1 ]; then - sbase=$stagedir - else - sbase=$stagedir/$topinstalldir - fi + local sbase=${stagedir}${topinstalldir} local disttmp=/tmp/disttmp$$ $MKDIR $disttmp @@ -723,10 +711,10 @@ check_unpackaged() # auto_src(): Automatically place any patches and srcfiles into the stagedir # params: none # Grabs the original source and any patches and shoves them into -# $prefix/src/$topdir-$version-$pkgver for adding to the opt.src subsystem +# ${metainstalldir}src/$topdir-$version-$pkgver for adding to the opt.src subsystem auto_src() { - local distsrcdir="${stagedir}${metainstalldir}/src/$topdir-$version-$pkgver" + local distsrcdir="${stagedir}${metainstalldir}src/$topdir-$version-$pkgver" # Add patches local numpatch=${#patch[@]} local pnum=0 @@ -802,7 +790,7 @@ set_configure_args() # auto_rel(): Fix up and add releasenotes to stagedir # params: none # This will make some substitutions on a release note template -# and then copy the result to $stagedir/$prefix/relnotes/$topdir-$version-$pkgver.txt +# and then copy the result to $stagedir/${metainstalldir}relnotes/$topdir-$version-$pkgver.txt auto_rel() { local i @@ -813,7 +801,7 @@ auto_rel() [ -r ${metadir}/${i} ] && rn=$i done if [ -r ${metadir}/${rn} ]; then - local relmetadir=${stagedir}${metainstalldir}/relnotes/$topdir-$version-$pkgver + local relmetadir=${stagedir}${metainstalldir}relnotes/$topdir-$version-$pkgver local cf="$(_upls $configure_args)" local fullcf="./configure $cf" local compiler_temp="$(gcc --version 2>&1 | $SED -n '1,1p')" @@ -839,10 +827,10 @@ auto_rel() # auto_dist(): Add idb & spec files to stagedir # params: none # This will copy the newly created idb & spec files to -# the stagedir under dist/$topdir-$version-$pkgver +# the stagedir under ${metainstalldir}dist/$topdir-$version-$pkgver auto_dist() { - local distmetadir=${stagedir}${metainstalldir}/dist/$topdir-$version-$pkgver + local distmetadir=${stagedir}${metainstalldir}dist/$topdir-$version-$pkgver $MKDIR -p $distmetadir $CP $idbfile $distmetadir $CP $specfile $distmetadir @@ -852,7 +840,7 @@ auto_dist() # params: $1 - indicating whether or not the root is complete as described below # We expect generic_install to have made $stagedir the "root" dir # in that all paths below will be complete (ie. /usr/local/bin and not -# just bin) *unless* shortroot=1. +# just bin). generic_pack() { if [ "$1" == "shortroot" ]; then @@ -860,33 +848,38 @@ generic_pack() fi clean meta - # Compute manpage location - local dir_prefix="${prefix#$topinstalldir*}" - - if [ "$shortroot" -eq 1 ]; then - if [ -d $stagedir/${_mandir} ]; then - setdir $stagedir/${_mandir} - [ "$catman" -eq 1 ] && fix_man - [ "$gzman" -eq 1 ] && compress_man - fi - if [ $gzinfo -eq 1 -a -d ${stagedir}/${_infodir} ]; then - setdir $stagedir/${_infodir} - compress_info - fi - setdir stage - metainstalldir=/ - else - if [ -d ${stagedir}${topinstalldir}${dir_prefix}/${_mandir} ]; then - setdir ${stagedir}${topinstalldir}${dir_prefix}/${_mandir} - [ "$catman" -eq 1 ] && fix_man - [ "$gzman" -eq 1 ] && compress_man - fi - if [ $gzinfo -eq 1 -a -d ${stagedir}/${_infodir} ]; then - setdir $stagedir/${_infodir} - compress_info - fi - setdir $stagedir$topinstalldir + if [ -d ${stagedir}${prefix}/${_mandir} ]; then + setdir "${stagedir}${prefix}/${_mandir}" + [ "$catman" -eq 1 ] && fix_man + [ "$gzman" -eq 1 ] && compress_man fi + if [ -d ${stagedir}${prefix}/${_infodir} ]; then + setdir "${stagedir}${prefix}/${_infodir}" + [ "$gzinfo" -eq 1 ] && compress_info + fi + + # pkgdef entries should always be relative to topinstalldir + # except for the auto ones - src,dist,relnotes + # In that case we use metaprefix to designate their position relative + # to topinstalldir (note metainstalldir can never be above topinstalldir) + # ie. topinstalldir=/usr/local/gcc & metainstalldir=/usr/local is a no no. + # but topinstalldir=/usr/local & metainstalldir=/usr/local is okay and is the + # default + # This mostly matters when we have topinstalldir=/ and prefix=/usr/local like + # with prngd and openssh + # Also note that metaprefix is entirely for internal use in create_idb when + # we create the "auto" entries. + setdir ${stagedir}${topinstalldir} + # Determine at what level metainstalldir is compared to topinstalldir + metaprefix=${metainstalldir##$topinstalldir} + metaprefix="${metaprefix#/*}" + # If we have a path then we'll need a / appended + [ ! -z "$metaprefix" ] && metaprefix="${metaprefix}/" + # We need to add slash to the end of metainstalldir but *only* if + # metainstalldir is not /. We do this to avoid creating an absolute path + # which could happen with metainstalldir=/ if we unconditionally add /. + [ ! "$metainstalldir" == "/" ] && metainstalldir="${metainstalldir}/" + auto_src # Add any patches auto_rel # Fix up and add releasenotes create_idb