diff --git a/buildpkg.functions b/buildpkg.functions index a00e4ad..ff52074 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -115,6 +115,7 @@ pkgdirdesig=${topinstalldir##/*/} # topinstalldir suffix # Functionality controls catman=0 # Don't fix manpages pr. default +gzman=0 # Don't compress man pages pr. default dostrip=1 dostrip_elf=1 # default to stripping binaries during the install stage dostrip_shared=1 # default to stripping shared objects during the install stage @@ -369,12 +370,11 @@ fix_man() do if [ -L "$manpage" ]; then TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }') - $LN -sf "$TARGET".gz "$manpage".gz - $MV "$manpage".gz "../$catdir" + $LN -sf "$TARGET" "$manpage" + $MV "$manpage" "../$catdir" $RM -f "$manpage" else $NEQN $NEQNOPTS "$manpage" | $TBL | $NROFF $NROFFOPTS > "../$catdir/$manpage" - $GZIP "../$catdir/$manpage" $RM -f $manpage fi done @@ -384,6 +384,34 @@ fix_man() done } +# compress_man(): Compress raw manpages +# params: none +# Run from 'cwd' where 'cwd' contains manX subdirs +compress_man() +{ + echo "Compressing manpages" + for i in [cm]a[nt]? + do + if [ -d $i ]; then + cd $i + for manpage in * + do + suffix="${manpage##*.}" + if [ "$suffix" != "gz" -a "$suffix" != "Z" ]; then #probably uncompressed... + if [ -L "$manpage" ]; then + TARGET=$($LS -l "$manpage" | $AWK '{ print $NF }') + $LN -sf "$TARGET".gz "$manpage".gz + $RM -f "$manpage" + else + $GZIP "$manpage" + fi + fi + done + cd .. + fi + done +} + # doc(): Add files from srcdir to 'docs' location # params: $1..$x # Copies files from $srcdir to $_docdir/$topdir-$version diff --git a/buildpkg.packaging.solaris b/buildpkg.packaging.solaris index 457ae81..af290d5 100644 --- a/buildpkg.packaging.solaris +++ b/buildpkg.packaging.solaris @@ -41,6 +41,9 @@ usedepend=1 # default to looking for a depend file in $metadir usescripts=1 # default to add pre/post scripts if available ignore_unpackaged_files=0 # default to check for unpackaged files in the stage area +# Compress raw manpages... +gzman=1 + # Host specific configuration [ -r $buildpkgbase/scripts/config.`hostname`.solaris ] && . $buildpkgbase/scripts/config.`hostname`.solaris @@ -399,20 +402,20 @@ get_pkgname() echo $pname } -# get_pkgrev(): Extract pkgrev (PSTAMP) from pkginfo file +# get_pkgrev(): Extract pkgrev (REV part of VERSION field) from pkginfo file # params: $1 = metafile suffix get_pkgrev() { local secname=$1 - local pstamp=$($GREP PSTAMP $metadir/pkginfo.$secname) - local secver=$(_upls ${pstamp##PSTAMP=}) + local verfield="$($GREP VERSION $metadir/pkginfo.$secname|$SED -e 's/"//g')" + local secver=$(_upls ${verfield#*REV=}) echo $secver } # do_strip_bin(): Strip binaries # params: none -do_strip_binaries() +do_strip_bin() { echo "Stripping ELF binaries..." for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \ @@ -465,9 +468,19 @@ generic_pack() fi clean meta if [ "$shortroot" -eq 1 ]; then + if [ -d "${stagedir}/${_mandir}" ]; then + setdir ${stagedir}/${_mandir} + [ "$catman" -eq 1 ] && fix_man + [ "$gzman" -eq 1 ] && compress_man + fi setdir "$stagedir" else - setdir "$stagedir$prefix" + 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 + setdir "${stagedir}${prefix}" fi parse_def check_unpackaged diff --git a/pkginfo.in b/pkginfo.in index 4bcf29a..6e5fbe5 100644 --- a/pkginfo.in +++ b/pkginfo.in @@ -1,11 +1,10 @@ PKG="%%pkgname%%" NAME="%%name%%" ARCH="sparc" -VERSION="%%version%%" +VERSION="%%version%%,REV=%%pkgver%%" CATEGORY="%%pkgcat%%" -VENDOR="%%pkgvendor%%" -EMAIL="Tom G. Christensen - tgc@statsbiblioteket.dk" -PSTAMP="%%pkgver%%" +VENDOR="%%pkgvendor%% - packaged by Tom G. Christensen" +EMAIL="swpkg@statsbiblioteket.dk" BASEDIR="%%topinstalldir%%" CLASSES="none" DESC="%%pkgdesc%%"