3 local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil; end end
5 local function missingdep(name, sources, msg)
7 print("**************************");
8 print("Prosody was unable to find "..tostring(name));
9 print("This package can be obtained in the following ways:");
11 for k,v in pairs(sources) do
15 print(msg or (name.." is required for Prosody to run, so we will now exit."));
16 print("More help can be found on our website, at http://.../doc/depends");
17 print("**************************");
21 local lxp = softreq "lxp"
24 missingdep("luaexpat", { ["Ubuntu 8.04 (Hardy)"] = "sudo apt-get install liblua5.1-expat0"; ["luarocks"] = "luarocks install luaexpat"; });
28 local socket = softreq "socket"
31 missingdep("luasocket", { ["Ubuntu 8.04 (Hardy)"] = "sudo apt-get install liblua5.1-socket2"; ["luarocks"] = "luarocks install luasocket"; });
35 local ssl = softreq "ssl"
38 missingdep("LuaSec", { ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/" }, "SSL/TLS support will not be available");
42 local md5 = softreq "md5";
45 missingdep("MD5", { ["luarocks"] = "luarocks install md5"; ["Source"] = "http://luaforge.net/frs/?group_id=155" });
50 if fatal then os.exit(1); end