#!/bin/sh -ex cd luafilesystem luarocks config variables.CFLAGS " $CFLAGS" luarocks make --pack-binary-rock luafilesystem-scm-1.rockspec obj="luafilesystem-scm-1.$(luarocks config arch).rock" cp $obj /root cd /root if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then # Release build, delete docs/ and tests/ zip -d $obj docs/ docs/* tests/ tests/* # And pack the library with upx unzip $obj lib/* upx --no-progress lib/* zip -r "$obj" lib fi