Skip to content

Commit

Permalink
Packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
aerth committed Jun 16, 2016
1 parent 6ab9dd4 commit ddf0910
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ cross:
GOOS=openbsd GOARCH=386 go build -v ${GO_LDFLAGS} -o bin/${NAME}-v${RELEASE}-openbsd-x86
GOOS=netbsd GOARCH=amd64 go build -v ${GO_LDFLAGS} -o bin/${NAME}-v${RELEASE}-netbsd-amd64
GOOS=netbsd GOARCH=386 go build -v ${GO_LDFLAGS} -o bin/${NAME}-v${RELEASE}-netbsd-x86
echo ${RELEASE} > bin/VERSION
@echo ${RELEASE} > bin/VERSION
@echo "Now run ./pack.bash"


# package target is not working out, moved to a shell script named "package.bash"
# package target is not working out, moved to a shell script named "pack.bash"
package:
mkdir -p pkg
for i in $(shell ls bin); do sha384sum bin/$i >> HASH; done
for i in $(shell ls bin); do zip $i.zip bin/$i README.md LICENSE.md HASH; done

@echo "Run ./pack.bash"
26 changes: 26 additions & 0 deletions pack.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e
WORKDIR=$(pwd)
package(){
echo "Using ./pkg directory"
mkdir -p pkg
if [ -f HASH ]; then
echo "Renaming HASH to HASH.old"
mv HASH HASH.old
fi
cd bin
echo "Creating HASH file"
for i in $(ls); do sha384sum $i >> $WORKDIR/HASH; done
cd $WORKDIR
echo "Packaging all in ./bin"
for i in $(ls bin); do zip pkg/$i.zip bin/$i README.md LICENSE.md HASH; done
echo "Done."
echo ""
}

if [ -z $(ls bin) ]; then
echo "Run 'make cross' first!"
exit 1
fi

package

0 comments on commit ddf0910

Please sign in to comment.