1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-11-05 09:40:20 +01:00
irc/packmod.sh

66 lines
1.3 KiB
Bash
Raw Normal View History

2012-12-01 04:06:15 +01:00
#! /bin/sh
echo "Detecting directories...";
if [ -f "CMakeLists.txt" ]; then
srcdir=".";
bindir="Build";
elif [ -f "../CMakeLists.txt" ]; then
srcdir="..";
bindir=".";
else
echo "Error: Couldn't find CMakeLists.txt." >&2;
exit 1;
fi
if [ -e "$bindir/src/luasocket/libluasocket.dll" ]; then
2012-12-01 20:52:11 +01:00
lib="$bindir/src/luasocket/libluasocket.dll";
2012-12-01 04:06:15 +01:00
elif [ -e "$bindir/src/luasocket/libluasocket.so" ]; then
2012-12-01 20:52:11 +01:00
lib="$bindir/src/luasocket/libluasocket.so";
2012-12-01 04:06:15 +01:00
else
echo "Error: Couldn't find luasocket lib." >&2;
echo " Did you compile before running this script?" >&2;
exit 1;
fi
2012-12-01 21:15:06 +01:00
mkdir "$srcdir/irc";
2012-12-01 04:06:15 +01:00
files_luairc="\
$srcdir/src/luairc/irc.lua
2012-12-01 20:52:11 +01:00
$srcdir/src/luairc/irc
$srcdir/doc/LICENSE-LuaIRC.txt
2012-12-01 04:06:15 +01:00
";
files_luasocket="\
$srcdir/src/luasocket/ftp.lua
$srcdir/src/luasocket/http.lua
$srcdir/src/luasocket/ltn12.lua
$srcdir/src/luasocket/mime.lua
$srcdir/src/luasocket/smtp.lua
$srcdir/src/luasocket/socket.lua
$srcdir/src/luasocket/tp.lua
$srcdir/src/luasocket/url.lua
2012-12-01 20:52:11 +01:00
$srcdir/doc/LICENSE-luasocket.txt
2012-12-01 04:06:15 +01:00
$lib
";
files="\
$srcdir/src/init.lua
2012-12-01 20:52:11 +01:00
$srcdir/README.txt
$srcdir/doc/LICENSE.txt
2012-12-01 04:06:15 +01:00
$files_luairc
$files_luasocket
";
oIFS="$IFS";
IFS='
';
echo "Copying files...";
for file in $files; do
IFS="$oIFS";
2012-12-01 21:15:06 +01:00
cp -fr "$file" "$srcdir/irc";
2012-12-01 04:06:15 +01:00
done
echo "Operation completed successfully!";
exit 0;