From e2361d6e56fb78467d17f7ceaab4df220cae8624 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Tue, 23 Sep 2014 21:10:22 +0200 Subject: [PATCH] Improve tarball script. --- mktarball.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mktarball.sh b/mktarball.sh index 13b3700c..47e1227a 100755 --- a/mktarball.sh +++ b/mktarball.sh @@ -1,19 +1,22 @@ #! /bin/bash -#script to create a source tarball for YACReader distribution and packaging +#Script to create a source tarball for YACReader distribution and packaging +#This should be run from YACReaders top source directory + YACVERSION=7.2.0 if [ -f Makefile ] then make distclean fi -if [ ! -f "yacreader_${YACVERSION}-src.tar.xz" ] +if [ ! -f "yacreader-${YACVERSION}-src.tar.xz" ] then echo "Building source tarball" else echo "Updating source tarball" - rm yacreader_${YACVERSION}-src.tar* #delete old tarball, since tar can't update compressed archives + rm yacreader-${YACVERSION}-src.tar* #delete old tarball, since tar can't update compressed archives fi -#use --exclude to make sure we get a pristine tar -#might not work out of the box with bsdtar! -tar cfJ yacreader_${YACVERSION}-src.tar.xz --exclude '*.rej' --exclude '*.orig' --exclude '*.gch' --exclude 'dependencies' \ ---exclude 'yacreader*tar*' --exclude '.hg*' --exclude 'libp7zip' --exclude 'lib7zip' ./* --transform s/./yacreader_${YACVERSION}/ -md5sum yacreader_${YACVERSION}-src.tar.xz > yacreader_${YACVERSION}-src.tar.xz.md5sum \ No newline at end of file +#Use tar's --exclude feature to make sure we get a pristine tar for distribution. +#Exclude all version control system related files and rename the top directory in the tarball using --transform. +tar cfJ yacreader-${YACVERSION}-src.tar.xz --exclude '*.rej' --exclude '*.orig' --exclude '*.gch' --exclude 'dependencies' --exclude '*.o' \ +--exclude 'yacreader*tar*' --exclude '.hg*' --exclude 'lib7zip' --exclude 'libp7zip' --exclude-vcs ./* --transform s/./yacreader-${YACVERSION}/ +#Calculate checksum to enable packagers to verify whether they are using the original tarball. +md5sum yacreader-${YACVERSION}-src.tar.xz > yacreader-${YACVERSION}-src.tar.xz.md5sum \ No newline at end of file