summaryrefslogtreecommitdiff
path: root/scripts/makepkg
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg')
-rwxr-xr-xscripts/makepkg26
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/makepkg b/scripts/makepkg
index 6c2bd1348..f9da83b0c 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -19,16 +19,21 @@
#
# check
-if [ $# -lt 2 ]; then
- echo "Usage: ./scripts/makepkg [rpm|deb|osxpkg|pacman] [version]"
+if [ $# -lt 1 ]; then
+ echo "Usage: ./scripts/makepkg [rpm|deb|osxpkg|pacman]"
exit
fi
+xmakeroot=`pwd`
+artifactsdir=$xmakeroot/artifacts
+if [ ! -d $artifactsdir ]; then
+ mkdir $artifactsdir
+fi
# target
target=$1
# version
-version=$2
+version=`cat ./core/xmake.lua | grep -E "^set_version" | grep -oE "[0-9]*\.[0-9]*\.[0-9]*"`
# arch
arch=i386
@@ -45,17 +50,14 @@ fi
# build first
make build
-# make xmake wrapper
-echo "#/!bin/bash
-export XMAKE_PROGRAM_DIR=/usr/local/share/xmake
-/usr/local/share/xmake/xmake \"\$@\"
-" > /tmp/xmake.sh
-chmod 755 /tmp/xmake.sh
-
# make dep package using fpm
fpm -s dir -t $target -n xmake -v $version -m "<[email protected]>" --description "A make-like build utility based on Lua" --url "xmake.io" --license Apache \
xmake=/usr/local/share/ \
- core/src/demo/demo.b=/usr/local/share/xmake/xmake \
- /tmp/xmake.sh=/usr/local/bin/xmake
+ core/src/demo/demo.b=/usr/local/bin/xmake
+if [ "$target" == "osxpkg" ]; then
+ mv xmake-$version.pkg $artifactsdir/xmake.pkg
+elif [ "$target" == "deb" ]; then
+ mv xmake-$version_amd64.deb $artifactsdir/xmake.deb
+fi