From 65c833caccd20efe3aa386e168998ca50cb610ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Mar 2014 15:19:23 +0200 Subject: Add dist scripts --- dist-build.sh | 20 +++++++++++++ dist.sh | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100755 dist-build.sh create mode 100755 dist.sh diff --git a/dist-build.sh b/dist-build.sh new file mode 100755 index 0000000..808d899 --- /dev/null +++ b/dist-build.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +# Create libcutl-x.y.z directory with the 'build' build system. +# + +trap 'exit 1' ERR + +v=`cat libcutl/version` + +echo "packaging libcutl-$v" +echo "EVERYTHING MUST BE COMMITTED!" + +# prepare libcutl-x.y.z +# +rm -rf libcutl-$v +mkdir libcutl-$v +cd libcutl +git archive master | tar -x -C ../libcutl-$v +cd .. +rm -f libcutl-$v/.gitignore diff --git a/dist.sh b/dist.sh new file mode 100755 index 0000000..130a2cd --- /dev/null +++ b/dist.sh @@ -0,0 +1,90 @@ +#! /usr/bin/env bash + +# Create libcutl source distributions with the autotools build system. +# +# -cc +# -cxx +# -cxxflags +# -out , default is libcutl-X.Y.Z in current dir. +# -no-check - do not check the distribution +# -j +# + +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +wd=`pwd` +v=`cat libcutl/version` +cc=gcc +cxx=g++ +cxxflags="-W -Wall -O3" +jobs=22 +out= +dist_target=distcheck + +while [ $# -gt 0 ]; do + case $1 in + -cc) + shift + cc=$1 + shift + ;; + -cxx) + shift + cxx=$1 + shift + ;; + -cxxflags) + shift + cxxflags=$1 + shift + ;; + -out) + shift + out=$1 + shift + ;; + -no-check) + dist_target=dist + shift + ;; + -j) + shift + jobs=$1 + shift + ;; + *) + error "unknown option: $1" + exit 1 + ;; + esac +done + +if [ "$out" = "" ]; then + out=$wd/libcutl-$v +fi + +echo "packaging libcutl-$v" + +rm -rf $out + +make -C libcutl dist dist_prefix=$out +cd $out +./bootstrap +./configure CC="$cc" CXX="$cxx" CXXFLAGS="$cxxflags" +make -j $jobs +make $dist_target +cp libcutl-$v.zip ../ +cp libcutl-$v.tar.gz ../ +cp libcutl-$v.tar.bz2 ../ +cd .. + +sha1sum libcutl-$v.zip >libcutl-$v.zip.sha1 +sha1sum libcutl-$v.tar.gz >libcutl-$v.tar.gz.sha1 +sha1sum libcutl-$v.tar.bz2 >libcutl-$v.tar.bz2.sha1 + +cd $wd -- cgit v1.1