diff --git a/pkgmk.8.in b/pkgmk.8.in index c3b79d965a..48ff5a57f3 100644 --- a/pkgmk.8.in +++ b/pkgmk.8.in @@ -5,7 +5,8 @@ pkgmk \- make software package \fBpkgmk [options]\fP .SH DESCRIPTION \fBpkgmk\fP is a \fIpackage management\fP utility, which makes -a software package. A \fIpackage\fP is an archive of files (.pkg.tar.gz, .pkg.tar.bz2 or .pkg.tar.xz) +a software package. A \fIpackage\fP is an archive of files +(.pkg.tar.gz, .pkg.tar.bz2, .pkg.tar.xz, or .pkg.tar.zst) that can be installed using pkgadd(8). To prepare to use pkgmk, you must write a file named \fIPkgfile\fP diff --git a/pkgmk.conf b/pkgmk.conf index e6a8abc8e5..c28be192d0 100644 --- a/pkgmk.conf +++ b/pkgmk.conf @@ -38,4 +38,10 @@ esac # PKGMK_CURL_OPTS="" # PKGMK_COMPRESSION_MODE="gz" +#if [ "$PKGMK_COMPRESSION_MODE" = xz ]; then +# export TAR_WRITER_OPTIONS=xz:threads=${JOBS} +#elif [ "$PKGMK_COMPRESSION_MODE" = zst ]; then +# export TAR_WRITER_OPTIONS=zstd:threads=${JOBS},zstd:compression-level=22 +#fi + # End of file diff --git a/pkgmk.conf.5.in b/pkgmk.conf.5.in index 3e05436239..5de35667ca 100644 --- a/pkgmk.conf.5.in +++ b/pkgmk.conf.5.in @@ -84,7 +84,8 @@ If set to 'no', pkgmk will strip built binaries. Default: 'no' .TP \fBPKGMK_COMPRESSION_MODE='STRING'\fP -Option to select the mode used to compress the packages. Valid strings are gz, bz2, xz and lz. +Option to select the mode used to compress the packages. +Valid strings are gz, bz2, xz, lz and zst. .br Default: 'gz' .SH SEE ALSO diff --git a/pkgmk.in b/pkgmk.in index edc2ded840..a96732adec 100644 --- a/pkgmk.in +++ b/pkgmk.in @@ -208,7 +208,7 @@ unpack_source() { RENAME="${renames[$srcind]}" [ -n "$RENAME" -a "$RENAME" != "SKIP" ] && LOCAL_FILE="$PKGMK_SOURCE_DIR/$RENAME" case $LOCAL_FILE in - *.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.tar.lz|*.zip|*.rpm|*.7z) + *.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.tar.lz|*.tar.zst|*.tzst|*.zip|*.rpm|*.7z) COMMAND="bsdtar -p -o -C $SRC -xf $LOCAL_FILE" ;; *) COMMAND="cp $LOCAL_FILE $SRC" ;; @@ -591,6 +591,7 @@ build_package() { bz2) COMPRESSION="-j" ;; xz) COMPRESSION="-J" ;; lz) COMPRESSION="--lzip" ;; + zst) COMPRESSION=--zstd;; esac bsdtar --format=gnutar -c $COMPRESSION -f $TARGET * && bsdtar -t -v -f $TARGET @@ -879,7 +880,7 @@ main() { check_pkgfile case $PKGMK_COMPRESSION_MODE in - gz|bz2|xz|lz) + gz|bz2|xz|lz|zst) TARGET="$PKGMK_PACKAGE_DIR/$name#$version-$release.pkg.tar.$PKGMK_COMPRESSION_MODE" ;; *) diff --git a/pkgutil.cc b/pkgutil.cc index bf1a0aa685..1dfe0363cf 100644 --- a/pkgutil.cc +++ b/pkgutil.cc @@ -48,6 +48,7 @@ archive_read_support_filter_bzip2((ar)); \ archive_read_support_filter_xz((ar)); \ archive_read_support_filter_lzip((ar)); \ + archive_read_support_filter_zstd((ar)); \ archive_read_support_format_tar((ar)) #define DEFAULT_BYTES_PER_BLOCK (20 * 512)