If set to 'no', pkgmk will strip built binaries.
.br
Default: 'no'
+.TP
+\fBPKGMK_COMPRESSION_MODE='STRING'\fP
+Option to select the mode used to compress the packages. Valid strings are gz, bz2 and xz.
+.br
+Default: 'gz'
.SH SEE ALSO
pkgmk(8)
.SH COPYRIGHT
build_package() {
local BUILD_SUCCESSFUL="no"
+ local COMPRESSION
check_file "$TARGET"
make_work_dir
cd $PKG
info "Build result:"
- tar czvvf $TARGET *
-
+
+ case $PKGMK_COMPRESSION_MODE in
+ gz) COMPRESSION="-z" ;;
+ bz2) COMPRESSION="-j" ;;
+ xz) COMPRESSION="-J" ;;
+ esac
+ bsdtar -c $COMPRESSION -f $TARGET * && bsdtar -t -v -f $TARGET
+
if [ $? = 0 ]; then
BUILD_SUCCESSFUL="yes"
check_directory "`dirname $PKGMK_WORK_DIR`"
check_pkgfile
-
- TARGET="$PKGMK_PACKAGE_DIR/$name#$version-$release.pkg.tar.gz"
-
+
+ case $PKGMK_COMPRESSION_MODE in
+ gz|bz2|xz)
+ TARGET="$PKGMK_PACKAGE_DIR/$name#$version-$release.pkg.tar.$PKGMK_COMPRESSION_MODE"
+ ;;
+ *)
+ error "Compression mode '$PKGMK_COMPRESSION_MODE' not supported"
+ exit 1
+ ;;
+ esac
+
if [ "$PKGMK_CLEAN" = "yes" ]; then
clean
exit 0
PKGMK_PACKAGE_DIR="$PWD"
PKGMK_WORK_DIR="$PWD/work"
+PKGMK_COMPRESSION_MODE="gz"
+
PKGMK_INSTALL="no"
PKGMK_RECURSIVE="no"
PKGMK_DOWNLOAD="no"