2018-05-15 18:48:19 +02:00
|
|
|
#!/bin/bash
|
2018-05-15 19:02:46 +02:00
|
|
|
source /etc/environment
|
2018-05-15 18:48:19 +02:00
|
|
|
mkdir -p .tmp/src/maunium.net/go
|
|
|
|
ln -s ../../../../ .tmp/src/maunium.net/go/gomuks
|
|
|
|
mkdir -p target/
|
|
|
|
export GOPATH=$(pwd)/.tmp
|
|
|
|
export SHORTHEAD=${HEAD:0:7}
|
|
|
|
export VERSION=$(awk '/^Version:/ { print $2 }' deb/DEBIAN/control | sed -E 's/\-[0-9]+$//')
|
|
|
|
|
|
|
|
echo "Compiling for linux/amd64"
|
|
|
|
go build -o "target/$PROJECT_NAME-linux-amd64"
|
|
|
|
echo "Compiling for linux/arm"
|
|
|
|
GOARCH=arm go build -o "target/$PROJECT_NAME-linux-arm"
|
|
|
|
echo "Compiling for darwin/amd64"
|
|
|
|
GOOS=darwin go build -o "target/$PROJECT_NAME-darwin-amd64"
|
|
|
|
|
|
|
|
echo "Packaging for debian (linux/amd64)"
|
|
|
|
mkdir -p deb/usr/bin/
|
2018-05-25 23:07:01 +02:00
|
|
|
|
2018-05-15 18:48:19 +02:00
|
|
|
cp target/$PROJECT_NAME-linux-amd64 deb/usr/bin/gomuks
|
2018-05-25 23:07:01 +02:00
|
|
|
|
|
|
|
go get -u maunium.net/go/tcell
|
|
|
|
mkdir -p deb/usr/share/tcell/
|
|
|
|
rm -rf deb/usr/share/tcell/database
|
|
|
|
cp -r $GOPATH/src/maunium.net/go/tcell/terminfo/database deb/usr/share/tcell
|
|
|
|
|
2018-05-15 18:48:19 +02:00
|
|
|
sed -i.bak -E 's/(Version: [0-9]+\.[0-9]+\.[0-9]+\-[0-9]+)/\1+'$SHORTHEAD'/' deb/DEBIAN/control
|
|
|
|
dpkg-deb --build deb 'target/'$PROJECT_NAME'_linux_amd64.deb'
|
|
|
|
mv -f deb/DEBIAN/control.bak deb/DEBIAN/control
|
|
|
|
|
|
|
|
mkdir -p /srv/downloads/programs/gomuks/$VERSION-$SHORTHEAD
|
|
|
|
mv target/* /srv/downloads/programs/gomuks/$VERSION-$SHORTHEAD/
|