-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-dist
executable file
·62 lines (47 loc) · 1.36 KB
/
make-dist
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
set -e
# common shell functions
die()
{
echo "$0: $@"
exit 1
}
#----- checks
echo "*** dist: checks"
test -f make-dist || die "run make-dist from the directory it lives in"
VERSION=$(grep version index.smindex | sed 's/.*"\([0-9a-z.-]*\)"$/\1/g')
#----- create dirs
echo "*** dist: create dirs"
mkdir -p instruments/standard || die "need dir instruments/standard"
mkdir -p tmp || die "need dir tmp"
#----- clean
echo "*** dist: clean old stuff"
rm -f instruments/standard/*.smset
rm -f instruments/standard/*.smindex
rm -f spectmorph-instruments-$VERSION.tar
rm -f spectmorph-instruments-$VERSION.tar.xz
#----- build
echo "*** dist: building instruments ($VERSION)"
INSTS=$(cat index.smindex | while read cmd arg1 arg2
do
if [ "_$cmd" == "_smset" ]; then
echo $arg1 | sed 's/"//g;s/[.]smset//g'
fi
done)
for i in $INSTS
do
if [ -d "$i" ]; then
echo ./build.sh $i
else
die "instrument data for $i missing"
fi
done | parallel || die "errors during building instruments"
cp index.smindex instruments/standard
#----- tar
echo "*** dist: create tarball: spectmorph-instruments-$VERSION.tar"
tar cvf spectmorph-instruments-$VERSION.tar instruments
#----- xz
echo "*** dist: compress tarball => spectmorph-instruments-$VERSION.tar.xz"
xz -9 spectmorph-instruments-$VERSION.tar
#----- download size
ls -hl spectmorph-instruments-$VERSION.tar.xz