1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00
Files
go-inbucket/bin/dist-unix.sh
James Hillyerd 8361fa6b6e Dist scripts...
- Add files to tarball as root/root
- Move redhat-init script to etc/redhat-el6 so it's included in dist tarball
2012-11-05 09:33:27 -08:00

43 lines
820 B
Bash
Executable File

#!/bin/sh
# Compile and package inbucket dist for unix
if [ "${1}x" = "x" ]; then
echo "Usage: $0 <version-label>" 1>&2
exit 1
fi
label="$1"
# Bail on error
set -e
# Work directory
tmpdir=/tmp/inbucket-dist.$$
mkdir -p $tmpdir
# Figure out our build env/target
go env > $tmpdir/env
. $tmpdir/env
distname="inbucket-${label}-${GOOS}_$GOARCH"
distdir="$tmpdir/$distname"
echo "Building $distname..."
mkdir -p $distdir
go build -o $distdir/inbucket -a -v github.com/jhillyerd/inbucket
echo "Copying resources..."
cp LICENSE README.md $distdir/
cp -r etc $distdir/etc
cp -r themes $distdir/themes
echo "Tarballing..."
tarball="$HOME/$distname.tbz2"
cd $tmpdir
tar --owner=root --group=root -cjvf $tarball $distname
echo "Cleaning up..."
if [ "$tmpdir" != "/" ]; then
rm -rf $tmpdir
fi
echo "Created $tarball"