-
Notifications
You must be signed in to change notification settings - Fork 10
/
package.rc
executable file
·46 lines (40 loc) · 1014 Bytes
/
package.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name64='mycel-amd64'
name32='mycel-386'
version=`{date -i} ^ '-' ^ `{cat .git/fs/branch/heads/master/hash | read -c 6}
tarball64=`{pwd} ^ '/packages/' ^ $name64 ^ '-' ^ $version ^ '.tgz'
tarball32=`{pwd} ^ '/packages/' ^ $name32 ^ '-' ^ $version ^ '.tgz'
a='-buildvcs=false'
fn build {
tarball=$1
name=$2
GOARCH=$3
rm -rf ./$name
mkdir ./$name
mkdir -p ./packages
chmod +t ./$name
echo Compiling $GOARCH...
cd cmd/mycel
go build $a -ldflags '-s -w' -o $name
cd ../..
cd ../sparklefs/cmd/sparklefs
go build $a -ldflags '-s -w' -o sparklefs
cd ../../../mycel
mv cmd/mycel/$name ../sparklefs/cmd/sparklefs/sparklefs ./$name/
cp README.md ./$name/
cp mycel.jpg ./$name/
tar czf $tarball $name
chmod +t $tarball
echo Created $tarball
}
echo Testing...
go vet $a ./...
go test $a -cover ./...
build $tarball64 $name64 amd64
build $tarball32 $name32 386
echo Verifying $tarball64 ...
mkdir -p /tmp/`{date -n}
cd /tmp/`{date -n}
tar xf $tarball64
cd $name64
./$name64 -v
./$name64 -v -jsinsecure