Cleanup tools usage and only use __ prefixed tool namespace.
This commit is contained in:
parent
17e61dfc80
commit
32e18a9df3
@ -29,54 +29,7 @@ fi
|
|||||||
# All patching will be done from *within* $srcdir/$topsrcdir directory with patch -p1
|
# All patching will be done from *within* $srcdir/$topsrcdir directory with patch -p1
|
||||||
# patches must be in uncompressed format
|
# patches must be in uncompressed format
|
||||||
|
|
||||||
# Define tool programs
|
# Define tools programs in __ prefixed namespace
|
||||||
STRIP=/usr/bin/strip
|
|
||||||
UNAME=/usr/bin/uname
|
|
||||||
TAR=/usr/local/bin/tar # GNU tar please!
|
|
||||||
VTAR=/usr/bin/tar # vendor supplied tar
|
|
||||||
BZIP2=/usr/bin/bzip2
|
|
||||||
GZIP=/usr/bin/gzip
|
|
||||||
PATCH=/usr/local/bin/patch # GNU patch 2.5 or better please!
|
|
||||||
RM=/usr/bin/rm
|
|
||||||
RMDIR=/usr/bin/rmdir
|
|
||||||
MKDIR=/usr/bin/mkdir
|
|
||||||
MAKE_PROG=/usr/local/bin/make # GNU make please!
|
|
||||||
FIND=/usr/bin/find # vendor supplied find, GNU find will require changes to the script
|
|
||||||
XARGS=/usr/bin/xargs
|
|
||||||
CAT=/usr/bin/cat
|
|
||||||
AWK=/usr/bin/nawk # This must be nawk or GNU awk - plain /usr/bin/awk will *not* work
|
|
||||||
SED=/usr/bin/sed
|
|
||||||
GSED=/usr/local/bin/sed
|
|
||||||
SORT=/usr/bin/sort
|
|
||||||
CUT=/usr/bin/cut
|
|
||||||
LS=/usr/bin/ls
|
|
||||||
EXPR=/usr/bin/expr
|
|
||||||
MV=/usr/bin/mv
|
|
||||||
MKDIR=/usr/bin/mkdir
|
|
||||||
CP=/usr/bin/cp
|
|
||||||
TEE=/bin/tee
|
|
||||||
GREP=/bin/grep
|
|
||||||
EGREP=/bin/egrep
|
|
||||||
UNIQ=/bin/uniq
|
|
||||||
BASENAME=/bin/basename
|
|
||||||
DIRNAME=/bin/dirname
|
|
||||||
TR=/bin/tr
|
|
||||||
FILE=/usr/bin/file # Used by do_strip()
|
|
||||||
PRINTF=/usr/bin/printf
|
|
||||||
LN=/usr/bin/ln
|
|
||||||
GINSTALL=/usr/local/bin/install # BSD compatible install - usually GNU install
|
|
||||||
COMPRESS=/usr/bsd/compress
|
|
||||||
PACK=/usr/bin/pack
|
|
||||||
SHA1SUM=/usr/local/bin/sha1sum
|
|
||||||
UNZIP=/usr/local/bin/unzip
|
|
||||||
LDD=/usr/bin/ldd
|
|
||||||
HEAD=/usr/bin/head # Must support -n
|
|
||||||
|
|
||||||
# Groff stuff for manpages
|
|
||||||
NROFF=/usr/local/bin/nroff
|
|
||||||
NROFFOPTS="-c -mandoc -Tascii -t"
|
|
||||||
|
|
||||||
# __ prefixed namespace for tool programs
|
|
||||||
. $BUILDPKG_BASE/scripts/buildpkg.tools
|
. $BUILDPKG_BASE/scripts/buildpkg.tools
|
||||||
|
|
||||||
# Define defaults
|
# Define defaults
|
||||||
@ -115,7 +68,7 @@ _datadir=$_sharedir
|
|||||||
|
|
||||||
tmpdir=/tmp
|
tmpdir=/tmp
|
||||||
|
|
||||||
_os=$($UNAME -sr|$SED -e 's/ //g' -e 's/\.//g'|$TR '[A-Z]' '[a-z]')
|
_os=$(${__uname} -sr|${__sed} -e 's/ //g' -e 's/\.//g'|${__tr} '[A-Z]' '[a-z]')
|
||||||
|
|
||||||
# pkg information.
|
# pkg information.
|
||||||
# The following 3 vars can be used when constructing pkg metadata
|
# The following 3 vars can be used when constructing pkg metadata
|
||||||
@ -282,7 +235,7 @@ patch()
|
|||||||
fi # We are now sure that $patch[$pnum] contains file with absolute path
|
fi # We are now sure that $patch[$pnum] contains file with absolute path
|
||||||
echo "Processing patch[$pnum] - ${patch[$pnum]}"
|
echo "Processing patch[$pnum] - ${patch[$pnum]}"
|
||||||
if [ -r ${patch[$pnum]} ]; then # file is readable
|
if [ -r ${patch[$pnum]} ]; then # file is readable
|
||||||
$PATCH -Es $2 < ${patch[$pnum]}
|
${__patch} -Es $2 < ${patch[$pnum]}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
error $E_PATCH_FAILED patch
|
error $E_PATCH_FAILED patch
|
||||||
fi
|
fi
|
||||||
@ -315,12 +268,12 @@ unpack()
|
|||||||
|
|
||||||
# Determine filetype and unpack
|
# Determine filetype and unpack
|
||||||
case $suffix in
|
case $suffix in
|
||||||
'tar') $TAR -xf ${source[$snum]};;
|
'tar') ${__tar} -xf ${source[$snum]};;
|
||||||
'gz') $GZIP -dc ${source[$snum]} | $TAR -xf -;;
|
'gz') ${__gzip} -dc ${source[$snum]} | ${__tar} -xf -;;
|
||||||
'bz2') $BZIP2 -dc ${source[$snum]} | $TAR -xf -;;
|
'bz2') ${__bzip2} -dc ${source[$snum]} | ${__tar} -xf -;;
|
||||||
'Z') $GZIP -dc ${source[$snum]} | $TAR -xf -;;
|
'Z') ${__gzip} -dc ${source[$snum]} | ${__tar} -xf -;;
|
||||||
'tgz') $GZIP -dc ${source[$snum]} | $TAR -xf -;;
|
'tgz') ${__gzip} -dc ${source[$snum]} | ${__tar} -xf -;;
|
||||||
'zip') $UNZIP -q ${source[$snum]};;
|
'zip') ${__unzip} -q ${source[$snum]};;
|
||||||
*) error $E_BAD_COMPRESS unpack
|
*) error $E_BAD_COMPRESS unpack
|
||||||
esac
|
esac
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -341,34 +294,34 @@ clean()
|
|||||||
case $1 in
|
case $1 in
|
||||||
'source') if [ -d "$srcdir/$topsrcdir" ]; then
|
'source') if [ -d "$srcdir/$topsrcdir" ]; then
|
||||||
echo "Removing $srcdir/$topsrcdir"
|
echo "Removing $srcdir/$topsrcdir"
|
||||||
$RM -rf $srcdir/$topsrcdir
|
${__rm} -rf $srcdir/$topsrcdir
|
||||||
else
|
else
|
||||||
echo "No unpacked source to scrub"
|
echo "No unpacked source to scrub"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
'stage') if [ -d $stagedir -a "$stagedir" != "/" ]; then
|
'stage') if [ -d $stagedir -a "$stagedir" != "/" ]; then
|
||||||
echo "Emptying $stagedir"
|
echo "Emptying $stagedir"
|
||||||
$RM -rf $stagedir # This is very dangerous!
|
${__rm} -rf $stagedir # This is very dangerous!
|
||||||
$MKDIR $stagedir
|
${__mkdir} $stagedir
|
||||||
else
|
else
|
||||||
error $E_BAD_DIR clean
|
error $E_BAD_DIR clean
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
'meta')
|
'meta')
|
||||||
if [ "$($UNAME -s)" == "SunOS" ]; then
|
if [ "$(${__uname} -s)" == "SunOS" ]; then
|
||||||
for secname in $(list_pkgs)
|
for secname in $(list_pkgs)
|
||||||
do
|
do
|
||||||
META_CLEAN="$META_CLEAN prototype.$secname pkginfo.$secname"
|
META_CLEAN="$META_CLEAN prototype.$secname pkginfo.$secname"
|
||||||
pkgname=$(get_pkgname $secname)
|
pkgname=$(get_pkgname $secname)
|
||||||
echo "Removing $buildpkgbase/$pkgdir/$pkgname"
|
echo "Removing $buildpkgbase/$pkgdir/$pkgname"
|
||||||
[ ! -z "$pkgname" ] && $RM -rf $buildpkgbase/$pkgdir/$pkgname
|
[ ! -z "$pkgname" ] && ${__rm} -rf $buildpkgbase/$pkgdir/$pkgname
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $META_CLEAN
|
for i in $META_CLEAN
|
||||||
do
|
do
|
||||||
echo "Removing $metadir/$i"
|
echo "Removing $metadir/$i"
|
||||||
$RM -f $metadir/$i
|
${__rm} -f $metadir/$i
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -376,7 +329,7 @@ clean()
|
|||||||
clean stage
|
clean stage
|
||||||
clean meta
|
clean meta
|
||||||
# Irix only - ugly hack
|
# Irix only - ugly hack
|
||||||
$RM -f $metadir/relnotes*.txt
|
${__rm} -f $metadir/relnotes*.txt
|
||||||
;;
|
;;
|
||||||
*) error $E_BAD_CLEANOPTION clean
|
*) error $E_BAD_CLEANOPTION clean
|
||||||
esac
|
esac
|
||||||
@ -416,22 +369,22 @@ do_autonuke()
|
|||||||
if [ -d "${_infodir}" ]; then
|
if [ -d "${_infodir}" ]; then
|
||||||
if [ -r ${_infodir}/dir ]; then
|
if [ -r ${_infodir}/dir ]; then
|
||||||
echo "Nuking ${_infodir}/dir"
|
echo "Nuking ${_infodir}/dir"
|
||||||
${RM} -f ${_infodir}/dir
|
${__rm} -f ${_infodir}/dir
|
||||||
didnuke=1
|
didnuke=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -d "${_libdir}" ]; then
|
if [ -d "${_libdir}" ]; then
|
||||||
if [ -r ${_libdir}/charset.alias ]; then
|
if [ -r ${_libdir}/charset.alias ]; then
|
||||||
echo "Nuking ${_libdir}/charset.alias"
|
echo "Nuking ${_libdir}/charset.alias"
|
||||||
${RM} -f ${_libdir}/charset.alias
|
${__rm} -f ${_libdir}/charset.alias
|
||||||
didnuke=1
|
didnuke=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -d "${_libdir}" -a ! -z "$($LS ${_libdir}/*.la 2>/dev/null)" ]; then
|
if [ -d "${_libdir}" -a ! -z "$(${__ls} ${_libdir}/*.la 2>/dev/null)" ]; then
|
||||||
for i in ${_libdir}/*.la
|
for i in ${_libdir}/*.la
|
||||||
do
|
do
|
||||||
echo "Nuking $i"
|
echo "Nuking $i"
|
||||||
${RM} -f "$i"
|
${__rm} -f "$i"
|
||||||
done
|
done
|
||||||
didnuke=1
|
didnuke=1
|
||||||
fi
|
fi
|
||||||
@ -462,11 +415,11 @@ symlink_man()
|
|||||||
manpages="$(echo $i/*)"
|
manpages="$(echo $i/*)"
|
||||||
for manpage in $manpages
|
for manpage in $manpages
|
||||||
do
|
do
|
||||||
solink="$($HEAD -n 1 $manpage)"
|
solink="$(${__head} -n 1 $manpage)"
|
||||||
if [ "${solink:0:3}" = ".so" ]; then # .so style link to be converted
|
if [ "${solink:0:3}" = ".so" ]; then # .so style link to be converted
|
||||||
linkdest="${solink#.so*/}"
|
linkdest="${solink#.so*/}"
|
||||||
[ "$symlinkman_verbose" -eq 1 ] && echo "Symlinking $linkdest->$manpage"
|
[ "$symlinkman_verbose" -eq 1 ] && echo "Symlinking $linkdest->$manpage"
|
||||||
$LN -sf "$linkdest" "$manpage"
|
${__ln} -sf "$linkdest" "$manpage"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS="$OIFS"
|
IFS="$OIFS"
|
||||||
@ -489,22 +442,22 @@ fix_man()
|
|||||||
do
|
do
|
||||||
if [ -d $i ]; then
|
if [ -d $i ]; then
|
||||||
catdir=cat${i##man}
|
catdir=cat${i##man}
|
||||||
$MKDIR $catdir
|
${__mkdir} $catdir
|
||||||
cd $i
|
cd $i
|
||||||
for manpage in *
|
for manpage in *
|
||||||
do
|
do
|
||||||
if [ -L "$manpage" ]; then
|
if [ -L "$manpage" ]; then
|
||||||
TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }')
|
TARGET=$(${__ls} -l "$manpage" | ${__awk} '{ print $NF }')
|
||||||
$LN -sf "$TARGET" "$manpage"
|
${__ln} -sf "$TARGET" "$manpage"
|
||||||
$MV "$manpage" "../$catdir"
|
${__mv} "$manpage" "../$catdir"
|
||||||
$RM -f "$manpage"
|
${__rm} -f "$manpage"
|
||||||
else
|
else
|
||||||
$NROFF $NROFFOPTS "$manpage" > "../$catdir/$manpage"
|
${__nroff} $NROFFOPTS "$manpage" > "../$catdir/$manpage"
|
||||||
$RM -f $manpage
|
${__rm} -f $manpage
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
${RMDIR} $i
|
${__rmdir} $i
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -516,15 +469,15 @@ compress_man()
|
|||||||
{
|
{
|
||||||
if [ "$gzman" -eq 1 ]; then # Use gzip
|
if [ "$gzman" -eq 1 ]; then # Use gzip
|
||||||
local compsuffix=gz
|
local compsuffix=gz
|
||||||
local pack=$GZIP
|
local pack=${__gzip}
|
||||||
fi
|
fi
|
||||||
if [ "$compressman" -eq 1 ]; then # Use compress(1)
|
if [ "$compressman" -eq 1 ]; then # Use compress(1)
|
||||||
local compsuffix=Z
|
local compsuffix=Z
|
||||||
local pack="$COMPRESS -f"
|
local pack="${__compress} -f"
|
||||||
fi
|
fi
|
||||||
if [ "$packman" -eq 1 ]; then # Use pack(1)
|
if [ "$packman" -eq 1 ]; then # Use pack(1)
|
||||||
local compsuffix=z
|
local compsuffix=z
|
||||||
local pack="$PACK -f"
|
local pack="${__pack} -f"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Compressing manpages"
|
echo "Compressing manpages"
|
||||||
@ -537,9 +490,9 @@ compress_man()
|
|||||||
suffix="${manpage##*.}"
|
suffix="${manpage##*.}"
|
||||||
if [ "$suffix" != "gz" -a "$suffix" != "Z" ]; then #probably uncompressed...
|
if [ "$suffix" != "gz" -a "$suffix" != "Z" ]; then #probably uncompressed...
|
||||||
if [ -L "$manpage" ]; then
|
if [ -L "$manpage" ]; then
|
||||||
TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }')
|
TARGET=$(${__ls} -l "$manpage" | ${__awk} '{ print $NF }')
|
||||||
$LN -sf "$TARGET".$compsuffix "$manpage".$compsuffix
|
${__ln} -sf "$TARGET".$compsuffix "$manpage".$compsuffix
|
||||||
$RM -f "$manpage"
|
${__rm} -f "$manpage"
|
||||||
else
|
else
|
||||||
$pack "$manpage"
|
$pack "$manpage"
|
||||||
fi
|
fi
|
||||||
@ -558,7 +511,7 @@ compress_info()
|
|||||||
echo "Compressing info pages"
|
echo "Compressing info pages"
|
||||||
for i in *
|
for i in *
|
||||||
do
|
do
|
||||||
${GZIP} $i
|
${__gzip} $i
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,13 +526,13 @@ doc()
|
|||||||
if [ ! -z $# ]; then
|
if [ ! -z $# ]; then
|
||||||
setdir source
|
setdir source
|
||||||
ddir=${stagedir}${prefix}/${_docdir}/${topdir}-${version}
|
ddir=${stagedir}${prefix}/${_docdir}/${topdir}-${version}
|
||||||
${MKDIR} -p $ddir
|
${__mkdir} -p $ddir
|
||||||
echo "Adding docs"
|
echo "Adding docs"
|
||||||
until [ -z "$1" ]
|
until [ -z "$1" ]
|
||||||
do
|
do
|
||||||
for f in $(_upls $1)
|
for f in $(_upls $1)
|
||||||
do
|
do
|
||||||
($TAR -cf - "$f")|(cd $ddir; $TAR -xvBpf -)
|
(${__tar} -cf - "$f")|(cd $ddir; ${__tar} -xvBpf -)
|
||||||
done
|
done
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -690,7 +643,7 @@ generic_build()
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
error $E_BAD_CONFIG generic_build
|
error $E_BAD_CONFIG generic_build
|
||||||
fi
|
fi
|
||||||
$MAKE_PROG $(_upls $make_build_target)
|
${__make} $(_upls $make_build_target)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
error $E_BAD_MAKE generic_build
|
error $E_BAD_MAKE generic_build
|
||||||
fi
|
fi
|
||||||
@ -701,7 +654,7 @@ generic_build()
|
|||||||
generic_check()
|
generic_check()
|
||||||
{
|
{
|
||||||
setdir ${srcdir}/${topsrcdir}/$1
|
setdir ${srcdir}/${topsrcdir}/$1
|
||||||
$MAKE_PROG -k $(_upls $make_check_target)
|
${__make} -k $(_upls $make_check_target)
|
||||||
}
|
}
|
||||||
|
|
||||||
# generic_build_perl(): Build a perl module from source
|
# generic_build_perl(): Build a perl module from source
|
||||||
@ -713,16 +666,16 @@ generic_check()
|
|||||||
generic_build_perl()
|
generic_build_perl()
|
||||||
{
|
{
|
||||||
setdir source
|
setdir source
|
||||||
$GGREP -rsl '^#!.*perl' . |
|
${__ggrep} -rsl '^#!.*perl' . |
|
||||||
$GGREP -v '.bak$' |$XARGS --no-run-if-empty \
|
${__ggrep} -v '.bak$' |${__xargs} --no-run-if-empty \
|
||||||
${__PERL} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
|
${__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
|
||||||
${__PERL} Makefile.PL `${__PERL} -MExtUtils::MakeMaker -e " print qq|PREFIX=${stagedir}${prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ "`
|
${__perl} Makefile.PL `${__perl} -MExtUtils::MakeMaker -e " print qq|PREFIX=${stagedir}${prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ "`
|
||||||
# Now do the actual build using std. generic_build with no_configure=1
|
# Now do the actual build using std. generic_build with no_configure=1
|
||||||
no_configure=1
|
no_configure=1
|
||||||
generic_build
|
generic_build
|
||||||
# And a little extra, this is a candidate for inclusion in plain generic_build
|
# And a little extra, this is a candidate for inclusion in plain generic_build
|
||||||
if [ "$maketest" -eq 1 ]; then
|
if [ "$maketest" -eq 1 ]; then
|
||||||
$MAKE_PROG test
|
${__make} test
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,7 +683,7 @@ generic_build_perl()
|
|||||||
# params: $@ passed directly to make install
|
# params: $@ passed directly to make install
|
||||||
makeinstall()
|
makeinstall()
|
||||||
{
|
{
|
||||||
$MAKE_PROG \
|
${__make} \
|
||||||
prefix=${stagedir}${prefix} \
|
prefix=${stagedir}${prefix} \
|
||||||
exec_prefix=${stagedir}${prefix} \
|
exec_prefix=${stagedir}${prefix} \
|
||||||
bindir=${stagedir}${prefix}/${_bindir} \
|
bindir=${stagedir}${prefix}/${_bindir} \
|
||||||
@ -767,10 +720,10 @@ generic_install()
|
|||||||
clean stage
|
clean stage
|
||||||
if [ "$shortroot" -eq 1 ]; then
|
if [ "$shortroot" -eq 1 ]; then
|
||||||
dest="${stagedir}${prefix}"
|
dest="${stagedir}${prefix}"
|
||||||
${MKDIR} -p "$dest"
|
${__mkdir} -p "$dest"
|
||||||
fi
|
fi
|
||||||
setdir ${srcdir}/${topsrcdir}/$2
|
setdir ${srcdir}/${topsrcdir}/$2
|
||||||
$MAKE_PROG $destvar=$dest install
|
${__make} $destvar=$dest install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
error $E_BAD_MAKE generic_install
|
error $E_BAD_MAKE generic_install
|
||||||
fi
|
fi
|
||||||
@ -792,22 +745,22 @@ generic_install_perl()
|
|||||||
{
|
{
|
||||||
clean stage
|
clean stage
|
||||||
setdir source
|
setdir source
|
||||||
makeinstall $(${__PERL} -MExtUtils::MakeMaker -e " print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=${stagedir}${prefix}| : qq|DESTDIR=${stagedir}| ")
|
makeinstall $(${__perl} -MExtUtils::MakeMaker -e " print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=${stagedir}${prefix}| : qq|DESTDIR=${stagedir}| ")
|
||||||
|
|
||||||
# remove special files
|
# remove special files
|
||||||
$FIND ${stagedir} -name "perllocal.pod" \
|
${__find} ${stagedir} -name "perllocal.pod" \
|
||||||
-o -name ".packlist" \
|
-o -name ".packlist" \
|
||||||
-o -name "*.bs" \
|
-o -name "*.bs" \
|
||||||
| $XARGS -i rm -f {}
|
| ${__xargs} -i rm -f {}
|
||||||
|
|
||||||
# no empty directories
|
# no empty directories
|
||||||
$FIND ${stagedir}${prefix} \
|
${__find} ${stagedir}${prefix} \
|
||||||
-type d -depth \
|
-type d -depth \
|
||||||
-exec rmdir {} \; 2>/dev/null
|
-exec rmdir {} \; 2>/dev/null
|
||||||
|
|
||||||
export BUILDROOT="$stagedir"
|
export BUILDROOT="$stagedir"
|
||||||
|
|
||||||
${__PERL} -MFile::Find -le '
|
${__perl} -MFile::Find -le '
|
||||||
my $buildroot = $ENV{BUILDROOT};
|
my $buildroot = $ENV{BUILDROOT};
|
||||||
find({ wanted => \&wanted, no_chdir => 1}, "$buildroot");
|
find({ wanted => \&wanted, no_chdir => 1}, "$buildroot");
|
||||||
# No docs here, add them in the usual way but to pkgdef.template
|
# No docs here, add them in the usual way but to pkgdef.template
|
||||||
@ -848,7 +801,7 @@ generic_install_perl()
|
|||||||
exit -1
|
exit -1
|
||||||
}
|
}
|
||||||
# For handling any doc lines in the filelist, disabled for now (see above)
|
# For handling any doc lines in the filelist, disabled for now (see above)
|
||||||
#eval $($GREP '^doc' filelist)
|
#eval $(${__grep} '^doc' filelist)
|
||||||
|
|
||||||
# To get stripping etc we call the regular generic_install now but with custom_install=1
|
# To get stripping etc we call the regular generic_install now but with custom_install=1
|
||||||
custom_install=1
|
custom_install=1
|
||||||
@ -879,7 +832,7 @@ esac
|
|||||||
# by generic_install_perl.
|
# by generic_install_perl.
|
||||||
generic_pack_perl()
|
generic_pack_perl()
|
||||||
{
|
{
|
||||||
$CAT $metadir/pkgdef.template $srcdir/$topsrcdir/filelist | $SED -e "s;^$prefix/;;g" > $metadir/pkgdef
|
${__cat} $metadir/pkgdef.template $srcdir/$topsrcdir/filelist | ${__sed} -e "s;^$prefix/;;g" > $metadir/pkgdef
|
||||||
generic_pack "$@"
|
generic_pack "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ declare -a opscript # Ops to associate with opfiles
|
|||||||
pkgprefix=tgc_
|
pkgprefix=tgc_
|
||||||
pkgname=$pkgprefix$topdir
|
pkgname=$pkgprefix$topdir
|
||||||
|
|
||||||
os=irix`$UNAME -r`
|
os=irix`${__uname} -r`
|
||||||
_os=$($UNAME -sr|$SED -e 's/ //g' -e 's/\.//g' -e 's/IRIX64/IRIX/g'|$TR '[A-Z]' '[a-z]')
|
_os=$(${__uname} -sr|${__sed} -e 's/ //g' -e 's/\.//g' -e 's/IRIX64/IRIX/g'|${__tr} '[A-Z]' '[a-z]')
|
||||||
cpu=mips3
|
cpu=mips3
|
||||||
|
|
||||||
configure_args='--prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir}'
|
configure_args='--prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir}'
|
||||||
@ -146,7 +146,7 @@ fix_ver()
|
|||||||
local i
|
local i
|
||||||
local version=$1
|
local version=$1
|
||||||
local rev=${version##*-}
|
local rev=${version##*-}
|
||||||
local ver=$(echo ${version%%-*} | $SED -e 's/-//g' -e 's/[a-zA-Z]//g')
|
local ver=$(echo ${version%%-*} | ${__sed} -e 's/-//g' -e 's/[a-zA-Z]//g')
|
||||||
if [ $useextendedver -eq 1 ]; then
|
if [ $useextendedver -eq 1 ]; then
|
||||||
### experimental
|
### experimental
|
||||||
### zero prefixes all single digits in a versionstring
|
### zero prefixes all single digits in a versionstring
|
||||||
@ -165,7 +165,7 @@ fix_ver()
|
|||||||
fi
|
fi
|
||||||
if [ $useextendedver -eq 0 ]; then
|
if [ $useextendedver -eq 0 ]; then
|
||||||
# Remove the dots
|
# Remove the dots
|
||||||
ver=$(echo $ver | $SED -e 's/\.//g')
|
ver=$(echo $ver | ${__sed} -e 's/\.//g')
|
||||||
fi
|
fi
|
||||||
let "numpad = $ver_width - ${#ver} - ${#rev}"
|
let "numpad = $ver_width - ${#ver} - ${#rev}"
|
||||||
[ $numpad -lt 0 ] && error $E_BAD_VERSION fix_ver
|
[ $numpad -lt 0 ] && error $E_BAD_VERSION fix_ver
|
||||||
@ -279,7 +279,7 @@ fix_fname()
|
|||||||
local return
|
local return
|
||||||
|
|
||||||
# Replace ' ' with '_'
|
# Replace ' ' with '_'
|
||||||
return=$(echo $name|$SED -e 's/ /_/g')
|
return=$(echo $name|${__sed} -e 's/ /_/g')
|
||||||
echo $return
|
echo $return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ add_files()
|
|||||||
# Sometimes $topinstalldir:1 returns garbage when topinstalldir=/
|
# Sometimes $topinstalldir:1 returns garbage when topinstalldir=/
|
||||||
[ "$topinstalldir" = "/" ] && topinstd=""
|
[ "$topinstalldir" = "/" ] && topinstd=""
|
||||||
|
|
||||||
local FILES=$($FIND $fspec -type f -print|$TEE -a $metadir/files.tmp)
|
local FILES=$(${__find} $fspec -type f -print|${__tee} -a $metadir/files.tmp)
|
||||||
OIFS=$IFS # We play IFS tricks so we can handle filenames with embedded spaces
|
OIFS=$IFS # We play IFS tricks so we can handle filenames with embedded spaces
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
@ -317,7 +317,7 @@ add_files()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
permlist=`${__ls} -l "$i" | ${__cut} -d " " -f 1`
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
@ -340,7 +340,7 @@ add_files()
|
|||||||
done
|
done
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
# Handle symlinks
|
# Handle symlinks
|
||||||
local FILES=$($FIND $fspec -type l -print|$TEE -a $metadir/files.tmp)
|
local FILES=$(${__find} $fspec -type l -print|${__tee} -a $metadir/files.tmp)
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
@ -348,12 +348,12 @@ add_files()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
permlist=`${__ls} -l "$i" | ${__cut} -d " " -f 1`
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
fi
|
fi
|
||||||
local temp=`$LS -l "$i"|$CUT -d '>' -f 2`
|
local temp=`${__ls} -l "$i"|${__cut} -d '>' -f 2`
|
||||||
local symval=${temp# }
|
local symval=${temp# }
|
||||||
fname=$(fix_fname "$i")
|
fname=$(fix_fname "$i")
|
||||||
echo "l $perm $owner $group ${topinstd}${slash}$fname $i ${pkgname}.${prodcat} symval($symval)" >>$idbfile
|
echo "l $perm $owner $group ${topinstd}${slash}$fname $i ${pkgname}.${prodcat} symval($symval)" >>$idbfile
|
||||||
@ -381,7 +381,7 @@ add_dir()
|
|||||||
[ "$topinstd" = "/" ] && topinstd=""
|
[ "$topinstd" = "/" ] && topinstd=""
|
||||||
|
|
||||||
# Note that dir blablah is *not* added to $metadir/files.tmp
|
# Note that dir blablah is *not* added to $metadir/files.tmp
|
||||||
#local FILES=$($FIND $fspec -type d -print)
|
#local FILES=$(${__find} $fspec -type d -print)
|
||||||
local FILES=$fspec
|
local FILES=$fspec
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
@ -390,7 +390,7 @@ add_dir()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=$($LS -ld "$i" | $CUT -d " " -f 1)
|
permlist=$(${__ls} -ld "$i" | ${__cut} -d " " -f 1)
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
@ -460,16 +460,16 @@ fetch_depends()
|
|||||||
{
|
{
|
||||||
local reqidx=0
|
local reqidx=0
|
||||||
local havedep=0
|
local havedep=0
|
||||||
[ -r ${depends} ] && $CAT ${depends} > ${depends}_all
|
[ -r ${depends} ] && ${__cat} ${depends} > ${depends}_all
|
||||||
[ -r ${depends}_auto ] && $CAT ${depends}_auto >> ${depends}_all
|
[ -r ${depends}_auto ] && ${__cat} ${depends}_auto >> ${depends}_all
|
||||||
# Are there any deps we should ignore?
|
# Are there any deps we should ignore?
|
||||||
if [ -n "$ignore_deps" ]; then
|
if [ -n "$ignore_deps" ]; then
|
||||||
local j
|
local j
|
||||||
local cmd
|
local cmd
|
||||||
for j in $ignore_deps
|
for j in $ignore_deps
|
||||||
do
|
do
|
||||||
cmd="$(echo $j | $SED -e 's;\.;\\\.;g')"
|
cmd="$(echo $j | ${__sed} -e 's;\.;\\\.;g')"
|
||||||
$GSED -i "/$cmd/d" ${depends}_all
|
${__gsed} -i "/$cmd/d" ${depends}_all
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ -r ${depends}_all ]; then
|
if [ -r ${depends}_all ]; then
|
||||||
@ -484,10 +484,10 @@ fetch_depends()
|
|||||||
# Now if $deplen is longer than the same string with all dots removed
|
# Now if $deplen is longer than the same string with all dots removed
|
||||||
# then we know there was more than one dot and we can assume it's
|
# then we know there was more than one dot and we can assume it's
|
||||||
# not an internal depend
|
# not an internal depend
|
||||||
if [ $deplen -gt "$(/bin/echo -n "$reqpkg" | $TR -d '.' | wc -c)" ]; then
|
if [ $deplen -gt "$(/bin/echo -n "$reqpkg" | ${__tr} -d '.' | wc -c)" ]; then
|
||||||
# External depend
|
# External depend
|
||||||
# Grab version
|
# Grab version
|
||||||
nver="$($SHOWPRODS -n $reqpkg | $GREP $reqpkg | $AWK '{ print $3 }')"
|
nver="$($SHOWPRODS -n $reqpkg | ${__grep} $reqpkg | ${__awk} '{ print $3 }')"
|
||||||
req="$reqpkg $nver maxint"
|
req="$reqpkg $nver maxint"
|
||||||
havedep=1
|
havedep=1
|
||||||
else
|
else
|
||||||
@ -587,10 +587,10 @@ fetch_ops()
|
|||||||
do_strip_bin()
|
do_strip_bin()
|
||||||
{
|
{
|
||||||
echo "Stripping ELF binaries..."
|
echo "Stripping ELF binaries..."
|
||||||
for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \
|
for f in `${__find} . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec ${__file} {} \; | \
|
||||||
$GREP -v ' dynamic lib ' | \
|
${__grep} -v ' dynamic lib ' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
||||||
$STRIP $strip_elf_args $f || :
|
${__strip} $strip_elf_args $f || :
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -602,10 +602,10 @@ do_strip_shared()
|
|||||||
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
||||||
# Please note we don't restrict our search to executable files because
|
# Please note we don't restrict our search to executable files because
|
||||||
# our libraries are not (should not be, at least) +x.
|
# our libraries are not (should not be, at least) +x.
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
for f in `${__find} . -type f -a -exec ${__file} {} \; | \
|
||||||
grep ' dynamic lib ' | \
|
grep ' dynamic lib ' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
||||||
$STRIP $strip_shared_args $f
|
${__strip} $strip_shared_args $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,10 +615,10 @@ do_strip_static()
|
|||||||
{
|
{
|
||||||
echo "Stripping static archives..."
|
echo "Stripping static archives..."
|
||||||
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
for f in `${__find} . -type f -a -exec ${__file} {} \; | \
|
||||||
$GREP 'current ar archive' | \
|
${__grep} 'current ar archive' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*current ar archive .*/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*current ar archive .*/\1/p'`; do
|
||||||
$STRIP $strip_static_args $f
|
${__strip} $strip_static_args $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ create_idb()
|
|||||||
done
|
done
|
||||||
if [ -r ${metadir}/${rn} ]; then
|
if [ -r ${metadir}/${rn} ]; then
|
||||||
local relmetadir=${stagedir}${metainstalldir}relnotes/$topdir-$version-$pkgver
|
local relmetadir=${stagedir}${metainstalldir}relnotes/$topdir-$version-$pkgver
|
||||||
$MKDIR -p $relmetadir
|
${__mkdir} -p $relmetadir
|
||||||
echo "" > ${relmetadir}/${topdir}.txt
|
echo "" > ${relmetadir}/${topdir}.txt
|
||||||
fi
|
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
|
||||||
@ -670,7 +670,7 @@ create_idb()
|
|||||||
echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb" >> $metadir/files.tmp
|
echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.idb" >> $metadir/files.tmp
|
||||||
echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec" >> $metadir/files.tmp
|
echo "${metaprefix}dist/$topdir-$version-$pkgver/$topdir.spec" >> $metadir/files.tmp
|
||||||
|
|
||||||
$SORT +4u -6 < $idbfile > $metadir/idbtemp
|
${__sort} +4u -6 < $idbfile > $metadir/idbtemp
|
||||||
lines=$(wc -l < $metadir/idbtemp)
|
lines=$(wc -l < $metadir/idbtemp)
|
||||||
if [ ! -z "$firstop" ]; then
|
if [ ! -z "$firstop" ]; then
|
||||||
echo "$(head -1 $metadir/idbtemp) $firstop" > $metadir/idbtemp2
|
echo "$(head -1 $metadir/idbtemp) $firstop" > $metadir/idbtemp2
|
||||||
@ -685,7 +685,7 @@ create_idb()
|
|||||||
else
|
else
|
||||||
mv $metadir/idbtemp2 $idbfile
|
mv $metadir/idbtemp2 $idbfile
|
||||||
fi
|
fi
|
||||||
$RM -f $metadir/idbtemp $metadir/idbtemp2
|
${__rm} -f $metadir/idbtemp $metadir/idbtemp2
|
||||||
}
|
}
|
||||||
|
|
||||||
# create_spec(): Create the .spec file.
|
# create_spec(): Create the .spec file.
|
||||||
@ -711,9 +711,9 @@ create_spec()
|
|||||||
spec_img_header ${pctop[$i]} "${pdtop[$i]}" $version-$pkgver >> $specfile
|
spec_img_header ${pctop[$i]} "${pdtop[$i]}" $version-$pkgver >> $specfile
|
||||||
while [ "$pcidx" -lt "$pcsize" ]
|
while [ "$pcidx" -lt "$pcsize" ]
|
||||||
do
|
do
|
||||||
rv=`$EXPR match "${pc[$pcidx]}" ''${pctop[$i]}\\\.''`
|
rv=`${__expr} match "${pc[$pcidx]}" ''${pctop[$i]}\\\.''`
|
||||||
if [ ! "$rv" -eq 0 ]; then # We got a hit!
|
if [ ! "$rv" -eq 0 ]; then # We got a hit!
|
||||||
spec_subsys_header ${pctop[$i]} `echo ${pc[$pcidx]}|$CUT -d . -f 2` "${pd[$pcidx]}" "${ps[$pcidx]}" >> $specfile
|
spec_subsys_header ${pctop[$i]} `echo ${pc[$pcidx]}|${__cut} -d . -f 2` "${pd[$pcidx]}" "${ps[$pcidx]}" >> $specfile
|
||||||
# Add 'replaces' statements
|
# Add 'replaces' statements
|
||||||
spec_subsys_replaces self >> $specfile
|
spec_subsys_replaces self >> $specfile
|
||||||
replacepkgsize=${#replacepkg[@]}
|
replacepkgsize=${#replacepkg[@]}
|
||||||
@ -777,16 +777,16 @@ make_dist()
|
|||||||
|
|
||||||
local sbase=${stagedir}${topinstalldir}
|
local sbase=${stagedir}${topinstalldir}
|
||||||
local disttmp=/tmp/disttmp$$
|
local disttmp=/tmp/disttmp$$
|
||||||
$MKDIR $disttmp
|
${__mkdir} $disttmp
|
||||||
|
|
||||||
local dfile=$(_upls $distfile)
|
local dfile=$(_upls $distfile)
|
||||||
|
|
||||||
$GENDIST $GENDIST_OPTS -rbase $topinstalldir -sbase $sbase -idb $idbfile -spec $specfile -dist $disttmp
|
$GENDIST $GENDIST_OPTS -rbase $topinstalldir -sbase $sbase -idb $idbfile -spec $specfile -dist $disttmp
|
||||||
setdir $disttmp
|
setdir $disttmp
|
||||||
$VTAR -cf $distdir/$dfile $pkgname*
|
${__vtar} -cf $distdir/$dfile $pkgname*
|
||||||
|
|
||||||
setdir stage
|
setdir stage
|
||||||
$RM -rf $disttmp
|
${__rm} -rf $disttmp
|
||||||
echo "Done. Package was created as $dfile"
|
echo "Done. Package was created as $dfile"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -866,9 +866,9 @@ parse_def()
|
|||||||
else # Perhaps we hit 'files'?
|
else # Perhaps we hit 'files'?
|
||||||
if [ "${line:0:5}" == "files" ]; then
|
if [ "${line:0:5}" == "files" ]; then
|
||||||
triplet="${line:6:((${#line}-5-2))}"
|
triplet="${line:6:((${#line}-5-2))}"
|
||||||
defaultperms=$(_upls $(echo $triplet | $AWK -F, '{ print $1 }'))
|
defaultperms=$(_upls $(echo $triplet | ${__awk} -F, '{ print $1 }'))
|
||||||
defaultuid=$(_upls $(echo $triplet | $AWK -F, '{ print $2 }'))
|
defaultuid=$(_upls $(echo $triplet | ${__awk} -F, '{ print $2 }'))
|
||||||
defaultgid=$(_upls $(echo $triplet | $AWK -F, '{ print $3 }'))
|
defaultgid=$(_upls $(echo $triplet | ${__awk} -F, '{ print $3 }'))
|
||||||
foundfiles=1
|
foundfiles=1
|
||||||
else
|
else
|
||||||
if [ $foundfiles -eq 1 ]; then # We already found the 'files' line so this must be the filelist
|
if [ $foundfiles -eq 1 ]; then # We already found the 'files' line so this must be the filelist
|
||||||
@ -906,24 +906,24 @@ check_unpackaged()
|
|||||||
{
|
{
|
||||||
local upf
|
local upf
|
||||||
local i
|
local i
|
||||||
$FIND . -type f -print|$SED -e 's/\.\///g' > $tmpdir/files.tmp
|
${__find} . -type f -print|${__sed} -e 's/\.\///g' > $tmpdir/files.tmp
|
||||||
$FIND . -type l -print|$SED -e 's/\.\///g' >> $tmpdir/files.tmp
|
${__find} . -type l -print|${__sed} -e 's/\.\///g' >> $tmpdir/files.tmp
|
||||||
# $FIND . -type d -print|$SED -e 's/\.\///g'|$GREP -v '^\.' >> $tmpdir/files.tmp
|
# ${__find} . -type d -print|${__sed} -e 's/\.\///g'|${__grep} -v '^\.' >> $tmpdir/files.tmp
|
||||||
$SORT $metadir/files.tmp|$UNIQ > $tmpdir/f1
|
${__sort} $metadir/files.tmp|${__uniq} > $tmpdir/f1
|
||||||
$SORT $tmpdir/files.tmp > $tmpdir/f2
|
${__sort} $tmpdir/files.tmp > $tmpdir/f2
|
||||||
upf="$($CAT $tmpdir/f1 $tmpdir/f2 | $SORT | $UNIQ -u)"
|
upf="$(${__cat} $tmpdir/f1 $tmpdir/f2 | ${__sort} | ${__uniq} -u)"
|
||||||
if [ ! -z "$upf" ]; then
|
if [ ! -z "$upf" ]; then
|
||||||
echo "There are unpackaged files in the stagedir:"
|
echo "There are unpackaged files in the stagedir:"
|
||||||
for i in $upf
|
for i in $upf
|
||||||
do
|
do
|
||||||
echo "${indent4}${i}"
|
echo "${indent4}${i}"
|
||||||
done
|
done
|
||||||
$RM -f $tmpdir/f1 $tmpdir/f2
|
${__rm} -f $tmpdir/f1 $tmpdir/f2
|
||||||
if [ "$ignore_unpackaged_files" -eq 0 ]; then
|
if [ "$ignore_unpackaged_files" -eq 0 ]; then
|
||||||
error $E_UNPACKAGED_FILES check_unpackaged
|
error $E_UNPACKAGED_FILES check_unpackaged
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
$RM -f $tmpdir/f1 $tmpdir/f2
|
${__rm} -f $tmpdir/f1 $tmpdir/f2
|
||||||
}
|
}
|
||||||
|
|
||||||
# auto_src(): Automatically place any patches and srcfiles into the stagedir
|
# auto_src(): Automatically place any patches and srcfiles into the stagedir
|
||||||
@ -937,7 +937,7 @@ auto_src()
|
|||||||
local numpatch=${#patch[@]}
|
local numpatch=${#patch[@]}
|
||||||
local pnum=0
|
local pnum=0
|
||||||
if [ "$numpatch" -gt 0 ]; then
|
if [ "$numpatch" -gt 0 ]; then
|
||||||
$MKDIR -p $distsrcdir
|
${__mkdir} -p $distsrcdir
|
||||||
for ((pnum=0; pnum < $numpatch; pnum++))
|
for ((pnum=0; pnum < $numpatch; pnum++))
|
||||||
do
|
do
|
||||||
if [ ! -z ${patch[$pnum]} ]; then # They didn't give us an empty string
|
if [ ! -z ${patch[$pnum]} ]; then # They didn't give us an empty string
|
||||||
@ -947,7 +947,7 @@ auto_src()
|
|||||||
fi # We are now sure that $patch[$pnum] contains file with absolute path
|
fi # We are now sure that $patch[$pnum] contains file with absolute path
|
||||||
if [ -r ${patch[$pnum]} ]; then # file is readable
|
if [ -r ${patch[$pnum]} ]; then # file is readable
|
||||||
echo "Copying patch[$pnum] - ${patch[$pnum]}"
|
echo "Copying patch[$pnum] - ${patch[$pnum]}"
|
||||||
$CP ${patch[$pnum]} $distsrcdir
|
${__cp} ${patch[$pnum]} $distsrcdir
|
||||||
else
|
else
|
||||||
error $E_BAD_FILE patch
|
error $E_BAD_FILE patch
|
||||||
fi
|
fi
|
||||||
@ -958,7 +958,7 @@ auto_src()
|
|||||||
fi
|
fi
|
||||||
# Add sourcecode
|
# Add sourcecode
|
||||||
if [ $include_source -eq 1 ]; then
|
if [ $include_source -eq 1 ]; then
|
||||||
$MKDIR -p $distsrcdir
|
${__mkdir} -p $distsrcdir
|
||||||
local numsource=${#source[@]}
|
local numsource=${#source[@]}
|
||||||
local snum=0
|
local snum=0
|
||||||
for ((snum=0; $snum < $numsource; snum++))
|
for ((snum=0; $snum < $numsource; snum++))
|
||||||
@ -969,7 +969,7 @@ auto_src()
|
|||||||
fi # We are now sure that ${source[$snum]} contains file with absolute path
|
fi # We are now sure that ${source[$snum]} contains file with absolute path
|
||||||
if [ -r ${source[$snum]} ]; then
|
if [ -r ${source[$snum]} ]; then
|
||||||
echo "Copying source[$snum] - ${source[$snum]}"
|
echo "Copying source[$snum] - ${source[$snum]}"
|
||||||
$CP ${source[$snum]} $distsrcdir
|
${__cp} ${source[$snum]} $distsrcdir
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@ -991,14 +991,14 @@ rel_conf_sub()
|
|||||||
# Duplicated code from auto_rel :(
|
# Duplicated code from auto_rel :(
|
||||||
# compute configure info for relnotes
|
# compute configure info for relnotes
|
||||||
local cf="$(_upls $configure_args)"
|
local cf="$(_upls $configure_args)"
|
||||||
[ -n "$ac_overrides" ] && local aco="$(echo $ac_overrides | $TR ' ' '\n' | $AWK '{ printf "%s \\\\ \\n",$0 }')"
|
[ -n "$ac_overrides" ] && local aco="$(echo $ac_overrides | ${__tr} ' ' '\n' | ${__awk} '{ printf "%s \\\\ \\n",$0 }')"
|
||||||
local temp_fullcf="$(echo "$__configure $cf" | $AWK '{ printf "%s\\n",$0 }')"
|
local temp_fullcf="$(echo "$__configure $cf" | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
||||||
# Remove trailing whitespace and \n
|
# Remove trailing whitespace and \n
|
||||||
local fullcf="${temp_fullcf%\\*}"
|
local fullcf="${temp_fullcf%\\*}"
|
||||||
# end
|
# end
|
||||||
if [ -r ${metadir}/${rn} ]; then
|
if [ -r ${metadir}/${rn} ]; then
|
||||||
$SED -e "s;%%CONFIGURE%%;$fullcf;g" \
|
${__sed} -e "s;%%CONFIGURE%%;$fullcf;g" \
|
||||||
${metadir}/${rn} > ${metadir}/${rn}.txt
|
${metadir}/${rn} > ${metadir}/${rn}.txt
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -1031,14 +1031,14 @@ auto_rel()
|
|||||||
local relmetadir=${stagedir}${metainstalldir}relnotes/$topdir-$version-$pkgver
|
local relmetadir=${stagedir}${metainstalldir}relnotes/$topdir-$version-$pkgver
|
||||||
# compute configure info for relnotes
|
# compute configure info for relnotes
|
||||||
local cf="$(_upls $configure_args)"
|
local cf="$(_upls $configure_args)"
|
||||||
[ -n "$ac_overrides" ] && local aco="$(for ar in $ac_overrides; do echo $ar; done | $AWK '{ printf "%s \\\\ \\n",$0 }')"
|
[ -n "$ac_overrides" ] && local aco="$(for ar in $ac_overrides; do echo $ar; done | ${__awk} '{ printf "%s \\\\ \\n",$0 }')"
|
||||||
local temp_fullcf="$(echo "$__configure $cf" | $AWK '{ printf "%s\\n",$0 }')"
|
local temp_fullcf="$(echo "$__configure $cf" | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
||||||
# Remove trailing whitespace and \n
|
# Remove trailing whitespace and \n
|
||||||
local fullcf="${temp_fullcf%\\*}"
|
local fullcf="${temp_fullcf%\\*}"
|
||||||
# end
|
# end
|
||||||
if [ $mipspro -eq 0 ]; then
|
if [ $mipspro -eq 0 ]; then
|
||||||
local compiler_temp="$(gcc --version 2>&1 | $SED -n '1,1p')"
|
local compiler_temp="$(gcc --version 2>&1 | ${__sed} -n '1,1p')"
|
||||||
local compiler="gcc ${compiler_temp##* }"
|
local compiler="gcc ${compiler_temp##* }"
|
||||||
else # not gcc
|
else # not gcc
|
||||||
if [ "$_os" = "irix53" ]; then
|
if [ "$_os" = "irix53" ]; then
|
||||||
@ -1048,14 +1048,14 @@ auto_rel()
|
|||||||
fi
|
fi
|
||||||
if [ "$CXX" = "g++" ]; then
|
if [ "$CXX" = "g++" ]; then
|
||||||
# SGI cc with gnu g++
|
# SGI cc with gnu g++
|
||||||
local compiler_temp="$(g++ --version 2>&1 | $SED -n '1,1p')"
|
local compiler_temp="$(g++ --version 2>&1 | ${__sed} -n '1,1p')"
|
||||||
local compiler="$((echo $compiler; echo g++ ${compiler_temp##* }) | $AWK '{ printf "%s\\n",$0 }')"
|
local compiler="$((echo $compiler; echo g++ ${compiler_temp##* }) | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
local compiler="${compiler%\\*}"
|
local compiler="${compiler%\\*}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
local pkgnam_temp=$($GREP 'pkgname=' $metadir/pkgdef)
|
local pkgnam_temp=$(${__grep} 'pkgname=' $metadir/pkgdef)
|
||||||
local pkgnam=$(_upls ${pkgnam_temp#pkgname=*})
|
local pkgnam=$(_upls ${pkgnam_temp#pkgname=*})
|
||||||
local vendor_temp=$($GREP 'pkgvendor=' $metadir/pkgdef)
|
local vendor_temp=$(${__grep} 'pkgvendor=' $metadir/pkgdef)
|
||||||
local vendor=$(_upls ${vendor_temp#pkgvendor=*})
|
local vendor=$(_upls ${vendor_temp#pkgvendor=*})
|
||||||
local packager="${pkgedby} <${email}>"
|
local packager="${pkgedby} <${email}>"
|
||||||
# Compute SHA1 sums for all source entries
|
# Compute SHA1 sums for all source entries
|
||||||
@ -1076,22 +1076,22 @@ auto_rel()
|
|||||||
# into relnotes we cd first then run sha1sum
|
# into relnotes we cd first then run sha1sum
|
||||||
path="${source[$s]%/*}" # Extract path part
|
path="${source[$s]%/*}" # Extract path part
|
||||||
file="${source[$s]##*/}" # Extract filename part
|
file="${source[$s]##*/}" # Extract filename part
|
||||||
(cd "$path"; $SHA1SUM "$file") >> $metadir/sums
|
(cd "$path"; ${__sha1sum} "$file") >> $metadir/sums
|
||||||
done
|
done
|
||||||
[ -r "$metadir/sums" ] && temp_source_sha1sum="$(cat $metadir/sums | $AWK '{ printf "%s\\n",$0 }')"
|
[ -r "$metadir/sums" ] && temp_source_sha1sum="$(cat $metadir/sums | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
source_sha1sum="${temp_source_sha1sum%\\*}"
|
source_sha1sum="${temp_source_sha1sum%\\*}"
|
||||||
# End of SHA1 sum computing
|
# End of SHA1 sum computing
|
||||||
local temp_extracted_env="$($SED -e 's/export /echo ENV /g' ${buildpkgbase}/${pkgdir}/build.sh >> /tmp/env.sh; bash /tmp/env.sh|$GREP ^ENV|$SED -e 's/ENV //g'|$AWK '{ printf "%s\\n",$0 }' && $RM -f /tmp/env.sh)"
|
local temp_extracted_env="$(${__sed} -e 's/export /echo ENV /g' ${buildpkgbase}/${pkgdir}/build.sh >> /tmp/env.sh; bash /tmp/env.sh|${__grep} ^ENV|${__sed} -e 's/ENV //g'|${__awk} '{ printf "%s\\n",$0 }' && ${__rm} -f /tmp/env.sh)"
|
||||||
# Remove trailing \n
|
# Remove trailing \n
|
||||||
local extracted_env="${temp_extracted_env%\\*}"
|
local extracted_env="${temp_extracted_env%\\*}"
|
||||||
if [ -r ${depends}_all ]; then
|
if [ -r ${depends}_all ]; then
|
||||||
local temp_deps="$($CAT ${depends}_all | $GREP -v $pkgnam | $GREP $pkgprefix | $SED -e "s/.*${pkgprefix}//" | $CUT -d. -f1 | $SORT -u | $AWK '{ printf "%s\\n",$0 }')"
|
local temp_deps="$(${__cat} ${depends}_all | ${__grep} -v $pkgnam | ${__grep} $pkgprefix | ${__sed} -e "s/.*${pkgprefix}//" | ${__cut} -d. -f1 | ${__sort} -u | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
else
|
else
|
||||||
local temp_deps=""
|
local temp_deps=""
|
||||||
fi
|
fi
|
||||||
local deps="${temp_deps%\\*}"
|
local deps="${temp_deps%\\*}"
|
||||||
$MKDIR -p $relmetadir
|
${__mkdir} -p $relmetadir
|
||||||
$SED -e "s;%%PKGNAME%%;${pkgnam};g" \
|
${__sed} -e "s;%%PKGNAME%%;${pkgnam};g" \
|
||||||
-e "s;%%SOURCE_AND_VER%%;${topdir}-${version};g" \
|
-e "s;%%SOURCE_AND_VER%%;${topdir}-${version};g" \
|
||||||
-e "s;%%CONFIGURE%%;${fullcf};g" \
|
-e "s;%%CONFIGURE%%;${fullcf};g" \
|
||||||
-e "s;%%COMPILER%%;${compiler};g" \
|
-e "s;%%COMPILER%%;${compiler};g" \
|
||||||
@ -1113,9 +1113,9 @@ auto_rel()
|
|||||||
auto_dist()
|
auto_dist()
|
||||||
{
|
{
|
||||||
local distmetadir=${stagedir}${metainstalldir}dist/$topdir-$version-$pkgver
|
local distmetadir=${stagedir}${metainstalldir}dist/$topdir-$version-$pkgver
|
||||||
$MKDIR -p $distmetadir
|
${__mkdir} -p $distmetadir
|
||||||
$CP $idbfile $distmetadir
|
${__cp} $idbfile $distmetadir
|
||||||
$CP $specfile $distmetadir
|
${__cp} $specfile $distmetadir
|
||||||
}
|
}
|
||||||
|
|
||||||
# dep_pkg_name: Given a filename it will look it up and find the subsystemname
|
# dep_pkg_name: Given a filename it will look it up and find the subsystemname
|
||||||
@ -1129,8 +1129,8 @@ dep_pkg_name()
|
|||||||
do
|
do
|
||||||
for i in $files
|
for i in $files
|
||||||
do
|
do
|
||||||
[ -L "$i" -a $deps_resolve_symlinks -eq 1 ] && i=$(${READLINK} -f "$i")
|
[ -L "$i" -a $deps_resolve_symlinks -eq 1 ] && i=$(${__readlink} -f "$i")
|
||||||
pkg=$(${GREP} " ${i:1}$" $showfilescache 2>/dev/null)
|
pkg=$(${__grep} " ${i:1}$" $showfilescache 2>/dev/null)
|
||||||
if [ -n "$pkg" ]; then
|
if [ -n "$pkg" ]; then
|
||||||
#echo "Found $i in $pkg" >> /tmp/depdebug
|
#echo "Found $i in $pkg" >> /tmp/depdebug
|
||||||
echo "$pkg"
|
echo "$pkg"
|
||||||
@ -1150,46 +1150,46 @@ extract_deps()
|
|||||||
cd ${stagedir}${topinstalldir}
|
cd ${stagedir}${topinstalldir}
|
||||||
|
|
||||||
# Grab the filelist and classify files
|
# Grab the filelist and classify files
|
||||||
local filelist=$($GREP $1 $idbfile | $AWK '{ print $6 }')
|
local filelist=$(${__grep} $1 $idbfile | ${__awk} '{ print $6 }')
|
||||||
local exelist=$(echo $filelist | $XARGS $FILE | $EGREP -v ":.* (commands|script) " | $GREP ":.*executable" | $CUT -d: -f1)
|
local exelist=$(echo $filelist | ${__xargs} ${__file} | ${__egrep} -v ":.* (commands|script) " | ${__grep} ":.*executable" | ${__cut} -d: -f1)
|
||||||
local scriptlist=$(echo $filelist | $XARGS $FILE | $EGREP ":.* (commands|script) " | $CUT -d: -f1)
|
local scriptlist=$(echo $filelist | ${__xargs} ${__file} | ${__egrep} ":.* (commands|script) " | ${__cut} -d: -f1)
|
||||||
local liblist=$(echo $filelist | $XARGS $FILE | $GREP ":.*dynamic lib" | $CUT -d: -f1)
|
local liblist=$(echo $filelist | ${__xargs} ${__file} | ${__grep} ":.*dynamic lib" | ${__cut} -d: -f1)
|
||||||
|
|
||||||
# Compute dependencies for executables
|
# Compute dependencies for executables
|
||||||
if [ -n "$exelist" ]; then
|
if [ -n "$exelist" ]; then
|
||||||
for f in $exelist; do
|
for f in $exelist; do
|
||||||
[ -r $f -a -x $f ] || continue
|
[ -r $f -a -x $f ] || continue
|
||||||
# Generic Irix ldd
|
# Generic Irix ldd
|
||||||
# $LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2
|
# ${__ldd} $f | ${__grep} \= | ${__awk} -F' ' '{ print $3 }' | ${__cut} -d\ -f2
|
||||||
# Ariel Faigons perl5 ldd
|
# Ariel Faigons perl5 ldd
|
||||||
$LDD $f | $GREP \= | $GREP -v 'not found' | $SED -e 's/.*=> //g'
|
${__ldd} $f | ${__grep} \= | ${__grep} -v 'not found' | ${__sed} -e 's/.*=> //g'
|
||||||
done | $SORT -u | dep_pkg_name | $AWK '{ print $4 }' | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__awk} '{ print $4 }' | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
# Compute dependencies for dynamic libraries
|
# Compute dependencies for dynamic libraries
|
||||||
if [ -n "$liblist" ]; then
|
if [ -n "$liblist" ]; then
|
||||||
for f in $liblist; do
|
for f in $liblist; do
|
||||||
[ -r $f ] || continue
|
[ -r $f ] || continue
|
||||||
# Generic Irix ldd
|
# Generic Irix ldd
|
||||||
#$LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2
|
#${__ldd} $f | ${__grep} \= | ${__awk} -F' ' '{ print $3 }' | ${__cut} -d\ -f2
|
||||||
# Ariel Faigon's perl5 ldd
|
# Ariel Faigon's perl5 ldd
|
||||||
$LDD $f | $GREP \= | $GREP -v 'not found' | $SED -e 's/.*=> //g'
|
${__ldd} $f | ${__grep} \= | ${__grep} -v 'not found' | ${__sed} -e 's/.*=> //g'
|
||||||
done | $SORT -u | dep_pkg_name | $AWK '{ print $4 }' | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__awk} '{ print $4 }' | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
# Compute dependencies for scripts
|
# Compute dependencies for scripts
|
||||||
if [ -n "$scriptlist" ]; then
|
if [ -n "$scriptlist" ]; then
|
||||||
for f in $scriptlist; do
|
for f in $scriptlist; do
|
||||||
[ -r $f -a -x $f ] || continue
|
[ -r $f -a -x $f ] || continue
|
||||||
interp="$($HEAD -n 1 $f | $CUT -d\! -f2- | $SED -e 's/ -.*//')"
|
interp="$(${__head} -n 1 $f | ${__cut} -d\! -f2- | ${__sed} -e 's/ -.*//')"
|
||||||
if [ -L "$interp" ]; then
|
if [ -L "$interp" ]; then
|
||||||
echo $($FILE -h "$interp" | $SED -e 's/.* to //')
|
echo $(${__file} -h "$interp" | ${__sed} -e 's/.* to //')
|
||||||
else
|
else
|
||||||
if [ "$(echo $interp | $CUT -d' ' -f1)" = "/usr/bin/env" ]; then
|
if [ "$(echo $interp | ${__cut} -d' ' -f1)" = "/usr/bin/env" ]; then
|
||||||
echo "/usr/bin/env"
|
echo "/usr/bin/env"
|
||||||
else
|
else
|
||||||
echo $interp
|
echo $interp
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done | $SORT -u | dep_pkg_name | $AWK '{ print $4 }' | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__awk} '{ print $4 }' | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1208,15 +1208,15 @@ auto_deps()
|
|||||||
# Populate showfiles cache
|
# Populate showfiles cache
|
||||||
$SHOWFILES -l > $showfilescache
|
$SHOWFILES -l > $showfilescache
|
||||||
|
|
||||||
subsystems="$($AWK '{ print $7 }' < $idbfile | $SORT -u | $GREP sw)"
|
subsystems="$(${__awk} '{ print $7 }' < $idbfile | ${__sort} -u | ${__grep} sw)"
|
||||||
for i in $subsystems
|
for i in $subsystems
|
||||||
do
|
do
|
||||||
deps="$(extract_deps $i)"
|
deps="$(extract_deps $i)"
|
||||||
for j in $deps
|
for j in $deps
|
||||||
do
|
do
|
||||||
echo "${i#*.} $j $($SHOWPRODS -n $j | $GREP $j | $AWK '{ print $3 }') maxint"
|
echo "${i#*.} $j $($SHOWPRODS -n $j | ${__grep} $j | ${__awk} '{ print $3 }') maxint"
|
||||||
done
|
done
|
||||||
done | $SORT -u | grep $pkgprefix > ${depends}_auto
|
done | ${__sort} -u | grep $pkgprefix > ${depends}_auto
|
||||||
rm -f $showfilescache
|
rm -f $showfilescache
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ PKGMK=/usr/bin/pkgmk
|
|||||||
PKGTRANS=/usr/bin/pkgtrans
|
PKGTRANS=/usr/bin/pkgtrans
|
||||||
|
|
||||||
# Override generic location
|
# Override generic location
|
||||||
STRIP=/usr/ccs/bin/strip
|
__strip=/usr/ccs/bin/strip
|
||||||
# /usr/ccs/bin/strip destroys the symbol table in static archives
|
# /usr/ccs/bin/strip destroys the symbol table in static archives
|
||||||
# So this is disabled by default
|
# So this is disabled by default
|
||||||
dostrip_static=0
|
dostrip_static=0
|
||||||
@ -34,7 +34,7 @@ pkgedby="Tom G. Christensen"
|
|||||||
email=swpkg@jupiterrise.com
|
email=swpkg@jupiterrise.com
|
||||||
|
|
||||||
arch=`uname -p`
|
arch=`uname -p`
|
||||||
os=sunos`$UNAME -r`
|
os=sunos`${__uname} -r`
|
||||||
# Courtesy of nba (see dm2conv/solaris/mkpkg.sh)
|
# Courtesy of nba (see dm2conv/solaris/mkpkg.sh)
|
||||||
#case $os in
|
#case $os in
|
||||||
#5.[0123456]|5.5.1)
|
#5.[0123456]|5.5.1)
|
||||||
@ -125,13 +125,13 @@ pack_info()
|
|||||||
fi
|
fi
|
||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
local pstamp="$os-$($UNAME -n)`date '+%Y%m%d%H%M'`"
|
local pstamp="$os-$(${__uname} -n)`date '+%Y%m%d%H%M'`"
|
||||||
|
|
||||||
# Check length of pkgname and name to make sure we're within limits
|
# Check length of pkgname and name to make sure we're within limits
|
||||||
[ ${#pkgname} -gt 9 ] && error $E_SVR4_PKG_OVERFLOW pack_info
|
[ ${#pkgname} -gt 9 ] && error $E_SVR4_PKG_OVERFLOW pack_info
|
||||||
[ ${#name} -gt 256 ] && error $E_SVR4_NAME_OVERFLOW pack_info
|
[ ${#name} -gt 256 ] && error $E_SVR4_NAME_OVERFLOW pack_info
|
||||||
|
|
||||||
$SED -e "s#%%pkgname%%#$pkgname#g" \
|
${__sed} -e "s#%%pkgname%%#$pkgname#g" \
|
||||||
-e "s#%%version%%#$version#g" \
|
-e "s#%%version%%#$version#g" \
|
||||||
-e "s#%%pkgcat%%#$pkgcat#g" \
|
-e "s#%%pkgcat%%#$pkgcat#g" \
|
||||||
-e "s#%%pkgvendor%%#$pkgvendor - packaged by $pkgedby#g" \
|
-e "s#%%pkgvendor%%#$pkgvendor - packaged by $pkgedby#g" \
|
||||||
@ -153,9 +153,9 @@ list_pkgs()
|
|||||||
local i
|
local i
|
||||||
local it
|
local it
|
||||||
# We can't rely on shell expansion here since we would be burned if * is empty!
|
# We can't rely on shell expansion here since we would be burned if * is empty!
|
||||||
for i in $($LS -1 $metadir/prototype.* 2>/dev/null)
|
for i in $(${__ls} -1 $metadir/prototype.* 2>/dev/null)
|
||||||
do
|
do
|
||||||
it=$($BASENAME $i)
|
it=$(${__basename} $i)
|
||||||
echo ${it##prototype.}
|
echo ${it##prototype.}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ add_proto()
|
|||||||
local fspec=$(_upls $4)
|
local fspec=$(_upls $4)
|
||||||
local secname=$5
|
local secname=$5
|
||||||
|
|
||||||
local FILES=$($FIND $fspec -type f -print|$TEE -a $metadir/files.tmp)
|
local FILES=$(${__find} $fspec -type f -print|${__tee} -a $metadir/files.tmp)
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
@ -256,7 +256,7 @@ add_proto()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=$($LS -l "$i" | $CUT -d " " -f 1)
|
permlist=$(${__ls} -l "$i" | ${__cut} -d " " -f 1)
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
@ -265,7 +265,7 @@ add_proto()
|
|||||||
done
|
done
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
# Handle symlinks
|
# Handle symlinks
|
||||||
local FILES=$($FIND $fspec -type l -print|$TEE -a $metadir/files.tmp)
|
local FILES=$(${__find} $fspec -type l -print|${__tee} -a $metadir/files.tmp)
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
@ -273,16 +273,16 @@ add_proto()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=$($LS -l "$i" | $CUT -d " " -f 1)
|
permlist=$(${__ls} -l "$i" | ${__cut} -d " " -f 1)
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
fi
|
fi
|
||||||
local temp=`$LS -l "$i"|$CUT -d '>' -f 2`
|
local temp=`${__ls} -l "$i"|${__cut} -d '>' -f 2`
|
||||||
local symval=${temp# }
|
local symval=${temp# }
|
||||||
echo "s none $i=$symval $perm $owner $group" >> $metadir/prototype.$secname
|
echo "s none $i=$symval $perm $owner $group" >> $metadir/prototype.$secname
|
||||||
done
|
done
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
# Handle directories
|
# Handle directories
|
||||||
local FILES=$($FIND $fspec -type d -print|$TEE -a $metadir/files.tmp)
|
local FILES=$(${__find} $fspec -type d -print|${__tee} -a $metadir/files.tmp)
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
@ -290,7 +290,7 @@ add_proto()
|
|||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=$($LS -ld "$i" | $CUT -d " " -f 1)
|
permlist=$(${__ls} -ld "$i" | ${__cut} -d " " -f 1)
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
@ -315,7 +315,7 @@ add_dir()
|
|||||||
local secname=$5
|
local secname=$5
|
||||||
|
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=$($LS -ld "$dir" | $CUT -d " " -f 1)
|
permlist=$(${__ls} -ld "$dir" | ${__cut} -d " " -f 1)
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
else
|
else
|
||||||
perm=$defperm
|
perm=$defperm
|
||||||
@ -342,23 +342,23 @@ auto_rel()
|
|||||||
local relmetadir=${stagedir}${metainstalldir}relnotes/$secname-$version-$pkgver
|
local relmetadir=${stagedir}${metainstalldir}relnotes/$secname-$version-$pkgver
|
||||||
### compute configure info for relnotes
|
### compute configure info for relnotes
|
||||||
local cf="$(_upls $configure_args)"
|
local cf="$(_upls $configure_args)"
|
||||||
[ -n "$ac_overrides" ] && local aco="$(for ar in $ac_overrides; do echo $ar; done | $AWK '{ printf "%s \\\\ \\n",$0 }')"
|
[ -n "$ac_overrides" ] && local aco="$(for ar in $ac_overrides; do echo $ar; done | ${__awk} '{ printf "%s \\\\ \\n",$0 }')"
|
||||||
local temp_fullcf="$(echo "$__configure $cf" | $AWK '{ printf "%s\\n",$0 }')"
|
local temp_fullcf="$(echo "$__configure $cf" | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
temp_fullcf="$(echo "${aco}${temp_fullcf}")"
|
||||||
# Remove trailing whitespace and \n
|
# Remove trailing whitespace and \n
|
||||||
local fullcf="${temp_fullcf%\\*}"
|
local fullcf="${temp_fullcf%\\*}"
|
||||||
###
|
###
|
||||||
### compute compiler info for relnotes
|
### compute compiler info for relnotes
|
||||||
if [ $suncc -eq 0 ]; then
|
if [ $suncc -eq 0 ]; then
|
||||||
#local compiler_temp="$(gcc --version 2>&1 | $SED -n '1,1p')"
|
#local compiler_temp="$(gcc --version 2>&1 | ${__sed} -n '1,1p')"
|
||||||
#local compiler="gcc ${compiler_temp##* }"
|
#local compiler="gcc ${compiler_temp##* }"
|
||||||
local compiler="$(gcc -v 2>&1 | $SED -n '/^gcc/ s/ version//p')"
|
local compiler="$(gcc -v 2>&1 | ${__sed} -n '/^gcc/ s/ version//p')"
|
||||||
else # not gcc
|
else # not gcc
|
||||||
local compiler="$(cc -version 2>&1)"
|
local compiler="$(cc -version 2>&1)"
|
||||||
if [ "$CXX" = "g++" ]; then
|
if [ "$CXX" = "g++" ]; then
|
||||||
# SUN cc with gnu g++
|
# SUN cc with gnu g++
|
||||||
local compiler_temp="$(g++ --version 2>&1 | $SED -n '1,1p')"
|
local compiler_temp="$(g++ --version 2>&1 | ${__sed} -n '1,1p')"
|
||||||
local compiler="$((echo $compiler; echo g++ ${compiler_temp##* }) | $AWK '{ printf "%s\\n",$0 }')"
|
local compiler="$((echo $compiler; echo g++ ${compiler_temp##* }) | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
local compiler="${compiler%\\*}"
|
local compiler="${compiler%\\*}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -387,23 +387,23 @@ auto_rel()
|
|||||||
# into relnotes we cd first then run sha1sum
|
# into relnotes we cd first then run sha1sum
|
||||||
path="${source[$s]%/*}" # Extract path part
|
path="${source[$s]%/*}" # Extract path part
|
||||||
file="${source[$s]##*/}" # Extract filename part
|
file="${source[$s]##*/}" # Extract filename part
|
||||||
(cd "$path"; $SHA1SUM "$file") >> $metadir/sums.${secname}
|
(cd "$path"; ${__sha1sum} "$file") >> $metadir/sums.${secname}
|
||||||
let s=s+1
|
let s=s+1
|
||||||
done
|
done
|
||||||
[ -r "$metadir/sums.${secname}" ] && temp_source_sha1sum="$(cat $metadir/sums.${secname} | $AWK '{ printf "%s\\n",$0 }')"
|
[ -r "$metadir/sums.${secname}" ] && temp_source_sha1sum="$(cat $metadir/sums.${secname} | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
source_sha1sum="${temp_source_sha1sum%\\*}"
|
source_sha1sum="${temp_source_sha1sum%\\*}"
|
||||||
### End of SHA1 sum computing
|
### End of SHA1 sum computing
|
||||||
### Extract environtment variables
|
### Extract environtment variables
|
||||||
local temp_extracted_env="$($SED -e 's/export /echo ENV /g' ${buildpkgbase}/${pkgdir}/build.sh >> /tmp/env.sh; bash /tmp/env.sh|$GREP ^ENV|$SED -e 's/ENV //g'|$AWK '{ printf "%s\\n",$0 }' && $RM -f /tmp/env.sh)"
|
local temp_extracted_env="$(${__sed} -e 's/export /echo ENV /g' ${buildpkgbase}/${pkgdir}/build.sh >> /tmp/env.sh; bash /tmp/env.sh|${__grep} ^ENV|${__sed} -e 's/ENV //g'|${__awk} '{ printf "%s\\n",$0 }' && ${__rm} -f /tmp/env.sh)"
|
||||||
# Remove trailing \n
|
# Remove trailing \n
|
||||||
local extracted_env="${temp_extracted_env%\\*}"
|
local extracted_env="${temp_extracted_env%\\*}"
|
||||||
###
|
###
|
||||||
### Add dependencies
|
### Add dependencies
|
||||||
local temp_deps="$($CAT $metadir/depend.$secname.all | $SED -e '/^$/d;/^ /d' | $SORT -u | $AWK '{ printf "%s\\n",$0 }')"
|
local temp_deps="$(${__cat} $metadir/depend.$secname.all | ${__sed} -e '/^$/d;/^ /d' | ${__sort} -u | ${__awk} '{ printf "%s\\n",$0 }')"
|
||||||
local deps="${temp_deps%\\*}"
|
local deps="${temp_deps%\\*}"
|
||||||
###
|
###
|
||||||
$MKDIR -p $relmetadir
|
${__mkdir} -p $relmetadir
|
||||||
$GSED -e "s;%%PKGNAME%%;${pkgnam};g" \
|
${__gsed} -e "s;%%PKGNAME%%;${pkgnam};g" \
|
||||||
-e "s;%%SOURCE_AND_VER%%;${topdir}-${version};g" \
|
-e "s;%%SOURCE_AND_VER%%;${topdir}-${version};g" \
|
||||||
-e "s;%%CONFIGURE%%;${fullcf};g" \
|
-e "s;%%CONFIGURE%%;${fullcf};g" \
|
||||||
-e "s;%%COMPILER%%;${compiler};g" \
|
-e "s;%%COMPILER%%;${compiler};g" \
|
||||||
@ -436,8 +436,8 @@ auto_dir()
|
|||||||
local i
|
local i
|
||||||
local j
|
local j
|
||||||
|
|
||||||
fdirs=$($AWK '/^[fs]/ { print $3 }' $metadir/prototype.$secname | $SED -e 's,\(.*\)=.*$,\1,' | $SED -e 's,\(.*\)/.*$,\1,' | $SORT -u)
|
fdirs=$(${__awk} '/^[fs]/ { print $3 }' $metadir/prototype.$secname | ${__sed} -e 's,\(.*\)=.*$,\1,' | ${__sed} -e 's,\(.*\)/.*$,\1,' | ${__sort} -u)
|
||||||
ddirs=$($AWK '/^d/ { print $3 }' $metadir/prototype.$secname | $SORT -u)
|
ddirs=$(${__awk} '/^d/ { print $3 }' $metadir/prototype.$secname | ${__sort} -u)
|
||||||
|
|
||||||
for i in $fdirs
|
for i in $fdirs
|
||||||
do
|
do
|
||||||
@ -482,8 +482,8 @@ dep_pkg_name()
|
|||||||
do
|
do
|
||||||
for i in $files
|
for i in $files
|
||||||
do
|
do
|
||||||
[ -L "$i" -a $deps_resolve_symlinks -eq 1 ] && i=$(${READLINK} -f "$i")
|
[ -L "$i" -a $deps_resolve_symlinks -eq 1 ] && i=$(${__readlink} -f "$i")
|
||||||
pkg=$(pkgchk -l -p $i | $AWK '/^\t/ { print $1 }')
|
pkg=$(pkgchk -l -p $i | ${__awk} '/^\t/ { print $1 }')
|
||||||
if [ -n "$pkg" -a $(echo $pkg | wc -l) -eq 1 ]; then
|
if [ -n "$pkg" -a $(echo $pkg | wc -l) -eq 1 ]; then
|
||||||
#echo "Found $i in $pkg" >> /tmp/depdebug
|
#echo "Found $i in $pkg" >> /tmp/depdebug
|
||||||
echo "$pkg"
|
echo "$pkg"
|
||||||
@ -505,42 +505,42 @@ extract_deps()
|
|||||||
cd ${stagedir}${topinstalldir}
|
cd ${stagedir}${topinstalldir}
|
||||||
|
|
||||||
# Grab the filelist and classify files
|
# Grab the filelist and classify files
|
||||||
local filelist=$($AWK '{ print $3 }' $metadir/prototype.$secname | $GREP '.')
|
local filelist=$(${__awk} '{ print $3 }' $metadir/prototype.$secname | ${__grep} '.')
|
||||||
local exelist=$(echo $filelist | $XARGS $FILE | $EGREP -v ":.* (commands|script)" | $GREP -v "ar archive" | $GREP ":.*executable" | $CUT -d: -f1)
|
local exelist=$(echo $filelist | ${__xargs} ${__file} | ${__egrep} -v ":.* (commands|script)" | ${__grep} -v "ar archive" | ${__grep} ":.*executable" | ${__cut} -d: -f1)
|
||||||
local scriptlist=$(echo $filelist | $XARGS $FILE | $EGREP ":.* (commands|script)" | $CUT -d: -f1)
|
local scriptlist=$(echo $filelist | ${__xargs} ${__file} | ${__egrep} ":.* (commands|script)" | ${__cut} -d: -f1)
|
||||||
local liblist=$(echo $filelist | $XARGS $FILE | $GREP -v "ar archive" | $GREP ":.*dynamic lib" | $CUT -d: -f1)
|
local liblist=$(echo $filelist | ${__xargs} ${__file} | ${__grep} -v "ar archive" | ${__grep} ":.*dynamic lib" | ${__cut} -d: -f1)
|
||||||
|
|
||||||
# Compute dependencies for executables
|
# Compute dependencies for executables
|
||||||
if [ -n "$exelist" ]; then
|
if [ -n "$exelist" ]; then
|
||||||
for f in $exelist; do
|
for f in $exelist; do
|
||||||
[ -r $f -a -x $f ] || continue
|
[ -r $f -a -x $f ] || continue
|
||||||
# Generic Solaris ldd
|
# Generic Solaris ldd
|
||||||
$LDD $f | $GREP -v 'not found' | $AWK '/\=/ { print $3 }'
|
${__ldd} $f | ${__grep} -v 'not found' | ${__awk} '/\=/ { print $3 }'
|
||||||
done | $SORT -u | dep_pkg_name | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
# Compute dependencies for dynamic libraries
|
# Compute dependencies for dynamic libraries
|
||||||
if [ -n "$liblist" ]; then
|
if [ -n "$liblist" ]; then
|
||||||
for f in $liblist; do
|
for f in $liblist; do
|
||||||
[ -r $f ] || continue
|
[ -r $f ] || continue
|
||||||
# Generic Solaris ldd
|
# Generic Solaris ldd
|
||||||
$LDD $f | $GREP -v 'not found' | $AWK '/\=/ { print $3 }'
|
${__ldd} $f | ${__grep} -v 'not found' | ${__awk} '/\=/ { print $3 }'
|
||||||
done | $SORT -u | dep_pkg_name | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
# Compute dependencies for scripts
|
# Compute dependencies for scripts
|
||||||
if [ -n "$scriptlist" ]; then
|
if [ -n "$scriptlist" ]; then
|
||||||
for f in $scriptlist; do
|
for f in $scriptlist; do
|
||||||
[ -r $f -a -x $f ] || continue
|
[ -r $f -a -x $f ] || continue
|
||||||
interp="$($HEAD -n 1 $f | $CUT -d\! -f2- | $SED -e 's/ -.*//')"
|
interp="$(${__head} -n 1 $f | ${__cut} -d\! -f2- | ${__sed} -e 's/ -.*//')"
|
||||||
if [ -L "$interp" ]; then
|
if [ -L "$interp" ]; then
|
||||||
echo $($FILE -h "$interp" | $SED -e 's/.* to //')
|
echo $(${__file} -h "$interp" | ${__sed} -e 's/.* to //')
|
||||||
else
|
else
|
||||||
if [ "$(echo $interp | $CUT -d' ' -f1)" = "/usr/bin/env" ]; then
|
if [ "$(echo $interp | ${__cut} -d' ' -f1)" = "/usr/bin/env" ]; then
|
||||||
echo "/usr/bin/env"
|
echo "/usr/bin/env"
|
||||||
else
|
else
|
||||||
echo $interp
|
echo $interp
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done | $SORT -u | dep_pkg_name | $SORT -u
|
done | ${__sort} -u | dep_pkg_name | ${__sort} -u
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,13 +558,13 @@ auto_deps()
|
|||||||
local pkgname=$(get_pkgname $secname)
|
local pkgname=$(get_pkgname $secname)
|
||||||
local temp
|
local temp
|
||||||
|
|
||||||
deps="$(extract_deps $secname | $SORT -u)"
|
deps="$(extract_deps $secname | ${__sort} -u)"
|
||||||
# We need to sort out any packages created from the same build
|
# We need to sort out any packages created from the same build
|
||||||
# Internal deps *must* be recorded in a depend file instead
|
# Internal deps *must* be recorded in a depend file instead
|
||||||
for j in $(list_pkgs)
|
for j in $(list_pkgs)
|
||||||
do
|
do
|
||||||
temp=$(get_pkgname $j)
|
temp=$(get_pkgname $j)
|
||||||
deps=$(echo $deps | $SED -e "/$temp/d")
|
deps=$(echo $deps | ${__sed} -e "/$temp/d")
|
||||||
done
|
done
|
||||||
# Parse any speciel depends
|
# Parse any speciel depends
|
||||||
# We don't do ignore_deps processing for these deps
|
# We don't do ignore_deps processing for these deps
|
||||||
@ -572,7 +572,7 @@ auto_deps()
|
|||||||
local extra_pkgname # Package that should have the depend
|
local extra_pkgname # Package that should have the depend
|
||||||
local extra_dep_pkgname # The name of depend (either a pkgname or a secname)
|
local extra_dep_pkgname # The name of depend (either a pkgname or a secname)
|
||||||
local extra_dep_version # version of the depend (or auto keyword)
|
local extra_dep_version # version of the depend (or auto keyword)
|
||||||
$SED -n "/^$pkgname /p" $metadir/depend |
|
${__sed} -n "/^$pkgname /p" $metadir/depend |
|
||||||
while read extra_pkgname extra_dep_pkgname extra_dep_version
|
while read extra_pkgname extra_dep_pkgname extra_dep_version
|
||||||
do
|
do
|
||||||
local internal_dep=0
|
local internal_dep=0
|
||||||
@ -597,7 +597,7 @@ auto_deps()
|
|||||||
fi
|
fi
|
||||||
# Only for deps with $pkgprefix?
|
# Only for deps with $pkgprefix?
|
||||||
if [ $version_all_deps -eq 0 ]; then
|
if [ $version_all_deps -eq 0 ]; then
|
||||||
[ -n "$(echo $extra_dep_pkgname | $GREP $pkgprefix)" ] && echo -e "\t($arch) $extra_dep_version"
|
[ -n "$(echo $extra_dep_pkgname | ${__grep} $pkgprefix)" ] && echo -e "\t($arch) $extra_dep_version"
|
||||||
else
|
else
|
||||||
echo -e "\t($arch) $extra_dep_version"
|
echo -e "\t($arch) $extra_dep_version"
|
||||||
fi
|
fi
|
||||||
@ -621,7 +621,7 @@ auto_deps()
|
|||||||
# create versioned_deps
|
# create versioned_deps
|
||||||
# Only for deps with $pkgprefix?
|
# Only for deps with $pkgprefix?
|
||||||
if [ $version_all_deps -eq 0 ]; then
|
if [ $version_all_deps -eq 0 ]; then
|
||||||
[ -n "$(echo $j | $GREP $pkgprefix)" ] && echo -e "\t($arch) $(pkgparam $j VERSION)"
|
[ -n "$(echo $j | ${__grep} $pkgprefix)" ] && echo -e "\t($arch) $(pkgparam $j VERSION)"
|
||||||
else
|
else
|
||||||
echo -e "\t($arch) $(pkgparam $j VERSION)"
|
echo -e "\t($arch) $(pkgparam $j VERSION)"
|
||||||
fi
|
fi
|
||||||
@ -669,7 +669,7 @@ parse_def()
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
equalindex=$($EXPR index "$line" =)
|
equalindex=$(${__expr} index "$line" =)
|
||||||
if [ ! $equalindex -eq 0 ]; then
|
if [ ! $equalindex -eq 0 ]; then
|
||||||
case "${line:0:(($equalindex-1))}" in
|
case "${line:0:(($equalindex-1))}" in
|
||||||
'pkgname')
|
'pkgname')
|
||||||
@ -697,9 +697,9 @@ parse_def()
|
|||||||
else # Perhaps we hit 'files'?
|
else # Perhaps we hit 'files'?
|
||||||
if [ "${line:0:5}" == "files" ]; then
|
if [ "${line:0:5}" == "files" ]; then
|
||||||
triplet="${line:6:((${#line}-5-2))}"
|
triplet="${line:6:((${#line}-5-2))}"
|
||||||
defaultperms=$(echo $triplet | $AWK -F, '{ print $1 }')
|
defaultperms=$(echo $triplet | ${__awk} -F, '{ print $1 }')
|
||||||
defaultuid=$(echo $triplet | $AWK -F, '{ print $2 }')
|
defaultuid=$(echo $triplet | ${__awk} -F, '{ print $2 }')
|
||||||
defaultgid=$(echo $triplet | $AWK -F, '{ print $3 }')
|
defaultgid=$(echo $triplet | ${__awk} -F, '{ print $3 }')
|
||||||
foundfiles=1
|
foundfiles=1
|
||||||
if [ $hasaddedpkginfo -eq 0 ]; then
|
if [ $hasaddedpkginfo -eq 0 ]; then
|
||||||
# start a new package
|
# start a new package
|
||||||
@ -743,24 +743,24 @@ check_unpackaged()
|
|||||||
local i
|
local i
|
||||||
local indent4=" "
|
local indent4=" "
|
||||||
|
|
||||||
$FIND . -type f -print|$SED -e 's/\.\///g' > $tmpdir/files.tmp
|
${__find} . -type f -print|${__sed} -e 's/\.\///g' > $tmpdir/files.tmp
|
||||||
$FIND . -type l -print|$SED -e 's/\.\///g' >> $tmpdir/files.tmp
|
${__find} . -type l -print|${__sed} -e 's/\.\///g' >> $tmpdir/files.tmp
|
||||||
$FIND . -type d -print|$SED -e 's/\.\///g'|$GREP -v '^\.' >> $tmpdir/files.tmp
|
${__find} . -type d -print|${__sed} -e 's/\.\///g'|${__grep} -v '^\.' >> $tmpdir/files.tmp
|
||||||
$SORT $metadir/files.tmp|$UNIQ > $tmpdir/f1
|
${__sort} $metadir/files.tmp|${__uniq} > $tmpdir/f1
|
||||||
$SORT $tmpdir/files.tmp > $tmpdir/f2
|
${__sort} $tmpdir/files.tmp > $tmpdir/f2
|
||||||
upf="$($CAT $tmpdir/f1 $tmpdir/f2 | $SORT | $SED -e '/^relnotes/d' | $UNIQ -u)"
|
upf="$(${__cat} $tmpdir/f1 $tmpdir/f2 | ${__sort} | ${__sed} -e '/^relnotes/d' | ${__uniq} -u)"
|
||||||
if [ ! -z "$upf" ]; then
|
if [ ! -z "$upf" ]; then
|
||||||
echo "There are unpackaged files in the stagedir:"
|
echo "There are unpackaged files in the stagedir:"
|
||||||
for i in $upf
|
for i in $upf
|
||||||
do
|
do
|
||||||
echo "${indent4}${i}"
|
echo "${indent4}${i}"
|
||||||
done
|
done
|
||||||
$RM -f $tmpdir/f1 $tmpdir/f2
|
${__rm} -f $tmpdir/f1 $tmpdir/f2
|
||||||
if [ "$ignore_unpackaged_files" -eq 0 ]; then
|
if [ "$ignore_unpackaged_files" -eq 0 ]; then
|
||||||
error $E_UNPACKAGED_FILES check_unpackaged
|
error $E_UNPACKAGED_FILES check_unpackaged
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
$RM -f $tmpdir/f1 $tmpdir/f2
|
${__rm} -f $tmpdir/f1 $tmpdir/f2
|
||||||
}
|
}
|
||||||
|
|
||||||
# get_pkgname(): Extract pkgname (PKG) from a pkginfo file
|
# get_pkgname(): Extract pkgname (PKG) from a pkginfo file
|
||||||
@ -770,7 +770,7 @@ get_pkgname()
|
|||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
if [ -r $metadir/pkginfo.$secname ]; then
|
if [ -r $metadir/pkginfo.$secname ]; then
|
||||||
local pn=$($GREP PKG $metadir/pkginfo.$secname)
|
local pn=$(${__grep} PKG $metadir/pkginfo.$secname)
|
||||||
local pname=$(_upls ${pn##PKG=})
|
local pname=$(_upls ${pn##PKG=})
|
||||||
echo $pname
|
echo $pname
|
||||||
fi
|
fi
|
||||||
@ -782,7 +782,7 @@ get_pkgrev()
|
|||||||
{
|
{
|
||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
local verfield="$($GREP VERSION $metadir/pkginfo.$secname|$SED -e 's/"//g')"
|
local verfield="$(${__grep} VERSION $metadir/pkginfo.$secname|${__sed} -e 's/"//g')"
|
||||||
local secver=$(_upls ${verfield#*REV=})
|
local secver=$(_upls ${verfield#*REV=})
|
||||||
echo $secver
|
echo $secver
|
||||||
}
|
}
|
||||||
@ -793,7 +793,7 @@ get_pkgversion()
|
|||||||
{
|
{
|
||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
local verfield="$($GREP VERSION $metadir/pkginfo.$secname|$SED -e 's/"//g')"
|
local verfield="$(${__grep} VERSION $metadir/pkginfo.$secname|${__sed} -e 's/"//g')"
|
||||||
local secver=$(_upls ${verfield##VERSION=})
|
local secver=$(_upls ${verfield##VERSION=})
|
||||||
echo $secver
|
echo $secver
|
||||||
}
|
}
|
||||||
@ -805,7 +805,7 @@ get_pkgdesc()
|
|||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
if [ -r $metadir/pkginfo.$secname ]; then
|
if [ -r $metadir/pkginfo.$secname ]; then
|
||||||
local pd=$($GREP NAME $metadir/pkginfo.$secname)
|
local pd=$(${__grep} NAME $metadir/pkginfo.$secname)
|
||||||
local pdesc=$(_upls ${pd##NAME=})
|
local pdesc=$(_upls ${pd##NAME=})
|
||||||
echo $pdesc
|
echo $pdesc
|
||||||
fi
|
fi
|
||||||
@ -818,7 +818,7 @@ get_pkgvendor()
|
|||||||
local secname=$1
|
local secname=$1
|
||||||
|
|
||||||
if [ -r $metadir/pkginfo.$secname ]; then
|
if [ -r $metadir/pkginfo.$secname ]; then
|
||||||
local pv=$($SED -n 's/VENDOR=\(.*\) - .*/\1/p' $metadir/pkginfo.$secname | $TR -d '"')
|
local pv=$(${__sed} -n 's/VENDOR=\(.*\) - .*/\1/p' $metadir/pkginfo.$secname | ${__tr} -d '"')
|
||||||
echo $(_upls $pv)
|
echo $(_upls $pv)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -854,13 +854,13 @@ docs_for()
|
|||||||
if [ ! -z $# ]; then
|
if [ ! -z $# ]; then
|
||||||
setdir source
|
setdir source
|
||||||
ddir=${stagedir}${prefix}/${_docdir}/${secname}-${version}
|
ddir=${stagedir}${prefix}/${_docdir}/${secname}-${version}
|
||||||
${MKDIR} -p $ddir
|
${__mkdir} -p $ddir
|
||||||
echo "Adding docs"
|
echo "Adding docs"
|
||||||
until [ -z "$1" ]
|
until [ -z "$1" ]
|
||||||
do
|
do
|
||||||
for f in $(_upls $1)
|
for f in $(_upls $1)
|
||||||
do
|
do
|
||||||
($TAR -cf - "$f")|(cd $ddir; $TAR -xvBpf -)
|
(${__tar} -cf - "$f")|(cd $ddir; ${__tar} -xvBpf -)
|
||||||
done
|
done
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@ -872,10 +872,10 @@ docs_for()
|
|||||||
do_strip_bin()
|
do_strip_bin()
|
||||||
{
|
{
|
||||||
echo "Stripping ELF binaries..."
|
echo "Stripping ELF binaries..."
|
||||||
for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \
|
for f in `${__find} . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec ${__file} {} \; | \
|
||||||
$GREP -v ' dynamic lib ' | \
|
${__grep} -v ' dynamic lib ' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
$STRIP $strip_elf_args $f || :
|
${__strip} $strip_elf_args $f || :
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -887,10 +887,10 @@ do_strip_shared()
|
|||||||
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
||||||
# Please note we don't restrict our search to executable files because
|
# Please note we don't restrict our search to executable files because
|
||||||
# our libraries are not (should not be, at least) +x.
|
# our libraries are not (should not be, at least) +x.
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
for f in `${__find} . -type f -a -exec ${__file} {} \; | \
|
||||||
grep ' dynamic lib ' | \
|
grep ' dynamic lib ' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
$STRIP $strip_shared_args $f
|
${__strip} $strip_shared_args $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -900,10 +900,10 @@ do_strip_static()
|
|||||||
{
|
{
|
||||||
echo "Stripping static archives..."
|
echo "Stripping static archives..."
|
||||||
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
for f in `${__find} . -type f -a -exec ${__file} {} \; | \
|
||||||
$GREP 'current ar archive' | \
|
${__grep} 'current ar archive' | \
|
||||||
$SED -n -e 's/^\(.*\):[ ]*current ar archive,.*/\1/p'`; do
|
${__sed} -n -e 's/^\(.*\):[ ]*current ar archive,.*/\1/p'`; do
|
||||||
$STRIP $strip_static_args $f
|
${__strip} $strip_static_args $f
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ __strip=/usr/bin/strip
|
|||||||
__uname=/usr/bin/uname
|
__uname=/usr/bin/uname
|
||||||
__tar=/usr/tgcware/bin/tar # GNU tar v1.14 or better please!
|
__tar=/usr/tgcware/bin/tar # GNU tar v1.14 or better please!
|
||||||
__vtar=/usr/bin/tar # vendor supplied tar
|
__vtar=/usr/bin/tar # vendor supplied tar
|
||||||
__bzip2=/usr/bin/bzip2
|
__bzip2=/usr/tgcware/bin/bzip2
|
||||||
__gzip=/usr/bin/gzip
|
__gzip=/usr/tgcware/bin/gzip
|
||||||
__patch=/usr/tgcware/bin/patch # GNU patch 2.5 or better please!
|
__patch=/usr/tgcware/bin/patch # GNU patch 2.5 or better please!
|
||||||
__rm=/usr/bin/rm
|
__rm=/usr/bin/rm
|
||||||
__rmdir=/usr/bin/rmdir
|
__rmdir=/usr/bin/rmdir
|
||||||
@ -29,6 +29,7 @@ __cp=/usr/bin/cp
|
|||||||
__tee=/bin/tee
|
__tee=/bin/tee
|
||||||
__grep=/bin/grep
|
__grep=/bin/grep
|
||||||
__egrep=/bin/egrep
|
__egrep=/bin/egrep
|
||||||
|
__ggrep=/usr/tgcware/bin/grep # GNU grep
|
||||||
__uniq=/bin/uniq
|
__uniq=/bin/uniq
|
||||||
__basename=/bin/basename
|
__basename=/bin/basename
|
||||||
__dirname=/bin/dirname
|
__dirname=/bin/dirname
|
||||||
@ -42,6 +43,9 @@ __pack=/usr/bin/pack
|
|||||||
__sha1sum=/usr/tgcware/bin/sha1sum
|
__sha1sum=/usr/tgcware/bin/sha1sum
|
||||||
__unzip=/usr/tgcware/bin/unzip
|
__unzip=/usr/tgcware/bin/unzip
|
||||||
__head=/usr/bin/head # Must support -n
|
__head=/usr/bin/head # Must support -n
|
||||||
|
__perl=/usr/tgcware/bin/perl
|
||||||
|
__readlink=/usr/tgcware/bin/readlink
|
||||||
|
__ldd=/usr/bin/ldd
|
||||||
|
|
||||||
# Groff stuff for manpages
|
# Groff stuff for manpages
|
||||||
__nroff=/usr/tgcware/bin/nroff
|
__nroff=/usr/tgcware/bin/nroff
|
||||||
|
20
newpkg
20
newpkg
@ -16,23 +16,23 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating sandbox for $arg1"
|
echo "Creating sandbox for $arg1"
|
||||||
$MKDIR "$arg1"
|
${__mkdir} "$arg1"
|
||||||
for i in $REQ_DIRS
|
for i in $REQ_DIRS
|
||||||
do
|
do
|
||||||
$MKDIR $arg1/$i
|
${__mkdir} $arg1/$i
|
||||||
done
|
done
|
||||||
|
|
||||||
$CP scripts/build.sh.generic $arg1/build.sh
|
${__cp} scripts/build.sh.generic $arg1/build.sh
|
||||||
if [ "$($UNAME -s)" == "IRIX" -o "$($UNAME -s)" == "IRIX64" ]; then
|
if [ "$(${__uname} -s)" == "IRIX" -o "$(${__uname} -s)" == "IRIX64" ]; then
|
||||||
$SED -e 's;bin/bash;usr/tgcware/bin/bash;g' $arg1/build.sh > $arg1/build.sh.tmp
|
${__sed} -e 's;bin/bash;usr/tgcware/bin/bash;g' $arg1/build.sh > $arg1/build.sh.tmp
|
||||||
$MV $arg1/build.sh.tmp $arg1/build.sh
|
${__mv} $arg1/build.sh.tmp $arg1/build.sh
|
||||||
$CP scripts/pkgdef.template.irix $arg1/meta/pkgdef
|
${__cp} scripts/pkgdef.template.irix $arg1/meta/pkgdef
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$($UNAME -s)" == "SunOS" ]; then
|
if [ "$(${__uname} -s)" == "SunOS" ]; then
|
||||||
$CP scripts/pkgdef.template $arg1/meta/pkgdef
|
${__cp} scripts/pkgdef.template $arg1/meta/pkgdef
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$CP scripts/relnotes.template.irix $arg1/meta/relnotes
|
${__cp} scripts/relnotes.template.irix $arg1/meta/relnotes
|
||||||
# Make build script executable
|
# Make build script executable
|
||||||
chmod 755 $arg1/build.sh
|
chmod 755 $arg1/build.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user