From 0999f3f14eda6192cd2bc8f4c4cc875c729ea500 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 29 Mar 2017 23:13:12 +0800 Subject: modify makepkg script --- scripts/make_deb | 35 ----------------------------------- scripts/make_osxpkg | 35 ----------------------------------- scripts/make_rpm | 35 ----------------------------------- scripts/makepkg | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 105 deletions(-) delete mode 100755 scripts/make_deb delete mode 100755 scripts/make_osxpkg delete mode 100755 scripts/make_rpm create mode 100755 scripts/makepkg (limited to 'scripts') diff --git a/scripts/make_deb b/scripts/make_deb deleted file mode 100755 index 95573e0e0..000000000 --- a/scripts/make_deb +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# install fpm -# apt-get install ruby ruby-dev rubygems gcc make -# gem install --no-ri --no-rdoc fpm - -# version -version=2.1.3 - -# arch -arch=i386 -if [ `getconf LONG_BIT` == "64" ]; then - arch=x86_64 -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 deb -n xmake -v $version -m "" --description="A make-like build utility based on Lua" --license=LICENSE.md \ - xmake=/usr/local/share/ \ - core/bin/demo.pkg/bin/linux/$arch/demo.b=/usr/local/share/xmake/xmake \ - /tmp/xmake.sh=/usr/local/bin/xmake - - diff --git a/scripts/make_osxpkg b/scripts/make_osxpkg deleted file mode 100755 index c9d4ae6af..000000000 --- a/scripts/make_osxpkg +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# install fpm -# brew install gnu-tar -# gem install --no-ri --no-rdoc fpm - -# version -version=2.1.3 - -# arch -arch=i386 -if [ `getconf LONG_BIT` == "64" ]; then - arch=x86_64 -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 osxpkg -n xmake -v $version -m "" --description="A make-like build utility based on Lua" --license=LICENSE.md \ - xmake=/usr/local/share/ \ - core/bin/demo.pkg/bin/macosx/$arch/demo.b=/usr/local/share/xmake/xmake \ - /tmp/xmake.sh=/usr/local/bin/xmake - - diff --git a/scripts/make_rpm b/scripts/make_rpm deleted file mode 100755 index be4d153fe..000000000 --- a/scripts/make_rpm +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# install fpm -# yum install ruby-devel gcc make rpm-build -# gem install --no-ri --no-rdoc fpm - -# version -version=2.1.3 - -# arch -arch=i386 -if [ `getconf LONG_BIT` == "64" ]; then - arch=x86_64 -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 rpm -n xmake -v $version -m "" --description="A make-like build utility based on Lua" --license=LICENSE.md \ - xmake=/usr/local/share/ \ - core/bin/demo.pkg/bin/linux/$arch/demo.b=/usr/local/share/xmake/xmake \ - /tmp/xmake.sh=/usr/local/bin/xmake - - 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 "" --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 + + -- cgit v1.3.1