diff --git a/Makefile.am b/Makefile.am index de6fb6b..dab1ca6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,10 +16,15 @@ install-exec-hook: config.status: Makefile.iptrules.in +tmpdir := $(shell mktemp -dtu) +packer = xz +packext = .tar.xz + .PHONY: tarball tarball: - rm -Rf /tmp/xtables-addons-${PACKAGE_VERSION}; - pushd ${top_srcdir} && git archive --prefix=xtables-addons-${PACKAGE_VERSION}/ HEAD | tar -C /tmp -x && popd; - pushd /tmp/xtables-addons-${PACKAGE_VERSION} && ./autogen.sh && popd; - tar -C /tmp -cjf xtables-addons-${PACKAGE_VERSION}.tar.bz2 --owner=root --group=root xtables-addons-${PACKAGE_VERSION}/; - rm -Rf /tmp/xtables-addons-${PACKAGE_VERSION}; +# do not use mkdir_p here. + mkdir ${tmpdir} + pushd ${top_srcdir} && git archive --prefix=${PACKAGE_NAME}-${PACKAGE_VERSION}/ HEAD | tar -C ${tmpdir} -x && popd; + pushd ${tmpdir}/${PACKAGE_NAME}-${PACKAGE_VERSION} && ./autogen.sh && popd; + tar --use=${packer} -C ${tmpdir} -cf ${PACKAGE_NAME}-${PACKAGE_VERSION}${packext} --owner=root --group=root ${PACKAGE_NAME}-${PACKAGE_VERSION}/; + rm -Rf ${tmpdir};