diff options
| author | ruki <[email protected]> | 2017-03-29 23:13:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-29 23:13:12 +0800 |
| commit | 0999f3f14eda6192cd2bc8f4c4cc875c729ea500 (patch) | |
| tree | ee5e10a40a3401fce930a28d8d7b51d8d6c41a9d /scripts/makepkg | |
| parent | 95c0752c2574edcd465d4f790e22ede96d8feb56 (diff) | |
modify makepkg script
Diffstat (limited to 'scripts/makepkg')
| -rwxr-xr-x | scripts/makepkg | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/makepkg b/scripts/makepkg new file mode 100755 index 000000000..913f49b49 --- /dev/null +++ b/scripts/makepkg @@ -0,0 +1,50 @@ +#!/bin/bash + +# install fpm +# brew install gnu-tar +# gem install --no-ri --no-rdoc fpm + +# check +if [ $# -lt 2 ]; then + echo "Usage: ./scripts/makepkg [rpm|deb|oscpkg|pacman] [version]" + exit +fi + +# target +target=$1 + +# version +version=$2 + +# arch +arch=i386 +if [ `getconf LONG_BIT` == "64" ]; then + arch=x86_64 +fi + +# platform +plat=linux +if [ `uname` == "Darwin" ]; then + plat=macosx +fi + +# build xmake core +cd ./core +make f DEBUG=n +make r +cd - + +# 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" --license=LICENSE.md \ + xmake=/usr/local/share/ \ + core/bin/demo.pkg/bin/$plat/$arch/demo.b=/usr/local/share/xmake/xmake \ + /tmp/xmake.sh=/usr/local/bin/xmake + + |
