aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2015-02-17 23:13:45 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2015-02-17 23:13:45 +0000
commitbd9cab6fb43aa1cebd5b0c4b05201146dae3c1a9 (patch)
tree181c8e7a389a498a40bfe0992ef7294305bb28e2 /release/Makefile
parent4ac6485cc6f268da149f5d4ea43bd871fdf24fd2 (diff)
downloadsrc-bd9cab6fb43aa1cebd5b0c4b05201146dae3c1a9.tar.gz
src-bd9cab6fb43aa1cebd5b0c4b05201146dae3c1a9.zip
release: use xz via pipe when compressing the tarballs.
libarchive(3) doesn't support the new liblzma API yet, but this change allows us to enable multi-threaded xz compression. ``make release'' should now finish in half the time on a machine with several cores and fast disks (our typical build server). This behaviour only applies when building a release and it doesn't affect buildworld/installworld. To disable threaded xz compression, set XZ_THREADS=1. Reviewed by: gjb Tested by: gjb
Notes
Notes: svn path=/head/; revision=278926
Diffstat (limited to 'release/Makefile')
-rw-r--r--release/Makefile27
1 files changed, 7 insertions, 20 deletions
diff --git a/release/Makefile b/release/Makefile
index 0a3f50972d15..e469307068dd 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -33,18 +33,12 @@
# with xz(1) (extremely time consuming)
# WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
# TARGET/TARGET_ARCH: architecture of built release
-# XZ_FLAGS: Additional arguments to pass to xz(1)
-# XZ_THREADS: Number of xz(1) threads to use
-# NO_XZTHREADS: Disable multi-threaded xz(1) compression
#
WORLDDIR?= ${.CURDIR}/..
PORTSDIR?= /usr/ports
DOCDIR?= /usr/doc
RELNOTES_LANG?= en_US.ISO8859-1
-XZCMD?= /usr/bin/xz
-XZ_FLAGS?=
-XZ_THREADS?=
.if !defined(TARGET) || empty(TARGET)
TARGET= ${MACHINE}
@@ -59,15 +53,6 @@ TARGET_ARCH= ${TARGET}
IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
DISTDIR= dist
-.if !defined(NO_XZTHREADS) && empty(XZ_THREADS)
-XZ_THREADS= 0
-.else
-XZ_THREADS= ${XZ_THREADS}
-.endif
-.if !empty(XZ_THREADS)
-XZ_FLAGS+= -T ${XZ_THREADS}
-.endif
-
# Define OSRELEASE by using newvars.sh
.if !defined(OSRELEASE) || empty(OSRELEASE)
.for _V in TYPE BRANCH REVISION
@@ -158,16 +143,18 @@ kernel.txz:
src.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
- cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \
- --exclude .git --exclude @ --exclude usr/src/release/dist usr/src
+ cd ${DISTDIR} && tar cLvf - --exclude .svn --exclude .zfs \
+ --exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \
+ ${XZ_CMD} > ${.OBJDIR}/src.txz
ports.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
- cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
+ cd ${DISTDIR} && tar cLvf - \
--exclude .git --exclude .svn \
--exclude usr/ports/distfiles --exclude usr/ports/packages \
- --exclude 'usr/ports/INDEX*' --exclude work usr/ports
+ --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \
+ ${XZ_CMD} > ${.OBJDIR}/ports.txz
reldoc:
cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \
@@ -309,7 +296,7 @@ release-install:
.for I in ${IMAGES}
cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
- ${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I}
+ ${XZ_CMD} -k ${DESTDIR}/${OSRELEASE}-${I}
. endif
.endfor
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256