2015-10-30 13:29:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-04-22 02:00:45 +00:00
|
|
|
mingw32=/c/msys64/mingw32
|
|
|
|
|
|
|
|
info=`uname -a`
|
|
|
|
if [[ "$info" == MINGW64* ]]; then
|
|
|
|
arch="win64";
|
|
|
|
else
|
|
|
|
if [[ "$info" == MINGW32* ]]; then
|
|
|
|
arch="win32";
|
|
|
|
else
|
|
|
|
echo "Unknown architecture: $info" > /dev/stderr
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $arch
|
|
|
|
|
2015-10-30 13:29:48 +00:00
|
|
|
name=`pwd|perl -e '$d=<>;$d=~s{.*?/}{}g;$d=~s/$//g;print $d'`
|
2018-04-22 02:00:45 +00:00
|
|
|
name="$name-$arch"
|
2015-10-30 13:29:48 +00:00
|
|
|
echo $name
|
|
|
|
if [ -d $name ]; then
|
|
|
|
rm -rf $name
|
|
|
|
fi
|
|
|
|
mkdir $name || exit 1
|
2016-06-03 23:38:38 +00:00
|
|
|
cp -r resty restydoc restydoc-index nginx.exe luajit.exe lua51.dll lua include lualib html conf logs pod $name/ || exit 1
|
2015-11-05 12:51:35 +00:00
|
|
|
cp COPYRIGHT $name/ || exit 1
|
2018-04-22 02:00:45 +00:00
|
|
|
if [[ "$arch" == "win32" ]]; then
|
|
|
|
cp $mingw32/bin/libgcc_s_dw2-1.dll $name/ || exit 1
|
|
|
|
cp $mingw32/bin/libwinpthread-1.dll $name/ || exit 1
|
|
|
|
fi
|
2015-10-30 13:29:48 +00:00
|
|
|
cd $name || exit 1
|
|
|
|
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat resty' || exit 1
|
2016-05-13 02:21:16 +00:00
|
|
|
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc' || exit 1
|
2016-06-03 23:38:38 +00:00
|
|
|
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat restydoc-index' || exit 1
|
2018-04-22 02:00:45 +00:00
|
|
|
cp ../README-windows.txt README.txt
|
2015-12-09 23:53:56 +00:00
|
|
|
unix2dos conf/* html/*.html resty || exit 1
|
2015-10-30 13:29:48 +00:00
|
|
|
cd .. || exit 1
|
|
|
|
zip -r $name.zip $name || exit 1
|
|
|
|
echo $name.zip
|