summaryrefslogtreecommitdiff
path: root/mrk-srv-build.sh
blob: 132bc29eda8f3a42cd54fe7620d04c0a8e100c63 (plain)
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
#!/bin/sh
# build dir dstdir
set -e

cd "$1"
rm -f *.mkb || true
rm -rf Marrakesh || true

ls
mrk extract *.mks

export CC=gcc
export CFLAGS="-O3 -ffast-math"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
export NAME=`grep "^PROJ:" Marrakesh.mrk | tail -1 | sed -e 's/PROJ://g' | sed -e 's/ *$//' -e 's/^ *//'`
export VERSION=`grep "^VERSION:" Marrakesh.mrk | tail -1 | sed -e 's/VERSION://g' | sed -e 's/ *$//' -e 's/^ *//'`

## this is a sample - you need to do this N times, once per arch
export MRKARCH="x86_64"
export MRKOS="linux"
mrk build
mrk bin
mrk src
export D="$2"/"$MRKOS-$MRKARCH"
mkdir -p "$D" || true
cp "$NAME"-"$VERSION".mkb "$D"
pushd "$D"
rm -f "$NAME" || true
ln -s "$NAME"-"$VERSION".mkb "$NAME"
popd

## # copy src to right place
export D="$2"/"src"
mkdir -p "$D" || true
cp "$NAME"-"$VERSION".mks "$D"
pushd "$D"
rm -f "$NAME" || true
ln -s "$NAME"-"$VERSION".mks "$NAME"
popd

cd /tmp
rm -rf "$1"

exit 0