-
Notifications
You must be signed in to change notification settings - Fork 3
/
lua.sh
executable file
·51 lines (43 loc) · 1.16 KB
/
lua.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
echo "Starting..."
#Stop on error.
set -e
#Output name.
PKG_NAME=Lua
#Sources and dependency names.
ZIP=zip-3.0-11
LUA=lua-5.1.5-1
READLINE=libreadline7-6.1.2-3
#Clean up.
rm -rf .working_dir
mkdir .working_dir
cd .working_dir
#Grab sources and dependencies.
echo "Grabbing sources..."
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/zip/$ZIP.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/lua/$LUA.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/readline/libreadline7/$READLINE.tar.bz2
#Unzip.
echo "Unzipping sources..."
tar xjf $ZIP.tar.bz2 -C / #Needed for packaging.
tar xjf $LUA.tar.bz2
tar xjf $READLINE.tar.bz2
#Move sources in place for packaging.
echo "Creating package basis..."
## Bin directory.
mkdir $PKG_NAME
mkdir $PKG_NAME/bin
cp -r usr/bin/* $PKG_NAME/bin
## Lib directory.
mkdir $PKG_NAME/lib
cp -r usr/lib/* $PKG_NAME/lib
## Include and Share directory.
mkdir $PKG_NAME/usr
cp -r usr/include $PKG_NAME/usr
cp -r usr/share $PKG_NAME/usr
#Build package.
echo "Building package..."
cd $PKG_NAME
zip -r $PKG_NAME.mxt3 .
mv $PKG_NAME.mxt3 ../../
echo "Created package $PKG_NAME.mxt3 successfully!"