diff --git a/build/build-uniqush-push-exp.sh b/build/build-uniqush-push-exp.sh deleted file mode 100755 index 346affc..0000000 --- a/build/build-uniqush-push-exp.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -TEMP=`pwd`/tmpgopath -LICENSE=Apache-2.0 - -mkdir -p $TEMP/bin -mkdir -p $TEMP/src -mkdir -p $TEMP/pkg - -GOBIN=$TEMP/bin GOPATH=$TEMP go get github.com/uniqush/uniqush-push - -PWD=`pwd` -cd $TEMP/src/github.com/uniqush/log/ && git checkout exp -cd $TEMP/src/github.com/uniqush/uniqush-push/ && git checkout exp -GOBIN=$TEMP/bin GOPATH=$TEMP go get github.com/uniqush/uniqush-push -cp $TEMP/src/github.com/uniqush/uniqush-push/uniqush-push $TEMP/bin/uniqush-push -cd $TEMP/ -cd .. - - -VERSION=`$TEMP/bin/uniqush-push --version | sed 's/uniqush-push //'` -echo "building version " $VERSION - -BUILD=`pwd`/uniqush-push-$VERSION -mkdir -p $BUILD/usr/bin -mkdir -p $BUILD/etc/uniqush/ - -ARCH=`uname -m` - -cp $TEMP/bin/uniqush-push $BUILD/usr/bin -cp $TEMP/src/github.com/uniqush/uniqush-push/conf/uniqush-push.conf $BUILD/etc/uniqush -cp $TEMP/src/github.com/uniqush/uniqush-push/LICENSE $LICENSE - -fpm -s dir -t rpm -v $VERSION -n uniqush-push --license=$LICENSE --maintainer="Nan Deng" --vendor "uniqush" --url="http://uniqush.org" --category Network --description "Uniqush is a free and open source software which provides a unified push service for server-side notification to apps on mobile devices" -a $ARCH -C $BUILD . - -fpm -s dir -t deb -v $VERSION -n uniqush-push --license=$LICENSE --maintainer="Nan Deng" --vendor "uniqush" --url="http://uniqush.org" --category Network --description "Uniqush is a free and open source software which provides a unified push service for server-side notification to apps on mobile devices" -a $ARCH -C $BUILD . - -TARBALLNAME=uniqush-push_${VERSION}_$ARCH -TARBALLDIR=`pwd`/$TARBALLNAME -mkdir -p $TARBALLDIR -cp $LICENSE $TARBALLDIR -cp $TEMP/bin/uniqush-push $TARBALLDIR -cp $TEMP/src/github.com/uniqush/uniqush-push/conf/uniqush-push.conf $TARBALLDIR/uniqush-push.conf - -cat > $TARBALLNAME/install.sh << EOF -#!/bin/sh -mkdir -p /etc/uniqush -cp uniqush-push /usr/local/bin -cp uniqush-push.conf /etc/uniqush -echo "Success!" -EOF - -chmod +x $TARBALLDIR/install.sh -tar czvf $TARBALLNAME.tar.gz $TARBALLNAME - -rm -rf $TEMP -rm -rf $BUILD -rm -rf $TARBALLDIR -rm -f uniqush-push -rm -f uniqush-push.conf -rm -f $LICENSE - diff --git a/build/build-uniqush-push.sh b/build/build-uniqush-push.sh index 488aee7..bb87b82 100755 --- a/build/build-uniqush-push.sh +++ b/build/build-uniqush-push.sh @@ -5,27 +5,29 @@ TEMP=`pwd`/tmpgopath LICENSE=Apache-2.0 -mkdir -p "$TEMP/bin" -mkdir -p "$TEMP/src" -mkdir -p "$TEMP/pkg" - if [ -d "$TEMP" ]; then rm -rf "$TEMP" fi +mkdir -p $TEMP -GOBIN="$TEMP/bin" GOPATH="$TEMP" go get github.com/uniqush/uniqush-push - -VERSION=`"$TEMP/bin/uniqush-push" --version | sed 's/uniqush-push //'` +pushd $TEMP +git clone --depth 1 git@github.com:uniqush/uniqush-push.git +pushd uniqush-push +go get +go build +popd +popd +VERSION=`$TEMP/uniqush-push/uniqush-push --version | sed 's/uniqush-push //'` BUILD=`pwd`/"uniqush-push-$VERSION" mkdir -p "$BUILD/usr/bin" mkdir -p "$BUILD/etc/uniqush/" ARCH="`uname -m`" -cp "$TEMP/bin/uniqush-push" "$BUILD/usr/bin" -cp "$TEMP/src/github.com/uniqush/uniqush-push/conf/uniqush-push.conf" "$BUILD/etc/uniqush" -cp "$TEMP/src/github.com/uniqush/uniqush-push/LICENSE" "$LICENSE" +cp "$TEMP/uniqush-push/uniqush-push" "$BUILD/usr/bin" +cp "$TEMP/uniqush-push/conf/uniqush-push.conf" "$BUILD/etc/uniqush" +cp "$TEMP/uniqush-push/LICENSE" "$LICENSE" fpm -s dir -t rpm -v "$VERSION" -n uniqush-push --license="$LICENSE" --maintainer="Nan Deng" --vendor "uniqush" --url="http://uniqush.org" --category Network --description "Uniqush is a free and open source software which provides a unified push service for server-side notification to apps on mobile devices" -a "$ARCH" -C "$BUILD" . @@ -35,8 +37,8 @@ TARBALLNAME="uniqush-push_${VERSION}_$ARCH" TARBALLDIR=`pwd`/"$TARBALLNAME" mkdir -p "$TARBALLDIR" cp "$LICENSE" "$TARBALLDIR" -cp "$TEMP/bin/uniqush-push" "$TARBALLDIR" -cp "$TEMP/src/github.com/uniqush/uniqush-push/conf/uniqush-push.conf" "$TARBALLDIR/uniqush-push.conf" +cp "$TEMP/uniqush-push/uniqush-push" "$TARBALLDIR" +cp "$TEMP/uniqush-push/conf/uniqush-push.conf" "$TARBALLDIR/uniqush-push.conf" cat > "$TARBALLNAME/install.sh" << EOF #!/bin/sh