summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-05-25 12:58:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-05-25 12:58:16 +0200
commit74c979d9acd0e541c57db22bbea8ef8340b3e284 (patch)
tree1caefd23f1c09c29cc0cfb933210633dcb4d84ac
parentdc0229617ada67fd02815bbc94b245871248b9db (diff)
downloadweechat-74c979d9acd0e541c57db22bbea8ef8340b3e284.zip
core: build packages in build directory on "make dist" (CMake)
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xmakedist.sh20
2 files changed, 14 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c1f18212..524bef834 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -141,7 +141,7 @@ add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
add_custom_target(dist
- "${CMAKE_CURRENT_SOURCE_DIR}/makedist.sh" "${VERSION}" "HEAD"
+ "${CMAKE_CURRENT_SOURCE_DIR}/makedist.sh" "${VERSION}" "HEAD" "${CMAKE_CURRENT_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# pkgconfig file
diff --git a/makedist.sh b/makedist.sh
index 506fe5ff3..cf62d0b00 100755
--- a/makedist.sh
+++ b/makedist.sh
@@ -22,25 +22,31 @@
# Build tarballs (.tar.gz and .tar.bz2) for WeeChat using git-archive.
#
# Syntax:
-# makedist.sh <version> <tree-ish>
+# makedist.sh <version> <tree-ish> [<path>]
#
-# version : WeeChat version, for example 0.3.9 or 0.4.0-dev
-# tree-ish: git tree-ish (optional, defaults to HEAD), example: v0.3.9
+# version : WeeChat version, for example 0.3.9 or 0.4.0-dev
+# tree-ish: git tree-ish (optional, defaults to HEAD), example: v0.3.9
+# path : where to put packages (optional, default is current directory)
#
-if [ $# -eq 0 ]; then
- echo "Syntax: $0 <version> <tree-ish>"
+if [ $# -lt 2 ]; then
+ echo "Syntax: $0 <version> <tree-ish> [<path>]"
exit 1
fi
VERSION=$1
TREEISH=${2:-HEAD}
+OUTPATH="."
+
+if [ $# -ge 3 ]; then
+ OUTPATH=$3
+fi
PREFIX="weechat-${VERSION}/"
FILE="weechat-${VERSION}.tar"
echo "Building file ${FILE}.bz2"
-git archive --prefix=${PREFIX} ${TREEISH} | bzip2 -c >${FILE}.bz2
+git archive --prefix=${PREFIX} ${TREEISH} | bzip2 -c >${OUTPATH}/${FILE}.bz2
echo "Building file ${FILE}.gz"
-git archive --prefix=${PREFIX} ${TREEISH} | gzip -c >${FILE}.gz
+git archive --prefix=${PREFIX} ${TREEISH} | gzip -c >${OUTPATH}/${FILE}.gz