Skip to content

Commit

Permalink
Merge pull request #253 from uniqush/update-build-script
Browse files Browse the repository at this point in the history
Update the build script to use `go mod`
  • Loading branch information
TysonAndre authored Nov 27, 2019
2 parents 4ee1de1 + 8061028 commit 61dbadc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 74 deletions.
62 changes: 0 additions & 62 deletions build/build-uniqush-push-exp.sh

This file was deleted.

26 changes: 14 additions & 12 deletions build/build-uniqush-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]: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" .

Expand All @@ -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
Expand Down

0 comments on commit 61dbadc

Please sign in to comment.