1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

maketgz: add .xz, .bz2, .zip source archive formats (#874)

Copied from curl:
4528690cd5/maketgz (L174-L222)

[ci skip]
This commit is contained in:
Viktor Szakats
2023-03-24 00:34:40 +01:00
committed by GitHub
parent dbe5e680b7
commit c7d4844386
2 changed files with 52 additions and 0 deletions

3
.gitignore vendored
View File

@@ -25,7 +25,10 @@ libtool
ltmain.sh ltmain.sh
missing missing
ssh2_sample ssh2_sample
libssh2-*.tar.bz2
libssh2-*.tar.gz libssh2-*.tar.gz
libssh2-*.tar.xz
libssh2-*.zip
install-sh install-sh
*.o *.o
*.lo *.lo

49
maketgz
View File

@@ -99,3 +99,52 @@ git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./git2ne
echo "make dist" echo "make dist"
targz="libssh2-$version.tar.gz" targz="libssh2-$version.tar.gz"
make -s dist VERSION=$version make -s dist VERSION=$version
res=$?
if test "$res" != 0; then
echo "make dist failed"
exit 2
fi
############################################################################
#
# Now make a bz2 archive from the tar.gz original
#
bzip2="libssh2-$version.tar.bz2"
echo "Generating $bzip2"
gzip -dc $targz | bzip2 --best > $bzip2
############################################################################
#
# Now make an xz archive from the tar.gz original
#
xz="libssh2-$version.tar.xz"
echo "Generating $xz"
gzip -dc $targz | xz -6e - > $xz
############################################################################
#
# Now make a zip archive from the tar.gz original
#
makezip() {
rm -rf $tempdir
mkdir $tempdir
cd $tempdir
gzip -dc ../$targz | tar -xf -
find . | zip $zip -@ >/dev/null
mv $zip ../
cd ..
rm -rf $tempdir
}
zip="libssh2-$version.zip"
echo "Generating $zip"
tempdir=".builddir"
makezip
echo "------------------"
echo "maketgz report:"
echo ""
ls -l $targz $bzip2 $zip $xz