forked from tpoechtrager/cctools-port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·35 lines (25 loc) · 703 Bytes
/
package.sh
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
#!/usr/bin/env bash
set -ex
DIR=`pwd`
PACKAGETMP=`mktemp -d /tmp/XXXXXXXX`
REVHASH=`git rev-parse --short HEAD`
CCTOOLSVER=`cat README.md | grep "Current Version: " | awk '{print $3}'`
LD64VER=`cat README.md | grep "Current Version: " | awk '{print $5}'`
PACKAGE=cctools-${CCTOOLSVER}-${LD64VER%?}_$REVHASH
mkdir $PACKAGETMP/$PACKAGE
cp -r . $PACKAGETMP/$PACKAGE
pushd $PACKAGETMP &>/dev/null
pushd $PACKAGE &>/dev/null
git clean -fdx &>/dev/null
rm -rf .git
rm -f cctools*.tar.*
rm -f package.sh
rm -f .gitignore
pushd cctools &>/dev/null
./autogen.sh
rm -rf autom4te.cache
popd &>/dev/null
popd &>/dev/null
tar -cf - * | xz -9 -c - > $DIR/$PACKAGE.tar.xz
popd &>/dev/null
rm -rf $PACKAGETMP