├── Makefile ├── Makefile.win ├── README ├── conf ├── cgilua │ └── config.lua └── xavante │ └── config.lua ├── css └── doc.css ├── doc └── us │ ├── index.html │ ├── kepler.png │ └── license.html ├── kepler-install-1.1-1 ├── kepler-install-1.1.1-1 ├── kepler-install-1.1.1-2 ├── kepler-install-cvs-1 ├── rockspec ├── kepler-1.1-1.rockspec ├── kepler-1.1.1-1.rockspec ├── kepler-1.1rc1-1.rockspec ├── kepler-cvs-1.rockspec ├── kepler-cvs-2.rockspec ├── kepler-fastcgi-1.1-1.rockspec ├── kepler-fastcgi-1.1-2.rockspec ├── kepler-fastcgi-1.1.1-1.rockspec ├── kepler-fastcgi-1.1.1-2.rockspec ├── kepler-fastcgi-1.1rc1-1.rockspec ├── kepler-fastcgi-cvs-1.rockspec ├── kepler-fastcgi-cvs-2.rockspec ├── kepler-xavante-1.1-1.rockspec ├── kepler-xavante-1.1.1-1.rockspec ├── kepler-xavante-1.1rc1-1.rockspec ├── kepler-xavante-cvs-1.rockspec └── kepler-xavante-cvs-2.rockspec ├── src ├── cgilua.cgi ├── cgilua.fcgi ├── kepler_init.lua ├── make_rc.lua ├── op.cgi ├── op.fcgi ├── rclauncher.c ├── setup-kepler ├── xavante_start └── xavantetray │ ├── SystemTraySDK.cpp │ ├── SystemTraySDK.h │ ├── XavanteTray.ICO │ ├── XavanteTray.cpp │ ├── XavanteTray.h │ ├── XavanteTray.rc │ ├── resource.h │ ├── start.ico │ ├── stop.ico │ └── xavante.bmp └── web ├── app.lua ├── css └── doc.css ├── htaccess_cgi ├── htaccess_fcgi ├── img ├── keplerproject.gif └── test.jpg ├── index.lp ├── jquery └── jquery-1.2.3.min.js ├── orbit ├── pages │ ├── bar.op │ ├── foo.op │ ├── index.op │ ├── items.op │ ├── test.op │ ├── todo.db │ ├── todo.op │ ├── todo.sql │ └── todo.ws └── songs │ ├── songs.lua │ └── songs.ws ├── test.lp └── wsapi └── hello.ws /Makefile: -------------------------------------------------------------------------------- 1 | # $Id: Makefile,v 1.1 2008/06/30 14:29:59 carregal Exp $ 2 | 3 | 4 | install: 5 | chmod +x src/setup-kepler 6 | chmod +x src/cgilua.cgi 7 | chmod +x src/op.cgi 8 | find . -name "*.lp" -o -name "*.lua" -o -name "*.ws" -o -name "*.op" | xargs chmod +x 9 | cp -r web $(PREFIX)/ 10 | cp -r doc $(PREFIX)/ 11 | cp -r css $(PREFIX)/ 12 | cp -r conf $(PREFIX)/ 13 | cp src/setup-kepler $(BIN_DIR) 14 | cp src/cgilua.cgi $(BIN_DIR) 15 | cp src/op.cgi $(BIN_DIR) 16 | test -e $(LUA_DIR)/kepler_init.lua || cp src/kepler_init.lua $(LUA_DIR) 17 | 18 | install-fastcgi: 19 | chmod +x src/cgilua.fcgi 20 | chmod +x src/op.fcgi 21 | cp src/cgilua.fcgi $(BIN_DIR) 22 | cp src/op.fcgi $(BIN_DIR) 23 | 24 | install-xavante: 25 | chmod +x src/xavante_start 26 | cp src/xavante_start $(BIN_DIR) 27 | 28 | dist: 29 | darcs dist -d kepler-rocks-cvs 30 | mv kepler-rocks-cvs.tar.gz .. 31 | 32 | gen_dist: 33 | darcs push 139.82.100.4:public_html/kepler-rocks/current 34 | ssh 139.82.100.4 "cd public_html/kepler-rocks/current && make dist" 35 | 36 | -------------------------------------------------------------------------------- /Makefile.win: -------------------------------------------------------------------------------- 1 | # $Id: Makefile,v 1.1.1.1 2007/11/26 17:12:24 mascarenhas Exp $ 2 | 3 | WIN_LIBS= kernel32.lib user32.lib gdi32.lib shell32.lib 4 | 5 | .c.obj: 6 | $(CC) /c /MD /Fo$@ $(CFLAGS) /I$(LUA_INCDIR) $< 7 | 8 | .cpp.obj: 9 | $(CC) /c /MD /Fo$@ $(CFLAGS) /I$(LUA_INCDIR) $< 10 | 11 | src\cgilua.exe: src\rclauncher.obj 12 | lua5.1 src\make_rc.lua src\cgilua.cgi > src\cgilua.rc 13 | rc /r /fosrc\cgilua.res src\cgilua.rc 14 | link /out:src\cgilua.exe src\rclauncher.obj src\cgilua.res $(LUA_LIB) user32.lib 15 | mt -manifest src\cgilua.exe.manifest -outputresource:src\cgilua.exe;1 16 | 17 | src\cgilua-fcgi.exe: src\rclauncher.obj 18 | lua5.1 src\make_rc.lua src\cgilua.fcgi > src\cgilua-fcgi.rc 19 | rc /r /fosrc\cgilua-fcgi.res src\cgilua-fcgi.rc 20 | link /out:src\cgilua-fcgi.exe src\rclauncher.obj src\cgilua-fcgi.res $(LUA_LIB) user32.lib 21 | mt -manifest src\cgilua-fcgi.exe.manifest -outputresource:src\cgilua-fcgi.exe;1 22 | 23 | src\op.exe: src\rclauncher.obj 24 | lua5.1 src\make_rc.lua src\op.cgi > src\op.rc 25 | rc /r /fosrc\op.res src\op.rc 26 | link /out:src\op.exe src\rclauncher.obj src\op.res $(LUA_LIB) user32.lib 27 | mt -manifest src\op.exe.manifest -outputresource:src\op.exe;1 28 | 29 | src\op-fcgi.exe: src\rclauncher.obj 30 | lua5.1 src\make_rc.lua src\op.fcgi > src\op-fcgi.rc 31 | rc /r /fosrc\op-fcgi.res src\op-fcgi.rc 32 | link /out:src\op-fcgi.exe src\rclauncher.obj src\op-fcgi.res $(LUA_LIB) user32.lib 33 | mt -manifest src\op-fcgi.exe.manifest -outputresource:src\op-fcgi.exe;1 34 | 35 | src\xavantetray\xavante.exe: src\xavantetray\SystemTraySDK.obj src\xavantetray\XavanteTray.obj src\xavantetray\XavanteTray.res 36 | copy src\xavantetray\XavanteTray.rc src\xavantetray\xavante.rc 37 | lua5.1 src\make_rc.lua src\xavante_start >> src\xavantetray\xavante.rc 38 | rc /l 0xc09 /fosrc\xavantetray\XavanteTray.res src\xavantetray\xavante.rc 39 | link /subsystem:windows /out:src\xavantetray\xavante.exe src\xavanteTray\SystemTraySDK.obj src\xavantetray\XavanteTray.obj src\xavantetray\XavanteTray.res $(LUA_LIB) $(WIN_LIBS) 40 | mt -manifest src\xavantetray\xavante.exe.manifest -outputresource:src\xavantetray\xavante.exe;1 41 | 42 | all: src\cgilua.exe src\op.exe 43 | 44 | fcgi: src\cgilua-fcgi.exe src\op-fcgi.exe 45 | 46 | xavante: src\xavantetray\xavante.exe 47 | 48 | install: 49 | IF NOT EXIST "$(LUA_DIR)" mkdir "$(LUA_DIR)" 50 | IF NOT EXIST "$(PREFIX)\web" mkdir "$(PREFIX)\web" 51 | IF NOT EXIST "$(PREFIX)\doc" mkdir "$(PREFIX)\doc" 52 | IF NOT EXIST "$(PREFIX)\css" mkdir "$(PREFIX)\css" 53 | IF NOT EXIST "$(PREFIX)\conf" mkdir "$(PREFIX)\conf" 54 | xcopy /E web "$(PREFIX)\web\" 55 | xcopy /E doc "$(PREFIX)\doc\" 56 | xcopy /E css "$(PREFIX)\css\" 57 | xcopy /E conf "$(PREFIX)\conf\" 58 | copy src\setup-kepler "$(BIN_DIR)" 59 | copy src\cgilua.exe "$(BIN_DIR)" 60 | copy src\op.exe "$(BIN_DIR)" 61 | copy src\kepler_init.lua "$(LUA_DIR)" 62 | 63 | install-fastcgi: 64 | copy src\cgilua-fcgi.exe "$(BIN_DIR)" 65 | copy src\op-fcgi.exe "$(BIN_DIR)" 66 | 67 | install-xavante: 68 | copy src\xavante_start "$(BIN_DIR)" 69 | copy src\xavantetray\xavante.exe "$(BIN_DIR)" 70 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Kepler 1.1.1 2 | http://www.keplerproject.org 3 | 4 | Kepler is a Lua web development platform that offers the same advantages of Lua. 5 | Kepler is simple, portable, light, embeddable and extensible. 6 | 7 | The Kepler Platform consists in distributions for Windows, Unix and OSX and allows 8 | the development of Web Applications using WSAPI, Orbit or CGILua technologies; 9 | the user can also choose to use additional modules to support SQL, XML, Zip, MD5 etc. 10 | 11 | Kepler uses LuaRocks as its main deployment option, but can be used without LuaRocks 12 | if needed. The best option for deployment without LuaRocks is to first do a normal 13 | deployment (using LuaRocks) in a separate environment, then copying the modules to 14 | the final environment. This is the recommended solution for embedded scenarios 15 | (doing the LuaRocks-based deployment in your cross-compilation environment). 16 | 17 | Kepler is free software and uses the same license as Lua 5.1. 18 | 19 | Version 1.1.1 [11/Mar/2009] 20 | * Uses LuaRocks 1.0 as the main deployment option 21 | * Allows the offline installation of Kepler from a single tarball 22 | * Modules: 23 | CGILua 5.1.3 24 | Copas 1.1.4 25 | Cosmo 8.04.14 26 | Coxpcall 1.13 27 | LPeg 0.9 28 | LuaFileSystem 1.4.2 29 | LuaSocket 2.0.2 30 | Orbit 2.0.2 31 | Rings 1.2.2 32 | WSAPI 1.1 33 | Xavante 2.0.1 34 | -------------------------------------------------------------------------------- /conf/cgilua/config.lua: -------------------------------------------------------------------------------- 1 | -- CGILua user configuration file 2 | -- $Id: config.lua,v 1.1 2008/06/30 14:30:00 carregal Exp $ 3 | 4 | -- Looks for a Lua script in the web directory with the same name as 5 | -- the executable 6 | -- Useful for shorter URLs, just be careful with an eventual name clashing 7 | -- when using this option 8 | -- cgilua.use_executable_name = true 9 | 10 | -- Enables CGILua authentication 11 | -- cgilua.doif (CGILUA_CONF.."/authentication_conf.lua") 12 | 13 | -- Emulating old behavior loading file "env.lua" from the script's directory 14 | --[[ 15 | cgilua.addopenfunction (function () 16 | cgilua.doif ("env.lua") 17 | end) 18 | --]] 19 | 20 | -- Basic configuration for using sessions 21 | --[[ 22 | require"cgilua.session" 23 | cgilua.session.setsessiondir (CGILUA_TMP) 24 | -- The following function must be called by every script that needs session. 25 | local already_enabled = false 26 | function cgilua.enablesession () 27 | if already_enabled then 28 | return 29 | else 30 | already_enabled = true 31 | end 32 | cgilua.session.open () 33 | cgilua.addclosefunction (cgilua.session.close) 34 | end 35 | --]] 36 | 37 | -- Optional compatibility values 38 | -- cgilua.preprocess = cgilua.handlelp 39 | -- cgilua.includehtml = cgilua.lp.include 40 | -------------------------------------------------------------------------------- /conf/xavante/config.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | -- Xavante configuration file. 3 | -- 4 | -- The configuration defines the Xavante environment 5 | -- Commented fields are optional and assume default values 6 | -- 7 | -- Xavante defines virtualhosts for each site running with Xavante. 8 | -- Each virtualhost can define the handlers for specific files extensions. 9 | -- Xavante currently offers a fileHandler and a CGILuaHandler. 10 | -- 11 | -- Xavante configuration can be redefined on the default file structure by the 12 | -- the use of LUA_PATH, see more details in the online documentation. 13 | -- 14 | -- Authors: Javier Guerra and Andre Carregal 15 | -- Copyright (c) 2004-2006 Kepler Project 16 | --- 17 | -- $Id: config.lua,v 1.1 2008/06/30 14:29:59 carregal Exp $ 18 | ------------------------------------------------------------------------------ 19 | require "xavante.filehandler" 20 | require "xavante.cgiluahandler" 21 | require "xavante.redirecthandler" 22 | require "orbit.ophandler" 23 | 24 | -- Define here where Xavante HTTP documents scripts are located 25 | local webDir = XAVANTE_WEB 26 | 27 | local simplerules = { 28 | 29 | { -- URI remapping example 30 | match = "^/$", 31 | with = xavante.redirecthandler, 32 | params = {"index.lp"} 33 | }, 34 | 35 | { -- cgiluahandler example 36 | match = {"%.lp$", "%.lp/.*$", "%.lua$", "%.lua/.*$" }, 37 | with = xavante.cgiluahandler.makeHandler (webDir) 38 | }, 39 | 40 | { -- ophandler example 41 | match = {"%.op$", "%.op/.*$" }, 42 | with = orbit.ophandler.makeHandler (webDir) 43 | }, 44 | 45 | { -- wsapihandler example 46 | match = {"%.ws$", "%.ws/" }, 47 | with = wsapi.xavante.makeGenericHandler (webDir) 48 | }, 49 | 50 | { -- filehandler example 51 | match = ".", 52 | with = xavante.filehandler, 53 | params = {baseDir = webDir} 54 | }, 55 | } 56 | 57 | -- Displays a message in the console with the used ports 58 | xavante.start_message(function (ports) 59 | local date = os.date("[%Y-%m-%d %H:%M:%S]") 60 | print(string.format("%s Xavante started on port(s) %s", 61 | date, table.concat(ports, ", "))) 62 | end) 63 | 64 | xavante.HTTP{ 65 | server = {host = "*", port = 8080}, 66 | 67 | defaultHost = { 68 | rules = simplerules 69 | }, 70 | } 71 | -------------------------------------------------------------------------------- /css/doc.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 1em; 3 | margin-right: 1em; 4 | font-family: arial, helvetica, geneva, sans-serif; 5 | background-color:#ffffff; margin:0px; 6 | } 7 | 8 | code { 9 | font-family: "Andale Mono", monospace; 10 | } 11 | 12 | tt { 13 | font-family: "Andale Mono", monospace; 14 | } 15 | 16 | body, td, th { font-size: 11pt; } 17 | 18 | h1, h2, h3, h4 { margin-left: 0em; } 19 | 20 | textarea, pre, tt { font-size:10pt; } 21 | body, td, th { color:#000000; } 22 | small { font-size:0.85em; } 23 | h1 { font-size:1.5em; } 24 | h2 { font-size:1.25em; } 25 | h3 { font-size:1.15em; } 26 | h4 { font-size:1.06em; } 27 | 28 | a:link { font-weight:bold; color: #004080; text-decoration: none; } 29 | a:visited { font-weight:bold; color: #006699; text-decoration: none; } 30 | a:link:hover { text-decoration:underline; } 31 | hr { color:#cccccc } 32 | img { border-width: 0px; } 33 | 34 | 35 | h3 { padding-top: 1em; } 36 | 37 | p { margin-left: 1em; } 38 | 39 | p.name { 40 | font-family: "Andale Mono", monospace; 41 | padding-top: 1em; 42 | margin-left: 0em; 43 | } 44 | 45 | blockquote { margin-left: 3em; } 46 | 47 | .example { 48 | background-color: rgb(245, 245, 245); 49 | border-top-width: 1px; 50 | border-right-width: 1px; 51 | border-bottom-width: 1px; 52 | border-left-width: 1px; 53 | border-top-style: solid; 54 | border-right-style: solid; 55 | border-bottom-style: solid; 56 | border-left-style: solid; 57 | border-top-color: silver; 58 | border-right-color: silver; 59 | border-bottom-color: silver; 60 | border-left-color: silver; 61 | padding: 1em; 62 | margin-left: 1em; 63 | margin-right: 1em; 64 | font-family: "Andale Mono", monospace; 65 | font-size: smaller; 66 | } 67 | 68 | 69 | hr { 70 | margin-left: 0em; 71 | background: #00007f; 72 | border: 0px; 73 | height: 1px; 74 | } 75 | 76 | ul { list-style-type: disc; } 77 | 78 | table.index { border: 1px #00007f; } 79 | table.index td { text-align: left; vertical-align: top; } 80 | table.index ul { padding-top: 0em; margin-top: 0em; } 81 | 82 | table { 83 | border: 1px solid black; 84 | border-collapse: collapse; 85 | margin-left: auto; 86 | margin-right: auto; 87 | } 88 | th { 89 | border: 1px solid black; 90 | padding: 0.5em; 91 | } 92 | td { 93 | border: 1px solid black; 94 | padding: 0.5em; 95 | } 96 | div.header, div.footer { margin-left: 0em; } 97 | 98 | #container 99 | { 100 | margin-left: 1em; 101 | margin-right: 1em; 102 | background-color: #f0f0f0; 103 | } 104 | 105 | #product 106 | { 107 | text-align: center; 108 | border-bottom: 1px solid #cccccc; 109 | background-color: #ffffff; 110 | } 111 | 112 | #product big { 113 | font-size: 2em; 114 | } 115 | 116 | #product_logo 117 | { 118 | } 119 | 120 | #product_name 121 | { 122 | } 123 | 124 | #product_description 125 | { 126 | } 127 | 128 | #main 129 | { 130 | background-color: #f0f0f0; 131 | border-left: 2px solid #cccccc; 132 | } 133 | 134 | #navigation 135 | { 136 | float: left; 137 | width: 12em; 138 | margin: 0; 139 | vertical-align: top; 140 | background-color: #f0f0f0; 141 | overflow:visible; 142 | } 143 | 144 | #navigation h1 { 145 | background-color:#e7e7e7; 146 | font-size:1.1em; 147 | color:#000000; 148 | text-align:left; 149 | margin:0px; 150 | padding:0.2em; 151 | border-top:1px solid #dddddd; 152 | border-bottom:1px solid #dddddd; 153 | } 154 | 155 | #navigation ul 156 | { 157 | font-size:1em; 158 | list-style-type: none; 159 | padding: 0; 160 | margin: 1px; 161 | } 162 | 163 | #navigation li 164 | { 165 | text-indent: -1em; 166 | margin: 0em 0em 0em 0.5em; 167 | display: block; 168 | padding: 3px 0px 0px 12px; 169 | } 170 | 171 | #navigation li li a 172 | { 173 | padding: 0px 3px 0px -1em; 174 | } 175 | 176 | #content 177 | { 178 | margin-left: 12em; 179 | padding: 1em; 180 | border-left: 2px solid #cccccc; 181 | border-right: 2px solid #cccccc; 182 | background-color: #ffffff; 183 | } 184 | 185 | #about 186 | { 187 | clear: both; 188 | margin: 0; 189 | padding: 5px; 190 | border-top: 2px solid #cccccc; 191 | background-color: #ffffff; 192 | } 193 | 194 | @media print { 195 | body { 196 | font: 10pt "Times New Roman", "TimeNR", Times, serif; 197 | } 198 | a { font-weight:bold; color: #004080; text-decoration: underline; } 199 | 200 | #main { background-color: #ffffff; border-left: 0px; } 201 | #container { margin-left: 2%; margin-right: 2%; background-color: #ffffff; } 202 | 203 | #content { margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; } 204 | 205 | #navigation { display: none; 206 | } 207 | 208 | #product_logo 209 | { 210 | display: none; 211 | } 212 | 213 | #about img 214 | { 215 | display: none; 216 | } 217 | 218 | .example { 219 | font-family: "Andale Mono", monospace; 220 | font-size: 8pt; 221 | page-break-inside: avoid; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /doc/us/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Kepler: The Lua Web Development Platform 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 | 17 |
Kepler
18 |
The Lua Web Development Platform
19 |
20 | 21 |
22 | 23 | 45 | 46 |
47 | 48 |

Overview

49 | 50 |

Kepler is a Lua web development platform 51 | that offers the same advantages of Lua. Kepler is simple, 52 | portable, light, embeddable 53 | and extensible.

54 | 55 |

The Kepler Platform consists in distributions for Windows, Unix and OSX and allows 56 | the development of Web Applications using WSAPI, Orbit or CGILua technologies; 57 | the user can also choose to use additional modules to support SQL, XML, Zip, MD5 etc.

58 | 59 |

Kepler uses LuaRocks as its main deployment option, but can be used without LuaRocks if needed. 60 | The best option for deployment without LuaRocks is to first do a normal deployment (using LuaRocks) 61 | in a separate environment, then copying the modules to the final environment. 62 | This is the recommended solution for embedded scenarios 63 | (doing the LuaRocks-based deployment in your cross-compilation environment).

64 | 65 |

Kepler is free software and uses the same 66 | license as Lua 5.1.

67 | 68 |

More information about the project can be found at the 69 | Kepler FAQ.

70 | 71 |

Status

72 | 73 |

Current version is 1.1.1. It was developed for Lua 5.1.

74 | 75 |

Download

76 | 77 |

The Kepler Unix installer can be downloaded from its 78 | Lua Forge page. 79 | It installs Lua 5.1.4, LuaRocks version 1.0, and the Kepler modules using LuaRocks. 80 | If you already have Lua and LuaRocks and just with to install the Kepler modules, 81 | follow the installation instructions.

82 | 83 |

If you prefer to install everything from a single tarball, get the Kepler Unix tarball 84 | and execute the kepler-install script from it. This will install Lua, LuaRocks and the modules 85 | without needing network access to the LuaRocks repository.

86 | 87 |

Windows users need to install LuaRocks first and then follow the 88 | installation instructions.

89 | 90 |

History

91 | 92 |
93 |
Version 1.1.1 [12/Mar/2009]
94 |
    95 |
  • Uses LuaRocks 1.0 as the main deployment option
  • 96 |
  • Allows the offline installation of Kepler from a single tarball
  • 97 |
  • Modules: 98 |
      99 |
    • CGILua 5.1.3
    • 100 |
    • Copas 1.1.4
    • 101 |
    • Cosmo 8.04.14
    • 102 |
    • Coxpcall 1.13
    • 103 |
    • LPeg 0.9
    • 104 |
    • LuaFileSystem 1.4.2
    • 105 |
    • LuaSocket 2.0.2
    • 106 |
    • Orbit 2.0.2
    • 107 |
    • Rings 1.2.2
    • 108 |
    • WSAPI 1.1
    • 109 |
    • Xavante 2.0.1
    • 110 |
    111 |
  • 112 |
113 | 114 |
Version 1.1 [10/Jun/2008]
115 |
    116 |
  • Uses LuaRocks 0.5.2 as the main deployment option
  • 117 |
  • Offers a Unix installer for Lua and LuaRocks
  • 118 |
  • Based on WSAPI
  • 119 |
  • Includes Orbit as another web development option (besides CGILua and WSAPI)
  • 120 |
  • Modules: 121 |
      122 |
    • CGILua 5.1.2
    • 123 |
    • Copas 1.1.3
    • 124 |
    • Cosmo 8.04.14
    • 125 |
    • Coxpcall 1.13
    • 126 |
    • LPeg 0.8.1
    • 127 |
    • LuaFileSystem 1.4.1
    • 128 |
    • LuaSocket 2.0.2
    • 129 |
    • Orbit 2.0.1
    • 130 |
    • Rings 1.2.1
    • 131 |
    • WSAPI 1.0
    • 132 |
    • Xavante 2.0
    • 133 |
    134 |
  • 135 |
136 | 137 |
Version 1.1 Beta 2 [21/Nov/2007]
138 |
139 |
    140 |
  • Offers a CGILua application launcher (app.lua)
  • 141 |
  • Modules: 142 |
      143 |
    • Xavante 2.0 Beta
    • 144 |
    • CGILua 5.1.1
    • 145 |
    • LuaSQL 2.1.1
    • 146 |
    • Copas 1.1.1
    • 147 |
    • LuaFileSystem 1.3.0
    • 148 |
    • Rings 1.1.0
    • 149 |
    • LuaExpat 1.1.0
    • 150 |
    • LuaLogging 1.1.4
    • 151 |
    • LuaZip 1.2.3
    • 152 |
    • MD5 1.1.0
    • 153 |
    154 |
  • 155 |
156 |
157 | 158 |
Version 1.1 Beta 1 [31/Aug/2007]
159 |
160 |
    161 |
  • Uses Lua 5.1
  • 162 |
  • New Unix configure installer, much more flexible.
  • 163 |
  • Modules: 164 |
      165 |
    • Xavante 1.3.1
    • 166 |
    • CGILua 5.1.0
    • 167 |
    • LuaSQL 2.1.0
    • 168 |
    • Copas 1.1.1
    • 169 |
    • LuaFileSystem 1.2.1
    • 170 |
    • Rings 1.1.0
    • 171 |
    • LuaExpat 1.1.0
    • 172 |
    • LuaLogging 1.1.3
    • 173 |
    • LuaZip 1.2.3
    • 174 |
    • MD5 1.0.2
    • 175 |
    176 |
  • 177 |
178 |
179 | 180 |
Version 1.0[30/Nov/2006]
181 |
182 |
    183 |
  • New modules added: Rings, MD5 and LuaCOM (for the Windows version)
  • 184 |
  • Removed some modules (LDAP, SOAP, XML-RPC)
  • 185 |
  • New directory structure
  • 186 |
  • New bootstrapping sequence
  • 187 |
  • New Unix installation process, using configure && make
  • 188 |
189 |
190 | 191 |
Version 1.0 Beta [23/Jul/2005]
192 |
193 |
    194 |
  • First public Version
  • 195 |
  • Windows binary installer
  • 196 |
  • Unix source based installer
  • 197 |
198 |
199 |
200 | 201 |

Credits

202 | 203 |

Kepler was designed by the Kepler Team as part of the 204 | Kepler Project 205 | which holds its copyright.

206 | 207 |

Contact us

208 | 209 |

For more information please 210 | contact us. 211 | Comments are welcome!

212 | 213 |

You can also reach other Kepler developers and users on the Kepler Project 214 | mailing list.

215 | 216 |
217 | 218 |
219 | 220 |
221 |

Valid XHTML 1.0!

222 |

$Id: index.html,v 1.4 2009/03/11 22:52:23 carregal Exp $

223 |
224 | 225 |
226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /doc/us/kepler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/doc/us/kepler.png -------------------------------------------------------------------------------- /doc/us/license.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Kepler: The Lua Web Development Platform 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 | 17 |
Kepler
18 |
The Lua Web Development Platform
19 |
20 | 21 |
22 | 23 | 45 | 46 |
47 | 48 |

License

49 | 50 |

51 | Kepler is free software: it can be used for both academic 52 | and commercial purposes at absolutely no cost. There are no 53 | royalties or GNU-like "copyleft" restrictions. Kepler 54 | qualifies as 55 | Open Source 56 | software. 57 | Its licenses are compatible with 58 | GPL. 59 | Kepler is not in the public domain and the 60 | Kepler Project 61 | keep its copyright. 62 | The legal details are below. 63 |

64 | 65 |

The spirit of the license is that you are free to use 66 | Kepler for any purpose at no cost without having to ask us. 67 | The only requirement is that if you do use Kepler, then you 68 | should give us credit by including the appropriate copyright notice 69 | somewhere in your product or its documentation.

70 | 71 |

Kepler is designed and implemented by the Kepler Team. 72 | The implementation is not derived from licensed software.

73 | 74 |
75 |

Copyright © 2004 Kepler Project.

76 | 77 |

Permission is hereby granted, free of charge, to any person 78 | obtaining a copy of this software and associated documentation 79 | files (the "Software"), to deal in the Software without 80 | restriction, including without limitation the rights to use, copy, 81 | modify, merge, publish, distribute, sublicense, and/or sell copies 82 | of the Software, and to permit persons to whom the Software is 83 | furnished to do so, subject to the following conditions:

84 | 85 |

The above copyright notice and this permission notice shall be 86 | included in all copies or substantial portions of the Software.

87 | 88 |

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 89 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 90 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 91 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 92 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 93 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 94 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 95 | SOFTWARE.

96 | 97 |

 

98 |

 

99 |

 

100 |

 

101 |

 

102 | 103 |
104 | 105 |
106 | 107 |
108 |

Valid XHTML 1.0!

109 |

$Id: license.html,v 1.1 2008/06/30 14:30:00 carregal Exp $

110 |
111 | 112 |
113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /kepler-install-1.1-1: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kepler installation script. 4 | 5 | # Defaults 6 | 7 | PREFIX="/usr/local" 8 | TMP="/tmp" 9 | LUA_SUFFIX="" 10 | BUILD_LUA="yes" 11 | INSTALL_LUA="yes" 12 | USE_READLINE="yes" 13 | NCURSES_DIR="/usr" 14 | READLINE_DIR="/usr" 15 | LUA_DIR="/usr" 16 | LUA_INCDIR="/usr/include" 17 | LUA_LIBDIR="/usr/lib" 18 | LUA_BINDIR="/usr/bin" 19 | 20 | UNAME="`uname`" 21 | 22 | if ! [ "$UNAME" = "Linux" -o "$UNAME" = "Darwin" -o "$UNAME" = "FreeBSD" ] 23 | then 24 | USE_READLINE=no 25 | fi 26 | 27 | LUA_VERSION=5.1.3 28 | KEPLER_VERSION=0.3 29 | LUAROCKS_URL=http://luaforge.net/frs/download.php/3359/luarocks-0.5.2.tar.gz 30 | LUAROCKS_VERSION=0.5.2 31 | KEPLER_ROCK_VERSION=1.1 32 | SKIP_KEPLER=no 33 | 34 | # Help 35 | 36 | show_help() { 37 | cat < Makefile 217 | # This file was automatically generated by the configure script. 218 | # Run "./configure --help" for details. 219 | BUILD_LUA=$BUILD_LUA 220 | INSTALL_LUA=$INSTALL_LUA 221 | USE_READLINE=$USE_READLINE 222 | 223 | PREFIX=$PREFIX 224 | INCLUDEDIR=$INCLUDEDIR 225 | LUA_SUFFIX=$LUA_SUFFIX 226 | 227 | READLINE_DIR=$READLINE_DIR 228 | NCURSES_DIR=$NCURSES_DIR 229 | 230 | LUA_DIR=$LUA_DIR 231 | LUA_INCDIR=$LUA_INCDIR 232 | LUA_LIBDIR=$LUA_LIBDIR 233 | LUA_BINDIR=$LUA_BINDIR 234 | 235 | LUA_URL=http://www.lua.org/ftp 236 | 237 | READLINE_LIBDIR=\$(READLINE_DIR)/lib 238 | READLINE_INCLUDEDIR=\$(READLINE_DIR)/include 239 | 240 | NCURSES_LIBDIR=\$(NCURSES_DIR)/lib 241 | NCURSES_INCLUDEDIR=\$(NCURSES_DIR)/include 242 | 243 | LUA_VERSION=$LUA_VERSION 244 | 245 | PLATFORM_CFLAGS=-Wl,-E 246 | PLATFORM_LDFLAGS=-lm -ldl 247 | LIB_FLAG=-shared 248 | 249 | ifeq (\$(shell uname -m | sed 's/i.86/i386/'),i386) 250 | FPIC= 251 | else 252 | FPIC=-fpic 253 | endif 254 | 255 | LUA_LIB=\$(LUA_LIBDIR)/liblua\$(LUA_SUFFIX).a 256 | LUA_DEFPATH=-DLUA_ROOT=\\\\\\"\$(LUA_DIR)\\\\\\" 257 | ifeq (\$(USE_READLINE), yes) 258 | LUA_READLINE_CFLAGS=-DLUA_USE_READLINE -I\$(READLINE_INCLUDEDIR) 259 | LUA_READLINE_LIBS=-lreadline -lhistory -lncurses -L\$(READLINE_LIBDIR) -L\$(NCURSES_LIBDIR) 260 | else 261 | LUA_READLINE_CFLAGS= 262 | LUA_READLINE_LIBS= 263 | endif 264 | LUA_MYCFLAGS=-DLUA_USE_POSIX -DLUA_USE_DLOPEN \$(LUA_READLINE_CFLAGS) 265 | LUA_MYLIBS=\$(PLATFORM_CFLAGS) -ldl \$(LUA_READLINE_LIBS) 266 | 267 | WGET=wget -c -t0 268 | 269 | PLATFORM_BUILD=build 270 | 271 | ifeq (\$(shell bash -c 'echo ${OSTYPE%%[0-9]*}'),darwin) 272 | PLATFORM_BUILD=OSX-build 273 | ifneq (\$(LUA_READLINE_LIBS),) 274 | LUA_READLINE_LIBS=-lreadline -L\$(READLINE_LIBDIR) 275 | endif 276 | endif 277 | ifeq (\$(shell uname -s),FreeBSD) 278 | PLATFORM_BUILD=FreeBSD-build 279 | endif 280 | 281 | platform: \$(PLATFORM_BUILD) 282 | 283 | OSX-build: 284 | MACOSX_DEPLOYMENT_TARGET=10.3 \$(MAKE) \\ 285 | LUA_MYCFLAGS="-DLUA_USE_MACOSX \$(LUA_READLINE_CFLAGS)" \\ 286 | LUA_MYLIBS="\$(LUA_READLINE_LIBS)" \\ 287 | PLATFORM_CFLAGS="-dynamic" \\ 288 | PLATFORM_LDFLAGS="-lm -ldl" \\ 289 | LIB_FLAG="-bundle -undefined dynamic_lookup -all_load" \\ 290 | build 291 | 292 | FreeBSD-build: 293 | \$(MAKE) \\ 294 | LUA_MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" \\ 295 | LUA_MYLIBS="-Wl,-E" \\ 296 | PLATFORM_LDFLAGS="-lm" \\ 297 | build 298 | 299 | LUA_TESTFILE=lua-\$(LUA_VERSION)/src/lua\$(LUA_SUFFIX) 300 | 301 | fetch: lua-\$(LUA_VERSION) 302 | 303 | lua-\$(LUA_VERSION).tar.gz: 304 | \$(WGET) \$(LUA_URL)/\$@ 305 | 306 | lua-\$(LUA_VERSION): 307 | \$(MAKE) lua-\$(LUA_VERSION).tar.gz 308 | test -d \$@ || tar zxvpf lua-\$(LUA_VERSION).tar.gz 309 | cd lua-\$(LUA_VERSION) && patch -p1 < ../lua-\$(LUA_VERSION)-easylua.diff 310 | 311 | build: \$(LUA_TESTFILE) 312 | 313 | \$(LUA_TESTFILE): lua-\$(LUA_VERSION) 314 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 315 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 316 | INSTALL_INC="\$(LUA_INCDIR)" \\ 317 | MYCFLAGS="\$(LUA_DEFPATH) \$(LUA_MYCFLAGS)" \\ 318 | MYLIBS="\$(LUA_MYLIBS)" \\ 319 | CC="\$(CC)" \\ 320 | generic 321 | 322 | install: build 323 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 324 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 325 | INSTALL_INC="\$(LUA_INCDIR)" \\ 326 | INSTALL_TOP="\$(LUA_DIR)" \\ 327 | MYCFLAGS="\$(LUA_MYCFLAGS)" \\ 328 | MYLIBS="\$(LUA_MYLIBS)" \\ 329 | INSTALL_EXEC="install -p -m 0755" \\ 330 | INSTALL_DATA="install -p -m 0644" \\ 331 | STRIP="true" \\ 332 | install 333 | 334 | clean: 335 | if [ -d lua-\$(LUA_VERSION) ]; then \\ 336 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 337 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 338 | clean; \\ 339 | fi 340 | 341 | klean: 342 | rm -f lua-\$(LUA_VERSION).tar.gz 343 | rm -rf lua-\$(LUA_VERSION) 344 | rm -f Makefile 345 | rm -f lua-\$(LUA_VERSION)-easylua.diff 346 | 347 | EOF 348 | 349 | cat < lua-5.1.3-easylua.diff 350 | diff -Naur lua-5.1.3-orig/Makefile lua-5.1.3/Makefile 351 | --- lua-5.1.3-orig/Makefile 2007-03-25 11:44:39.000000000 -0300 352 | +++ lua-5.1.3/Makefile 2007-05-11 16:08:02.000000000 -0300 353 | @@ -41,10 +41,10 @@ 354 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 355 | 356 | # What to install. 357 | -TO_BIN= lua luac 358 | +TO_BIN= lua\$(LUA_SUFFIX) luac\$(LUA_SUFFIX) 359 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp 360 | -TO_LIB= liblua.a 361 | -TO_MAN= lua.1 luac.1 362 | +TO_LIB= liblua\$(LUA_SUFFIX).a 363 | +TO_MAN= lua\$(LUA_SUFFIX).1 luac\$(LUA_SUFFIX).1 364 | 365 | # Lua version and release. 366 | V= 5.1 367 | @@ -56,13 +56,17 @@ 368 | cd src && \$(MAKE) \$@ 369 | 370 | test: dummy 371 | - src/lua test/hello.lua 372 | + src/lua\$(LUA_SUFFIX) test/hello.lua 373 | 374 | install: dummy 375 | cd src && \$(MKDIR) -p \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 376 | cd src && \$(INSTALL_EXEC) \$(TO_BIN) \$(INSTALL_BIN) 377 | cd src && \$(INSTALL_DATA) \$(TO_INC) \$(INSTALL_INC) 378 | cd src && \$(INSTALL_DATA) \$(TO_LIB) \$(INSTALL_LIB) 379 | + cp doc/lua.1 doc/t_lua.1 380 | + cp doc/luac.1 doc/t_luac.1 381 | + mv doc/t_lua.1 doc/lua\$(LUA_SUFFIX).1 382 | + mv doc/t_luac.1 doc/luac\$(LUA_SUFFIX).1 383 | cd doc && \$(INSTALL_DATA) \$(TO_MAN) \$(INSTALL_MAN) 384 | # \$(RANLIB) \$(INSTALL_LIB)/\$(TO_LIB) 385 | 386 | diff -Naur lua-5.1.3-orig/src/luaconf.h lua-5.1.3/src/luaconf.h 387 | --- lua-5.1.3-orig/src/luaconf.h 2007-03-24 00:01:55.000000000 -0300 388 | +++ lua-5.1.3/src/luaconf.h 2007-05-11 16:12:55.000000000 -0300 389 | @@ -94,9 +94,11 @@ 390 | ".\\\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 391 | 392 | #else 393 | -#define LUA_ROOT "/usr/local/" 394 | -#define LUA_LDIR LUA_ROOT "share/lua/5.1/" 395 | -#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 396 | +#ifndef LUA_ROOT 397 | +#define LUA_ROOT "/usr/local" 398 | +#endif 399 | +#define LUA_LDIR LUA_ROOT "/share/lua/5.1/" 400 | +#define LUA_CDIR LUA_ROOT "/lib/lua/5.1/" 401 | #define LUA_PATH_DEFAULT \\ 402 | "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \\ 403 | LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" 404 | diff -Naur lua-5.1.3-orig/src/Makefile lua-5.1.3/src/Makefile 405 | --- lua-5.1.3-orig/src/Makefile 2007-03-25 11:49:23.000000000 -0300 406 | +++ lua-5.1.3/src/Makefile 2007-05-11 16:08:02.000000000 -0300 407 | @@ -22,17 +22,17 @@ 408 | 409 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 410 | 411 | -LUA_A= liblua.a 412 | +LUA_A= liblua\$(LUA_SUFFIX).a 413 | CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \\ 414 | lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \\ 415 | lundump.o lvm.o lzio.o 416 | LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \\ 417 | lstrlib.o loadlib.o linit.o 418 | 419 | -LUA_T= lua 420 | +LUA_T= lua\$(LUA_SUFFIX) 421 | LUA_O= lua.o 422 | 423 | -LUAC_T= luac 424 | +LUAC_T= luac\$(LUA_SUFFIX) 425 | LUAC_O= luac.o print.o 426 | 427 | ALL_O= \$(CORE_O) \$(LIB_O) \$(LUA_O) \$(LUAC_O) 428 | @@ -93,7 +93,7 @@ 429 | \$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline" 430 | 431 | generic: 432 | - \$(MAKE) all MYCFLAGS= 433 | + \$(MAKE) all 434 | 435 | linux: 436 | \$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" 437 | 438 | EOF 439 | 440 | echo 441 | echo 442 | echo "=========================================================" 443 | echo "Installing Lua $LUA_VERSION on $PREFIX" 444 | echo "=========================================================" 445 | echo 446 | echo 447 | 448 | if [ "`uname -s`" = "FreeBSD" ] 449 | then 450 | MAKE=gmake 451 | else 452 | MAKE=make 453 | fi 454 | 455 | $MAKE clean > /dev/null 2> /dev/null 456 | 457 | $MAKE 458 | 459 | $MAKE install 460 | 461 | echo 462 | echo "Done. Lua is installed on $PREFIX." 463 | echo 464 | 465 | echo 466 | echo 467 | echo "=========================================================" 468 | echo "Now installing LuaRocks $LUAROCKS_VERSION in $PREFIX." 469 | echo "=========================================================" 470 | echo 471 | echo 472 | 473 | wget -c -t0 $LUAROCKS_URL 474 | 475 | tar zxvf luarocks-$LUAROCKS_VERSION.tar.gz 476 | cd luarocks-$LUAROCKS_VERSION 477 | sh configure --prefix=$PREFIX --with-lua=$PREFIX \ 478 | --with-lua-include=$LUA_INCDIR \ 479 | --rocks-tree=$PREFIX && make && make install 480 | 481 | if ! [ $SKIP_KEPLER = "yes" ] 482 | then 483 | 484 | echo 485 | echo 486 | echo "=========================================================" 487 | echo "Now installing Kepler in $PREFIX." 488 | echo "=========================================================" 489 | echo 490 | echo 491 | 492 | $PREFIX/bin/luarocks install kepler-xavante $KEPLER_ROCK_VERSION && \ 493 | yes | $PREFIX/bin/setup-kepler --prefix=$PREFIX/kepler --conf=$PREFIX/etc --tmp=$TMP --web=$WEB 494 | fi 495 | 496 | echo 497 | echo "Cleaning up..." 498 | echo 499 | 500 | popd && rm -rf $TMP/kepler-$KEPLER_VERSION 501 | -------------------------------------------------------------------------------- /kepler-install-1.1.1-1: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kepler installation script. 4 | 5 | # Platform 6 | 7 | WGET="wget -c -t0" 8 | 9 | if [ "`echo ${OSTYPE%%[0-9]*}`" = "darwin" ] 10 | then 11 | WGET="curl -O --retry 10" 12 | fi 13 | 14 | # Defaults 15 | 16 | PREFIX="/usr/local" 17 | TMP="/tmp" 18 | LUA_SUFFIX="" 19 | BUILD_LUA="yes" 20 | INSTALL_LUA="yes" 21 | USE_READLINE="yes" 22 | NCURSES_DIR="/usr" 23 | READLINE_DIR="/usr" 24 | LUA_DIR="/usr" 25 | LUA_INCDIR="/usr/include" 26 | LUA_LIBDIR="/usr/lib" 27 | LUA_BINDIR="/usr/bin" 28 | 29 | UNAME="`uname`" 30 | 31 | if ! [ "$UNAME" = "Linux" -o "$UNAME" = "Darwin" -o "$UNAME" = "FreeBSD" ] 32 | then 33 | USE_READLINE=no 34 | fi 35 | 36 | LUA_VERSION=5.1.4 37 | KEPLER_VERSION=0.4 38 | LUAROCKS_URL=http://luaforge.net/frs/download.php/3981/luarocks-1.0.1.tar.gz 39 | LUAROCKS_VERSION=1.0.1 40 | KEPLER_ROCK_VERSION=1.1.1 41 | SKIP_KEPLER=no 42 | 43 | # Help 44 | 45 | show_help() { 46 | cat < Makefile 236 | # This file was automatically generated by the configure script. 237 | # Run "./configure --help" for details. 238 | BUILD_LUA=$BUILD_LUA 239 | INSTALL_LUA=$INSTALL_LUA 240 | USE_READLINE=$USE_READLINE 241 | 242 | PREFIX=$PREFIX 243 | INCLUDEDIR=$INCLUDEDIR 244 | LUA_SUFFIX=$LUA_SUFFIX 245 | 246 | READLINE_DIR=$READLINE_DIR 247 | NCURSES_DIR=$NCURSES_DIR 248 | 249 | LUA_DIR=$LUA_DIR 250 | LUA_INCDIR=$LUA_INCDIR 251 | LUA_LIBDIR=$LUA_LIBDIR 252 | LUA_BINDIR=$LUA_BINDIR 253 | 254 | LUA_URL=http://www.lua.org/ftp 255 | 256 | READLINE_LIBDIR=\$(READLINE_DIR)/lib 257 | READLINE_INCLUDEDIR=\$(READLINE_DIR)/include 258 | 259 | NCURSES_LIBDIR=\$(NCURSES_DIR)/lib 260 | NCURSES_INCLUDEDIR=\$(NCURSES_DIR)/include 261 | 262 | LUA_VERSION=$LUA_VERSION 263 | 264 | PLATFORM_CFLAGS=-Wl,-E 265 | PLATFORM_LDFLAGS=-lm -ldl 266 | LIB_FLAG=-shared 267 | 268 | ifeq (\$(shell uname -m | sed 's/i.86/i386/'),i386) 269 | FPIC= 270 | else 271 | FPIC=-fpic 272 | endif 273 | 274 | LUA_LIB=\$(LUA_LIBDIR)/liblua\$(LUA_SUFFIX).a 275 | LUA_DEFPATH=-DLUA_ROOT=\\\\\\"\$(LUA_DIR)\\\\\\" 276 | ifeq (\$(USE_READLINE), yes) 277 | LUA_READLINE_CFLAGS=-DLUA_USE_READLINE -I\$(READLINE_INCLUDEDIR) 278 | LUA_READLINE_LIBS=-lreadline -lhistory -lncurses -L\$(READLINE_LIBDIR) -L\$(NCURSES_LIBDIR) 279 | else 280 | LUA_READLINE_CFLAGS= 281 | LUA_READLINE_LIBS= 282 | endif 283 | LUA_MYCFLAGS=-DLUA_USE_POSIX -DLUA_USE_DLOPEN \$(LUA_READLINE_CFLAGS) 284 | LUA_MYLIBS=\$(PLATFORM_CFLAGS) -ldl \$(LUA_READLINE_LIBS) 285 | 286 | WGET=wget -c -t0 287 | 288 | PLATFORM_BUILD=build 289 | 290 | ifeq (\$(shell bash -c 'echo ${OSTYPE%%[0-9]*}'),darwin) 291 | WGET=curl -O --retry 10 292 | PLATFORM_BUILD=OSX-build 293 | ifneq (\$(LUA_READLINE_LIBS),) 294 | LUA_READLINE_LIBS=-lreadline -L\$(READLINE_LIBDIR) 295 | endif 296 | endif 297 | ifeq (\$(shell uname -s),FreeBSD) 298 | PLATFORM_BUILD=FreeBSD-build 299 | endif 300 | 301 | platform: \$(PLATFORM_BUILD) 302 | 303 | OSX-build: 304 | MACOSX_DEPLOYMENT_TARGET=10.3 \$(MAKE) \\ 305 | LUA_MYCFLAGS="-DLUA_USE_MACOSX \$(LUA_READLINE_CFLAGS)" \\ 306 | LUA_MYLIBS="\$(LUA_READLINE_LIBS)" \\ 307 | PLATFORM_CFLAGS="-dynamic" \\ 308 | PLATFORM_LDFLAGS="-lm -ldl" \\ 309 | LIB_FLAG="-bundle -undefined dynamic_lookup -all_load" \\ 310 | build 311 | 312 | FreeBSD-build: 313 | \$(MAKE) \\ 314 | LUA_MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" \\ 315 | LUA_MYLIBS="-Wl,-E" \\ 316 | PLATFORM_LDFLAGS="-lm" \\ 317 | build 318 | 319 | LUA_TESTFILE=lua-\$(LUA_VERSION)/src/lua\$(LUA_SUFFIX) 320 | 321 | fetch: lua-\$(LUA_VERSION) 322 | 323 | lua-\$(LUA_VERSION).tar.gz: 324 | \$(WGET) \$(LUA_URL)/\$@ 325 | 326 | lua-\$(LUA_VERSION): 327 | \$(MAKE) lua-\$(LUA_VERSION).tar.gz 328 | test -d \$@ || tar zxvpf lua-\$(LUA_VERSION).tar.gz 329 | cd lua-\$(LUA_VERSION) && patch -p1 < ../lua-\$(LUA_VERSION)-easylua.diff 330 | 331 | build: \$(LUA_TESTFILE) 332 | 333 | \$(LUA_TESTFILE): lua-\$(LUA_VERSION) 334 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 335 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 336 | INSTALL_INC="\$(LUA_INCDIR)" \\ 337 | MYCFLAGS="\$(LUA_DEFPATH) \$(LUA_MYCFLAGS)" \\ 338 | MYLIBS="\$(LUA_MYLIBS)" \\ 339 | CC="\$(CC)" \\ 340 | generic 341 | 342 | install: build 343 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 344 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 345 | INSTALL_INC="\$(LUA_INCDIR)" \\ 346 | INSTALL_TOP="\$(LUA_DIR)" \\ 347 | MYCFLAGS="\$(LUA_MYCFLAGS)" \\ 348 | MYLIBS="\$(LUA_MYLIBS)" \\ 349 | INSTALL_EXEC="install -p -m 0755" \\ 350 | INSTALL_DATA="install -p -m 0644" \\ 351 | STRIP="true" \\ 352 | install 353 | 354 | clean: 355 | if [ -d lua-\$(LUA_VERSION) ]; then \\ 356 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 357 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 358 | clean; \\ 359 | fi 360 | 361 | klean: 362 | rm -f lua-\$(LUA_VERSION).tar.gz 363 | rm -rf lua-\$(LUA_VERSION) 364 | rm -f Makefile 365 | rm -f lua-\$(LUA_VERSION)-easylua.diff 366 | 367 | EOF 368 | 369 | cat < lua-5.1.4-easylua.diff 370 | diff -Naur lua-5.1.4-orig/Makefile lua-5.1.4/Makefile 371 | --- lua-5.1.4-orig/Makefile 2007-03-25 11:44:39.000000000 -0300 372 | +++ lua-5.1.4/Makefile 2007-05-11 16:08:02.000000000 -0300 373 | @@ -41,10 +41,10 @@ 374 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 375 | 376 | # What to install. 377 | -TO_BIN= lua luac 378 | +TO_BIN= lua\$(LUA_SUFFIX) luac\$(LUA_SUFFIX) 379 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp 380 | -TO_LIB= liblua.a 381 | -TO_MAN= lua.1 luac.1 382 | +TO_LIB= liblua\$(LUA_SUFFIX).a 383 | +TO_MAN= lua\$(LUA_SUFFIX).1 luac\$(LUA_SUFFIX).1 384 | 385 | # Lua version and release. 386 | V= 5.1 387 | @@ -56,11 +56,15 @@ 388 | cd src && \$(MAKE) \$@ 389 | 390 | test: dummy 391 | - src/lua test/hello.lua 392 | + src/lua\$(LUA_SUFFIX) test/hello.lua 393 | 394 | install: dummy 395 | - cd src && \$(MKDIR) \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 396 | + cd src && \$(MKDIR) -p \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 397 | cd src && \$(INSTALL_EXEC) \$(TO_BIN) \$(INSTALL_BIN) 398 | cd src && \$(INSTALL_DATA) \$(TO_INC) \$(INSTALL_INC) 399 | cd src && \$(INSTALL_DATA) \$(TO_LIB) \$(INSTALL_LIB) 400 | + cp doc/lua.1 doc/t_lua.1 401 | + cp doc/luac.1 doc/t_luac.1 402 | + mv doc/t_lua.1 doc/lua\$(LUA_SUFFIX).1 403 | + mv doc/t_luac.1 doc/luac\$(LUA_SUFFIX).1 404 | cd doc && \$(INSTALL_DATA) \$(TO_MAN) \$(INSTALL_MAN) 405 | diff -Naur lua-5.1.4-orig/src/luaconf.h lua-5.1.4/src/luaconf.h 406 | --- lua-5.1.4-orig/src/luaconf.h 2007-03-24 00:01:55.000000000 -0300 407 | +++ lua-5.1.4/src/luaconf.h 2007-05-11 16:12:55.000000000 -0300 408 | @@ -94,9 +94,11 @@ 409 | ".\\\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 410 | 411 | #else 412 | -#define LUA_ROOT "/usr/local/" 413 | -#define LUA_LDIR LUA_ROOT "share/lua/5.1/" 414 | -#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 415 | +#ifndef LUA_ROOT 416 | +#define LUA_ROOT "/usr/local" 417 | +#endif 418 | +#define LUA_LDIR LUA_ROOT "/share/lua/5.1/" 419 | +#define LUA_CDIR LUA_ROOT "/lib/lua/5.1/" 420 | #define LUA_PATH_DEFAULT \\ 421 | "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \\ 422 | LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" 423 | diff -Naur lua-5.1.4-orig/src/Makefile lua-5.1.4/src/Makefile 424 | --- lua-5.1.4-orig/src/Makefile 2007-03-25 11:49:23.000000000 -0300 425 | +++ lua-5.1.4/src/Makefile 2007-05-11 16:08:02.000000000 -0300 426 | @@ -22,17 +22,17 @@ 427 | 428 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 429 | 430 | -LUA_A= liblua.a 431 | +LUA_A= liblua\$(LUA_SUFFIX).a 432 | CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \\ 433 | lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \\ 434 | lundump.o lvm.o lzio.o 435 | LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \\ 436 | lstrlib.o loadlib.o linit.o 437 | 438 | -LUA_T= lua 439 | +LUA_T= lua\$(LUA_SUFFIX) 440 | LUA_O= lua.o 441 | 442 | -LUAC_T= luac 443 | +LUAC_T= luac\$(LUA_SUFFIX) 444 | LUAC_O= luac.o print.o 445 | 446 | ALL_O= \$(CORE_O) \$(LIB_O) \$(LUA_O) \$(LUAC_O) 447 | @@ -93,7 +93,7 @@ 448 | \$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline" 449 | 450 | generic: 451 | - \$(MAKE) all MYCFLAGS= 452 | + \$(MAKE) all 453 | 454 | linux: 455 | \$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" 456 | 457 | EOF 458 | 459 | echo 460 | echo 461 | echo "=========================================================" 462 | echo "Installing Lua $LUA_VERSION on $PREFIX" 463 | echo "=========================================================" 464 | echo 465 | echo 466 | 467 | if [ "`uname -s`" = "FreeBSD" ] 468 | then 469 | MAKE=gmake 470 | else 471 | MAKE=make 472 | fi 473 | 474 | $MAKE clean > /dev/null 2> /dev/null 475 | 476 | $MAKE 477 | 478 | $MAKE install 479 | 480 | echo 481 | echo "Done. Lua is installed on $PREFIX." 482 | echo 483 | 484 | echo 485 | echo 486 | echo "=========================================================" 487 | echo "Now installing LuaRocks $LUAROCKS_VERSION in $PREFIX." 488 | echo "=========================================================" 489 | echo 490 | echo 491 | 492 | if [ $LUAROCKS_URL != "" ] 493 | then 494 | 495 | if [ ! -f luarocks-$LUAROCKS_VERSION.tar.gz ]; then 496 | $WGET $LUAROCKS_URL 497 | fi 498 | 499 | tar zxvf luarocks-$LUAROCKS_VERSION.tar.gz 500 | cd luarocks-$LUAROCKS_VERSION 501 | 502 | else 503 | 504 | cvs -d:pserver:anonymous@cvs.luaforge.net:/cvsroot/luarocks export -r HEAD luarocks 505 | cd luarocks 506 | 507 | fi 508 | 509 | sh configure --prefix=$PREFIX --with-lua=$PREFIX \ 510 | --with-lua-include=$LUA_INCDIR \ 511 | --rocks-tree=$PREFIX && make && make install 512 | 513 | cd .. 514 | 515 | if ! [ $SKIP_KEPLER = "yes" ] 516 | then 517 | 518 | echo 519 | echo 520 | echo "=========================================================" 521 | echo "Now installing Kepler in $PREFIX." 522 | echo "=========================================================" 523 | echo 524 | 525 | if [ -d rocks ]; then 526 | $PREFIX/bin/luarocks install kepler-xavante --only-from=./rocks $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 527 | else 528 | if [ "$KEPLER_ROCK_VERSION" = "cvs" ] 529 | then 530 | $PREFIX/bin/luarocks install --from=http://luarocks.luaforge.net/rocks-cvs kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 531 | else 532 | $PREFIX/bin/luarocks install kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 533 | fi 534 | fi 535 | 536 | fi 537 | 538 | echo 539 | echo "Cleaning up..." 540 | echo 541 | 542 | if [ -d $TMP/kepler-$KEPLER_VERSION ]; then 543 | popd && rm -rf $TMP/kepler-$KEPLER_VERSION 544 | fi 545 | -------------------------------------------------------------------------------- /kepler-install-1.1.1-2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kepler installation script. 4 | 5 | # Platform 6 | 7 | pushd `dirname $0` 8 | 9 | WGET="wget -c -t0" 10 | 11 | if [ "`echo ${OSTYPE%%[0-9]*}`" = "darwin" ] 12 | then 13 | WGET="curl -O --retry 10" 14 | fi 15 | 16 | # Defaults 17 | 18 | PREFIX="/usr/local" 19 | TMP="/tmp" 20 | LUA_SUFFIX="" 21 | BUILD_LUA="yes" 22 | INSTALL_LUA="yes" 23 | USE_READLINE="yes" 24 | NCURSES_DIR="/usr" 25 | READLINE_DIR="/usr" 26 | LUA_DIR="/usr" 27 | LUA_INCDIR="/usr/include" 28 | LUA_LIBDIR="/usr/lib" 29 | LUA_BINDIR="/usr/bin" 30 | 31 | UNAME="`uname`" 32 | 33 | if ! [ "$UNAME" = "Linux" -o "$UNAME" = "Darwin" -o "$UNAME" = "FreeBSD" ] 34 | then 35 | USE_READLINE=no 36 | fi 37 | 38 | LUA_VERSION=5.1.4 39 | KEPLER_VERSION=0.4 40 | LUAROCKS_URL=http://luaforge.net/frs/download.php/3981/luarocks-1.0.1.tar.gz 41 | LUAROCKS_VERSION=1.0.1 42 | KEPLER_ROCK_VERSION=1.1.1 43 | SKIP_KEPLER=no 44 | 45 | # Help 46 | 47 | show_help() { 48 | cat < Makefile 238 | # This file was automatically generated by the configure script. 239 | # Run "./configure --help" for details. 240 | BUILD_LUA=$BUILD_LUA 241 | INSTALL_LUA=$INSTALL_LUA 242 | USE_READLINE=$USE_READLINE 243 | 244 | PREFIX=$PREFIX 245 | INCLUDEDIR=$INCLUDEDIR 246 | LUA_SUFFIX=$LUA_SUFFIX 247 | 248 | READLINE_DIR=$READLINE_DIR 249 | NCURSES_DIR=$NCURSES_DIR 250 | 251 | LUA_DIR=$LUA_DIR 252 | LUA_INCDIR=$LUA_INCDIR 253 | LUA_LIBDIR=$LUA_LIBDIR 254 | LUA_BINDIR=$LUA_BINDIR 255 | 256 | LUA_URL=http://www.lua.org/ftp 257 | 258 | READLINE_LIBDIR=\$(READLINE_DIR)/lib 259 | READLINE_INCLUDEDIR=\$(READLINE_DIR)/include 260 | 261 | NCURSES_LIBDIR=\$(NCURSES_DIR)/lib 262 | NCURSES_INCLUDEDIR=\$(NCURSES_DIR)/include 263 | 264 | LUA_VERSION=$LUA_VERSION 265 | 266 | PLATFORM_CFLAGS=-Wl,-E 267 | PLATFORM_LDFLAGS=-lm -ldl 268 | LIB_FLAG=-shared 269 | 270 | ifeq (\$(shell uname -m | sed 's/i.86/i386/'),i386) 271 | FPIC= 272 | else 273 | FPIC=-fpic 274 | endif 275 | 276 | LUA_LIB=\$(LUA_LIBDIR)/liblua\$(LUA_SUFFIX).a 277 | LUA_DEFPATH=-DLUA_ROOT=\\\\\\"\$(LUA_DIR)\\\\\\" 278 | ifeq (\$(USE_READLINE), yes) 279 | LUA_READLINE_CFLAGS=-DLUA_USE_READLINE -I\$(READLINE_INCLUDEDIR) 280 | LUA_READLINE_LIBS=-lreadline -lhistory -lncurses -L\$(READLINE_LIBDIR) -L\$(NCURSES_LIBDIR) 281 | else 282 | LUA_READLINE_CFLAGS= 283 | LUA_READLINE_LIBS= 284 | endif 285 | LUA_MYCFLAGS=-DLUA_USE_POSIX -DLUA_USE_DLOPEN \$(LUA_READLINE_CFLAGS) 286 | LUA_MYLIBS=\$(PLATFORM_CFLAGS) -ldl \$(LUA_READLINE_LIBS) 287 | 288 | WGET=wget -c -t0 289 | 290 | PLATFORM_BUILD=build 291 | 292 | ifeq (\$(shell bash -c 'echo ${OSTYPE%%[0-9]*}'),darwin) 293 | WGET=curl -O --retry 10 294 | PLATFORM_BUILD=OSX-build 295 | ifneq (\$(LUA_READLINE_LIBS),) 296 | LUA_READLINE_LIBS=-lreadline -L\$(READLINE_LIBDIR) 297 | endif 298 | endif 299 | ifeq (\$(shell uname -s),FreeBSD) 300 | PLATFORM_BUILD=FreeBSD-build 301 | endif 302 | 303 | platform: \$(PLATFORM_BUILD) 304 | 305 | OSX-build: 306 | MACOSX_DEPLOYMENT_TARGET=10.3 \$(MAKE) \\ 307 | LUA_MYCFLAGS="-DLUA_USE_MACOSX \$(LUA_READLINE_CFLAGS)" \\ 308 | LUA_MYLIBS="\$(LUA_READLINE_LIBS)" \\ 309 | PLATFORM_CFLAGS="-dynamic" \\ 310 | PLATFORM_LDFLAGS="-lm -ldl" \\ 311 | LIB_FLAG="-bundle -undefined dynamic_lookup -all_load" \\ 312 | build 313 | 314 | FreeBSD-build: 315 | \$(MAKE) \\ 316 | LUA_MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" \\ 317 | LUA_MYLIBS="-Wl,-E" \\ 318 | PLATFORM_LDFLAGS="-lm" \\ 319 | build 320 | 321 | LUA_TESTFILE=lua-\$(LUA_VERSION)/src/lua\$(LUA_SUFFIX) 322 | 323 | fetch: lua-\$(LUA_VERSION) 324 | 325 | lua-\$(LUA_VERSION).tar.gz: 326 | \$(WGET) \$(LUA_URL)/\$@ 327 | 328 | lua-\$(LUA_VERSION): 329 | \$(MAKE) lua-\$(LUA_VERSION).tar.gz 330 | test -d \$@ || tar zxvpf lua-\$(LUA_VERSION).tar.gz 331 | cd lua-\$(LUA_VERSION) && patch -p1 < ../lua-\$(LUA_VERSION)-easylua.diff 332 | 333 | build: \$(LUA_TESTFILE) 334 | 335 | \$(LUA_TESTFILE): lua-\$(LUA_VERSION) 336 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 337 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 338 | INSTALL_INC="\$(LUA_INCDIR)" \\ 339 | MYCFLAGS="\$(LUA_DEFPATH) \$(LUA_MYCFLAGS)" \\ 340 | MYLIBS="\$(LUA_MYLIBS)" \\ 341 | CC="\$(CC)" \\ 342 | generic 343 | 344 | install: build 345 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 346 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 347 | INSTALL_INC="\$(LUA_INCDIR)" \\ 348 | INSTALL_TOP="\$(LUA_DIR)" \\ 349 | MYCFLAGS="\$(LUA_MYCFLAGS)" \\ 350 | MYLIBS="\$(LUA_MYLIBS)" \\ 351 | INSTALL_EXEC="install -p -m 0755" \\ 352 | INSTALL_DATA="install -p -m 0644" \\ 353 | STRIP="true" \\ 354 | install 355 | 356 | clean: 357 | if [ -d lua-\$(LUA_VERSION) ]; then \\ 358 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 359 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 360 | clean; \\ 361 | fi 362 | 363 | klean: 364 | rm -f lua-\$(LUA_VERSION).tar.gz 365 | rm -rf lua-\$(LUA_VERSION) 366 | rm -f Makefile 367 | rm -f lua-\$(LUA_VERSION)-easylua.diff 368 | 369 | EOF 370 | 371 | cat < lua-5.1.4-easylua.diff 372 | diff -Naur lua-5.1.4-orig/Makefile lua-5.1.4/Makefile 373 | --- lua-5.1.4-orig/Makefile 2007-03-25 11:44:39.000000000 -0300 374 | +++ lua-5.1.4/Makefile 2007-05-11 16:08:02.000000000 -0300 375 | @@ -41,10 +41,10 @@ 376 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 377 | 378 | # What to install. 379 | -TO_BIN= lua luac 380 | +TO_BIN= lua\$(LUA_SUFFIX) luac\$(LUA_SUFFIX) 381 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp 382 | -TO_LIB= liblua.a 383 | -TO_MAN= lua.1 luac.1 384 | +TO_LIB= liblua\$(LUA_SUFFIX).a 385 | +TO_MAN= lua\$(LUA_SUFFIX).1 luac\$(LUA_SUFFIX).1 386 | 387 | # Lua version and release. 388 | V= 5.1 389 | @@ -56,11 +56,15 @@ 390 | cd src && \$(MAKE) \$@ 391 | 392 | test: dummy 393 | - src/lua test/hello.lua 394 | + src/lua\$(LUA_SUFFIX) test/hello.lua 395 | 396 | install: dummy 397 | - cd src && \$(MKDIR) \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 398 | + cd src && \$(MKDIR) -p \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 399 | cd src && \$(INSTALL_EXEC) \$(TO_BIN) \$(INSTALL_BIN) 400 | cd src && \$(INSTALL_DATA) \$(TO_INC) \$(INSTALL_INC) 401 | cd src && \$(INSTALL_DATA) \$(TO_LIB) \$(INSTALL_LIB) 402 | + cp doc/lua.1 doc/t_lua.1 403 | + cp doc/luac.1 doc/t_luac.1 404 | + mv doc/t_lua.1 doc/lua\$(LUA_SUFFIX).1 405 | + mv doc/t_luac.1 doc/luac\$(LUA_SUFFIX).1 406 | cd doc && \$(INSTALL_DATA) \$(TO_MAN) \$(INSTALL_MAN) 407 | diff -Naur lua-5.1.4-orig/src/luaconf.h lua-5.1.4/src/luaconf.h 408 | --- lua-5.1.4-orig/src/luaconf.h 2007-03-24 00:01:55.000000000 -0300 409 | +++ lua-5.1.4/src/luaconf.h 2007-05-11 16:12:55.000000000 -0300 410 | @@ -94,9 +94,11 @@ 411 | ".\\\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 412 | 413 | #else 414 | -#define LUA_ROOT "/usr/local/" 415 | -#define LUA_LDIR LUA_ROOT "share/lua/5.1/" 416 | -#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 417 | +#ifndef LUA_ROOT 418 | +#define LUA_ROOT "/usr/local" 419 | +#endif 420 | +#define LUA_LDIR LUA_ROOT "/share/lua/5.1/" 421 | +#define LUA_CDIR LUA_ROOT "/lib/lua/5.1/" 422 | #define LUA_PATH_DEFAULT \\ 423 | "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \\ 424 | LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" 425 | diff -Naur lua-5.1.4-orig/src/Makefile lua-5.1.4/src/Makefile 426 | --- lua-5.1.4-orig/src/Makefile 2007-03-25 11:49:23.000000000 -0300 427 | +++ lua-5.1.4/src/Makefile 2007-05-11 16:08:02.000000000 -0300 428 | @@ -22,17 +22,17 @@ 429 | 430 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 431 | 432 | -LUA_A= liblua.a 433 | +LUA_A= liblua\$(LUA_SUFFIX).a 434 | CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \\ 435 | lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \\ 436 | lundump.o lvm.o lzio.o 437 | LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \\ 438 | lstrlib.o loadlib.o linit.o 439 | 440 | -LUA_T= lua 441 | +LUA_T= lua\$(LUA_SUFFIX) 442 | LUA_O= lua.o 443 | 444 | -LUAC_T= luac 445 | +LUAC_T= luac\$(LUA_SUFFIX) 446 | LUAC_O= luac.o print.o 447 | 448 | ALL_O= \$(CORE_O) \$(LIB_O) \$(LUA_O) \$(LUAC_O) 449 | @@ -93,7 +93,7 @@ 450 | \$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline" 451 | 452 | generic: 453 | - \$(MAKE) all MYCFLAGS= 454 | + \$(MAKE) all 455 | 456 | linux: 457 | \$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" 458 | 459 | EOF 460 | 461 | echo 462 | echo 463 | echo "=========================================================" 464 | echo "Installing Lua $LUA_VERSION on $PREFIX" 465 | echo "=========================================================" 466 | echo 467 | echo 468 | 469 | if [ "`uname -s`" = "FreeBSD" ] 470 | then 471 | MAKE=gmake 472 | else 473 | MAKE=make 474 | fi 475 | 476 | $MAKE clean > /dev/null 2> /dev/null 477 | 478 | $MAKE 479 | 480 | $MAKE install 481 | 482 | echo 483 | echo "Done. Lua is installed on $PREFIX." 484 | echo 485 | 486 | echo 487 | echo 488 | echo "=========================================================" 489 | echo "Now installing LuaRocks $LUAROCKS_VERSION in $PREFIX." 490 | echo "=========================================================" 491 | echo 492 | echo 493 | 494 | if [ $LUAROCKS_URL != "" ] 495 | then 496 | 497 | if [ ! -f luarocks-$LUAROCKS_VERSION.tar.gz ]; then 498 | $WGET $LUAROCKS_URL 499 | fi 500 | 501 | tar zxvf luarocks-$LUAROCKS_VERSION.tar.gz 502 | cd luarocks-$LUAROCKS_VERSION 503 | 504 | else 505 | 506 | cvs -d:pserver:anonymous@cvs.luaforge.net:/cvsroot/luarocks export -r HEAD luarocks 507 | cd luarocks 508 | 509 | fi 510 | 511 | sh configure --prefix=$PREFIX --with-lua=$PREFIX \ 512 | --with-lua-include=$LUA_INCDIR \ 513 | --rocks-tree=$PREFIX && make && make install 514 | 515 | cd .. 516 | 517 | if ! [ $SKIP_KEPLER = "yes" ] 518 | then 519 | 520 | echo 521 | echo 522 | echo "=========================================================" 523 | echo "Now installing Kepler in $PREFIX." 524 | echo "=========================================================" 525 | echo 526 | 527 | if [ -d rocks ]; then 528 | $PREFIX/bin/luarocks install kepler-xavante --only-from=`pwd`/rocks $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 529 | else 530 | if [ "$KEPLER_ROCK_VERSION" = "cvs" ] 531 | then 532 | $PREFIX/bin/luarocks install --from=http://luarocks.luaforge.net/rocks-cvs kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 533 | else 534 | $PREFIX/bin/luarocks install kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 535 | fi 536 | fi 537 | 538 | fi 539 | 540 | echo 541 | echo "Cleaning up..." 542 | echo 543 | 544 | if [ -d $TMP/kepler-$KEPLER_VERSION ]; then 545 | popd && rm -rf $TMP/kepler-$KEPLER_VERSION 546 | fi 547 | -------------------------------------------------------------------------------- /kepler-install-cvs-1: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kepler installation script. 4 | 5 | # Platform 6 | 7 | pushd `dirname $0` 8 | 9 | WGET="wget -c -t0" 10 | 11 | if [ "`echo ${OSTYPE%%[0-9]*}`" = "darwin" ] 12 | then 13 | WGET="curl -O --retry 10" 14 | fi 15 | 16 | # Defaults 17 | 18 | PREFIX="/usr/local" 19 | TMP="/tmp" 20 | LUA_SUFFIX="" 21 | BUILD_LUA="yes" 22 | INSTALL_LUA="yes" 23 | USE_READLINE="yes" 24 | NCURSES_DIR="/usr" 25 | READLINE_DIR="/usr" 26 | LUA_DIR="/usr" 27 | LUA_INCDIR="/usr/include" 28 | LUA_LIBDIR="/usr/lib" 29 | LUA_BINDIR="/usr/bin" 30 | 31 | UNAME="`uname`" 32 | 33 | if ! [ "$UNAME" = "Linux" -o "$UNAME" = "Darwin" -o "$UNAME" = "FreeBSD" ] 34 | then 35 | USE_READLINE=no 36 | fi 37 | 38 | LUA_VERSION=5.1.4 39 | KEPLER_VERSION=0.5 40 | LUAROCKS_URL=http://luaforge.net/frs/download.php/3981/luarocks-1.0.1.tar.gz 41 | LUAROCKS_VERSION=1.0.1 42 | KEPLER_ROCK_VERSION=cvs 43 | SKIP_KEPLER=no 44 | SKIP_LR=no 45 | 46 | # Help 47 | 48 | show_help() { 49 | cat < Makefile 244 | # This file was automatically generated by the configure script. 245 | # Run "./configure --help" for details. 246 | BUILD_LUA=$BUILD_LUA 247 | INSTALL_LUA=$INSTALL_LUA 248 | USE_READLINE=$USE_READLINE 249 | 250 | PREFIX=$PREFIX 251 | INCLUDEDIR=$INCLUDEDIR 252 | LUA_SUFFIX=$LUA_SUFFIX 253 | 254 | READLINE_DIR=$READLINE_DIR 255 | NCURSES_DIR=$NCURSES_DIR 256 | 257 | LUA_DIR=$LUA_DIR 258 | LUA_INCDIR=$LUA_INCDIR 259 | LUA_LIBDIR=$LUA_LIBDIR 260 | LUA_BINDIR=$LUA_BINDIR 261 | 262 | LUA_URL=http://www.lua.org/ftp 263 | 264 | READLINE_LIBDIR=\$(READLINE_DIR)/lib 265 | READLINE_INCLUDEDIR=\$(READLINE_DIR)/include 266 | 267 | NCURSES_LIBDIR=\$(NCURSES_DIR)/lib 268 | NCURSES_INCLUDEDIR=\$(NCURSES_DIR)/include 269 | 270 | LUA_VERSION=$LUA_VERSION 271 | 272 | PLATFORM_CFLAGS=-Wl,-E 273 | PLATFORM_LDFLAGS=-lm -ldl 274 | LIB_FLAG=-shared 275 | 276 | ifeq (\$(shell uname -m | sed 's/i.86/i386/'),i386) 277 | FPIC= 278 | else 279 | FPIC=-fpic 280 | endif 281 | 282 | LUA_LIB=\$(LUA_LIBDIR)/liblua\$(LUA_SUFFIX).a 283 | LUA_DEFPATH=-DLUA_ROOT=\\\\\\"\$(LUA_DIR)\\\\\\" 284 | ifeq (\$(USE_READLINE), yes) 285 | LUA_READLINE_CFLAGS=-DLUA_USE_READLINE -I\$(READLINE_INCLUDEDIR) 286 | LUA_READLINE_LIBS=-lreadline -lhistory -lncurses -L\$(READLINE_LIBDIR) -L\$(NCURSES_LIBDIR) 287 | else 288 | LUA_READLINE_CFLAGS= 289 | LUA_READLINE_LIBS= 290 | endif 291 | LUA_MYCFLAGS=-DLUA_USE_POSIX -DLUA_USE_DLOPEN \$(LUA_READLINE_CFLAGS) 292 | LUA_MYLIBS=\$(PLATFORM_CFLAGS) -ldl \$(LUA_READLINE_LIBS) 293 | 294 | WGET=wget -c -t0 295 | 296 | PLATFORM_BUILD=build 297 | 298 | ifeq (\$(shell bash -c 'echo ${OSTYPE%%[0-9]*}'),darwin) 299 | WGET=curl -O --retry 10 300 | PLATFORM_BUILD=OSX-build 301 | ifneq (\$(LUA_READLINE_LIBS),) 302 | LUA_READLINE_LIBS=-lreadline -L\$(READLINE_LIBDIR) 303 | endif 304 | endif 305 | ifeq (\$(shell uname -s),FreeBSD) 306 | PLATFORM_BUILD=FreeBSD-build 307 | endif 308 | 309 | platform: \$(PLATFORM_BUILD) 310 | 311 | OSX-build: 312 | MACOSX_DEPLOYMENT_TARGET=10.3 \$(MAKE) \\ 313 | LUA_MYCFLAGS="-DLUA_USE_MACOSX \$(LUA_READLINE_CFLAGS)" \\ 314 | LUA_MYLIBS="\$(LUA_READLINE_LIBS)" \\ 315 | PLATFORM_CFLAGS="-dynamic" \\ 316 | PLATFORM_LDFLAGS="-lm -ldl" \\ 317 | LIB_FLAG="-bundle -undefined dynamic_lookup -all_load" \\ 318 | build 319 | 320 | FreeBSD-build: 321 | \$(MAKE) \\ 322 | LUA_MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" \\ 323 | LUA_MYLIBS="-Wl,-E" \\ 324 | PLATFORM_LDFLAGS="-lm" \\ 325 | build 326 | 327 | LUA_TESTFILE=lua-\$(LUA_VERSION)/src/lua\$(LUA_SUFFIX) 328 | 329 | fetch: lua-\$(LUA_VERSION) 330 | 331 | lua-\$(LUA_VERSION).tar.gz: 332 | \$(WGET) \$(LUA_URL)/\$@ 333 | 334 | lua-\$(LUA_VERSION): 335 | \$(MAKE) lua-\$(LUA_VERSION).tar.gz 336 | test -d \$@ || tar zxvpf lua-\$(LUA_VERSION).tar.gz 337 | cd lua-\$(LUA_VERSION) && patch -p1 < ../lua-\$(LUA_VERSION)-easylua.diff 338 | 339 | build: \$(LUA_TESTFILE) 340 | 341 | \$(LUA_TESTFILE): lua-\$(LUA_VERSION) 342 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 343 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 344 | INSTALL_INC="\$(LUA_INCDIR)" \\ 345 | MYCFLAGS="\$(LUA_DEFPATH) \$(LUA_MYCFLAGS)" \\ 346 | MYLIBS="\$(LUA_MYLIBS)" \\ 347 | CC="\$(CC)" \\ 348 | generic 349 | 350 | install: build 351 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 352 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 353 | INSTALL_INC="\$(LUA_INCDIR)" \\ 354 | INSTALL_TOP="\$(LUA_DIR)" \\ 355 | MYCFLAGS="\$(LUA_MYCFLAGS)" \\ 356 | MYLIBS="\$(LUA_MYLIBS)" \\ 357 | INSTALL_EXEC="install -p -m 0755" \\ 358 | INSTALL_DATA="install -p -m 0644" \\ 359 | STRIP="true" \\ 360 | install 361 | 362 | clean: 363 | if [ -d lua-\$(LUA_VERSION) ]; then \\ 364 | cd lua-\$(LUA_VERSION) && \$(MAKE) \\ 365 | LUA_SUFFIX="\$(LUA_SUFFIX)" \\ 366 | clean; \\ 367 | fi 368 | 369 | klean: 370 | rm -f lua-\$(LUA_VERSION).tar.gz 371 | rm -rf lua-\$(LUA_VERSION) 372 | rm -f Makefile 373 | rm -f lua-\$(LUA_VERSION)-easylua.diff 374 | 375 | EOF 376 | 377 | cat < lua-5.1.4-easylua.diff 378 | diff -Naur lua-5.1.4-orig/Makefile lua-5.1.4/Makefile 379 | --- lua-5.1.4-orig/Makefile 2007-03-25 11:44:39.000000000 -0300 380 | +++ lua-5.1.4/Makefile 2007-05-11 16:08:02.000000000 -0300 381 | @@ -41,10 +41,10 @@ 382 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 383 | 384 | # What to install. 385 | -TO_BIN= lua luac 386 | +TO_BIN= lua\$(LUA_SUFFIX) luac\$(LUA_SUFFIX) 387 | TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp 388 | -TO_LIB= liblua.a 389 | -TO_MAN= lua.1 luac.1 390 | +TO_LIB= liblua\$(LUA_SUFFIX).a 391 | +TO_MAN= lua\$(LUA_SUFFIX).1 luac\$(LUA_SUFFIX).1 392 | 393 | # Lua version and release. 394 | V= 5.1 395 | @@ -56,11 +56,15 @@ 396 | cd src && \$(MAKE) \$@ 397 | 398 | test: dummy 399 | - src/lua test/hello.lua 400 | + src/lua\$(LUA_SUFFIX) test/hello.lua 401 | 402 | install: dummy 403 | - cd src && \$(MKDIR) \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 404 | + cd src && \$(MKDIR) -p \$(INSTALL_BIN) \$(INSTALL_INC) \$(INSTALL_LIB) \$(INSTALL_MAN) \$(INSTALL_LMOD) \$(INSTALL_CMOD) 405 | cd src && \$(INSTALL_EXEC) \$(TO_BIN) \$(INSTALL_BIN) 406 | cd src && \$(INSTALL_DATA) \$(TO_INC) \$(INSTALL_INC) 407 | cd src && \$(INSTALL_DATA) \$(TO_LIB) \$(INSTALL_LIB) 408 | + cp doc/lua.1 doc/t_lua.1 409 | + cp doc/luac.1 doc/t_luac.1 410 | + mv doc/t_lua.1 doc/lua\$(LUA_SUFFIX).1 411 | + mv doc/t_luac.1 doc/luac\$(LUA_SUFFIX).1 412 | cd doc && \$(INSTALL_DATA) \$(TO_MAN) \$(INSTALL_MAN) 413 | diff -Naur lua-5.1.4-orig/src/luaconf.h lua-5.1.4/src/luaconf.h 414 | --- lua-5.1.4-orig/src/luaconf.h 2007-03-24 00:01:55.000000000 -0300 415 | +++ lua-5.1.4/src/luaconf.h 2007-05-11 16:12:55.000000000 -0300 416 | @@ -94,9 +94,11 @@ 417 | ".\\\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" 418 | 419 | #else 420 | -#define LUA_ROOT "/usr/local/" 421 | -#define LUA_LDIR LUA_ROOT "share/lua/5.1/" 422 | -#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" 423 | +#ifndef LUA_ROOT 424 | +#define LUA_ROOT "/usr/local" 425 | +#endif 426 | +#define LUA_LDIR LUA_ROOT "/share/lua/5.1/" 427 | +#define LUA_CDIR LUA_ROOT "/lib/lua/5.1/" 428 | #define LUA_PATH_DEFAULT \\ 429 | "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \\ 430 | LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" 431 | diff -Naur lua-5.1.4-orig/src/Makefile lua-5.1.4/src/Makefile 432 | --- lua-5.1.4-orig/src/Makefile 2007-03-25 11:49:23.000000000 -0300 433 | +++ lua-5.1.4/src/Makefile 2007-05-11 16:08:02.000000000 -0300 434 | @@ -22,17 +22,17 @@ 435 | 436 | PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris 437 | 438 | -LUA_A= liblua.a 439 | +LUA_A= liblua\$(LUA_SUFFIX).a 440 | CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \\ 441 | lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \\ 442 | lundump.o lvm.o lzio.o 443 | LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \\ 444 | lstrlib.o loadlib.o linit.o 445 | 446 | -LUA_T= lua 447 | +LUA_T= lua\$(LUA_SUFFIX) 448 | LUA_O= lua.o 449 | 450 | -LUAC_T= luac 451 | +LUAC_T= luac\$(LUA_SUFFIX) 452 | LUAC_O= luac.o print.o 453 | 454 | ALL_O= \$(CORE_O) \$(LIB_O) \$(LUA_O) \$(LUAC_O) 455 | @@ -93,7 +93,7 @@ 456 | \$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline" 457 | 458 | generic: 459 | - \$(MAKE) all MYCFLAGS= 460 | + \$(MAKE) all 461 | 462 | linux: 463 | \$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" 464 | 465 | EOF 466 | 467 | echo 468 | echo 469 | echo "=========================================================" 470 | echo "Installing Lua $LUA_VERSION on $PREFIX" 471 | echo "=========================================================" 472 | echo 473 | echo 474 | 475 | if [ "`uname -s`" = "FreeBSD" ] 476 | then 477 | MAKE=gmake 478 | else 479 | MAKE=make 480 | fi 481 | 482 | cleanup() { 483 | echo 484 | echo "Cleaning up..." 485 | echo 486 | 487 | if [ -d $TMP/kepler-$KEPLER_VERSION ]; then 488 | popd && rm -rf $TMP/kepler-$KEPLER_VERSION 489 | fi 490 | } 491 | 492 | $MAKE clean > /dev/null 2> /dev/null 493 | 494 | $MAKE || (echo "Failed compiling Lua. Exiting..."; cleanup; exit 1) 495 | 496 | $MAKE install || (echo "Failed installing Lua. Exiting..."; cleanup; exit 1) 497 | 498 | echo 499 | echo "Done. Lua is installed on $PREFIX." 500 | echo 501 | 502 | if ! [ $SKIP_LR = "yes" ] 503 | then 504 | 505 | echo 506 | echo 507 | echo "=========================================================" 508 | echo "Now installing LuaRocks $LUAROCKS_VERSION in $PREFIX." 509 | echo "=========================================================" 510 | echo 511 | echo 512 | 513 | if [ $LUAROCKS_URL != "" ] 514 | then 515 | 516 | if [ ! -f luarocks-$LUAROCKS_VERSION.tar.gz ]; then 517 | $WGET $LUAROCKS_URL 518 | fi 519 | 520 | tar zxvf luarocks-$LUAROCKS_VERSION.tar.gz 521 | cd luarocks-$LUAROCKS_VERSION 522 | 523 | else 524 | 525 | cvs -d:pserver:anonymous@cvs.luaforge.net:/cvsroot/luarocks export -r HEAD luarocks 526 | cd luarocks 527 | 528 | fi 529 | 530 | sh configure --prefix=$PREFIX --with-lua=$PREFIX \ 531 | --with-lua-include=$LUA_INCDIR \ 532 | --rocks-tree=$PREFIX && make && make install || (echo "Failed installing LuaRocks. Exiting..."; cleanup; exit 1) 533 | 534 | cd .. 535 | 536 | fi 537 | 538 | if ! [ $SKIP_KEPLER = "yes" ] 539 | then 540 | 541 | echo 542 | echo 543 | echo "=========================================================" 544 | echo "Now installing Kepler in $PREFIX." 545 | echo "=========================================================" 546 | echo 547 | 548 | if [ -d rocks ]; then 549 | $PREFIX/bin/luarocks install kepler-xavante --only-from=`pwd`/rocks $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 550 | else 551 | if [ "$KEPLER_ROCK_VERSION" = "cvs" ] 552 | then 553 | $PREFIX/bin/luarocks install --from=http://luarocks.luaforge.net/rocks-cvs kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 554 | else 555 | $PREFIX/bin/luarocks install kepler-xavante $KEPLER_ROCK_VERSION KEPLER_WEB=$WEB 556 | fi 557 | fi 558 | 559 | fi 560 | 561 | cleanup 562 | 563 | 564 | -------------------------------------------------------------------------------- /rockspec/kepler-1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler" 2 | 3 | version = "1.1-1" 4 | 5 | source = { 6 | url = "http://luaforge.net/frs/download.php/3461/kepler-1.1.tar.gz", 7 | } 8 | 9 | description = { 10 | summary = "The Lua Web Development Platform", 11 | detailed = [[ 12 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. ]], 13 | license = "MIT/X11", 14 | homepage = "http://www.keplerproject.org/kepler" 15 | } 16 | 17 | dependencies = { 18 | "wsapi >= 1.0", 19 | "cgilua >= 5.1.2", 20 | "orbit >= 2.0" 21 | } 22 | 23 | build = { 24 | type = "make", 25 | build_pass = false, 26 | install_target = "install", 27 | install_variables = { 28 | PREFIX = "$(PREFIX)", 29 | LUA_DIR = "$(LUADIR)", 30 | BIN_DIR = "$(BINDIR)" 31 | }, 32 | platforms = { 33 | win32 = { 34 | build_pass = true, 35 | build_target = "all", 36 | build_variables = { 37 | CFLAGS = "$(CFLAGS)", 38 | LUA_INCDIR = "$(LUA_INCDIR)", 39 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rockspec/kepler-1.1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler" 2 | 3 | version = "1.1.1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "wsapi >= 1.1", "cgilua >= 5.1.3", "orbit >= 2.0.2" } 14 | 15 | source = { 16 | url = "http://luaforge.net/frs/download.php/3983/kepler-1.1.1.tar.gz" 17 | } 18 | 19 | build = { 20 | platforms = { 21 | unix = { 22 | type = "none", 23 | install = { 24 | bin = { "src/setup-kepler", "src/cgilua.cgi", "src/op.cgi" }, 25 | lua = { kepler_init = "src/kepler_init.lua" } 26 | }, 27 | copy_directories = { "web", "doc", "css", "conf" }, 28 | }, 29 | windows = { 30 | type = "make", 31 | build_pass = true, 32 | build_target = "all", 33 | build_variables = { 34 | CFLAGS = "$(CFLAGS)", 35 | LUA_INCDIR = "$(LUA_INCDIR)", 36 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 37 | }, 38 | install_target = "install", 39 | install_variables = { 40 | PREFIX = "$(PREFIX)", 41 | LUA_DIR = "$(LUADIR)", 42 | BIN_DIR = "$(BINDIR)" 43 | }, 44 | } 45 | } 46 | } 47 | 48 | hooks = { 49 | platforms = { 50 | unix = { 51 | post_install = "$(SCRIPTS_DIR)/setup-kepler --prefix=$(LUAROCKS_PREFIX)/kepler --web=$(KEPLER_WEB) --plat=unix" 52 | }, 53 | windows = { 54 | post_install = '"$(SCRIPTS_DIR)/setup-kepler" "--prefix=$(LUAROCKS_PREFIX)/kepler" "--web=$(KEPLER_WEB)" --plat=windows' 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /rockspec/kepler-1.1rc1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler" 2 | 3 | version = "1.1rc1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "wsapi 1.0rc1", "cgilua 5.1.2rc1", "orbit 2.0rc1" } 14 | 15 | source = { 16 | url = "http://kepler.luaforge.net/kepler-1.1rc1.tar.gz", 17 | } 18 | 19 | build = { 20 | type = "make", 21 | build_pass = false, 22 | install_target = "install", 23 | install_variables = { 24 | PREFIX = "$(PREFIX)", 25 | LUA_DIR = "$(LUADIR)", 26 | BIN_DIR = "$(BINDIR)" 27 | }, 28 | platforms = { 29 | win32 = { 30 | build_pass = true, 31 | build_target = "all", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rockspec/kepler-cvs-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler" 2 | 3 | version = "cvs-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "wsapi cvs", "cgilua cvs", "orbit cvs" } 14 | 15 | source = { 16 | url = "http://kepler.luaforge.net/rocks/kepler-rocks-cvs.tar.gz", 17 | } 18 | 19 | build = { 20 | type = "make", 21 | build_pass = false, 22 | install_target = "install", 23 | install_variables = { 24 | PREFIX = "$(PREFIX)", 25 | LUA_DIR = "$(LUADIR)", 26 | BIN_DIR = "$(BINDIR)" 27 | }, 28 | platforms = { 29 | win32 = { 30 | build_pass = true, 31 | build_target = "all", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rockspec/kepler-cvs-2.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler" 2 | 3 | version = "cvs-2" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "wsapi cvs", "cgilua cvs", "orbit cvs" } 14 | 15 | source = { 16 | url = "git://github.com/keplerproject/kepler.git" 17 | } 18 | 19 | build = { 20 | platforms = { 21 | unix = { 22 | type = "none", 23 | install = { 24 | bin = { "src/setup-kepler", "src/cgilua.cgi", "src/op.cgi" }, 25 | lua = { kepler_init = "src/kepler_init.lua" } 26 | }, 27 | copy_directories = { "web", "doc", "css", "conf" }, 28 | }, 29 | windows = { 30 | type = "make", 31 | build_pass = true, 32 | build_target = "all", 33 | build_variables = { 34 | CFLAGS = "$(CFLAGS)", 35 | LUA_INCDIR = "$(LUA_INCDIR)", 36 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 37 | }, 38 | install_target = "install", 39 | install_variables = { 40 | PREFIX = "$(PREFIX)", 41 | LUA_DIR = "$(LUADIR)", 42 | BIN_DIR = "$(BINDIR)" 43 | }, 44 | } 45 | } 46 | } 47 | 48 | hooks = { 49 | platforms = { 50 | unix = { 51 | post_install = "$(SCRIPTS_DIR)/setup-kepler --prefix=$(LUAROCKS_PREFIX)/kepler --web=$(KEPLER_WEB) --plat=unix" 52 | }, 53 | windows = { 54 | post_install = '"$(SCRIPTS_DIR)/setup-kepler" "--prefix=$(LUAROCKS_PREFIX)/kepler" "--web=$(KEPLER_WEB)" --plat=windows' 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "1.1-1" 4 | 5 | source = { 6 | url = "http://luaforge.net/frs/download.php/3461/kepler-1.1.tar.gz", 7 | } 8 | 9 | description = { 10 | summary = "The Lua Web Development Platform", 11 | detailed = [[ 12 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 13 | FastCGI launcher. ]], 14 | license = "MIT/X11", 15 | homepage = "http://www.keplerproject.org/kepler" 16 | } 17 | 18 | dependencies = { 19 | "kepler >= 1.1", 20 | "wsapi-fcgi >= 1.0" 21 | } 22 | 23 | build = { 24 | type = "make", 25 | build_pass = false, 26 | install_target = "install-fastcgi", 27 | install_variables = { 28 | PREFIX = "$(PREFIX)", 29 | LUA_DIR = "$(LUADIR)", 30 | BIN_DIR = "$(BINDIR)" 31 | }, 32 | platforms = { 33 | win32 = { 34 | build_pass = true, 35 | build_target = "fcgi", 36 | build_variables = { 37 | CFLAGS = "$(CFLAGS)", 38 | LUA_INCDIR = "$(LUA_INCDIR)", 39 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-1.1-2.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "1.1-2" 4 | 5 | source = { 6 | url = "http://luaforge.net/frs/download.php/3461/kepler-1.1.tar.gz", 7 | } 8 | 9 | description = { 10 | summary = "The Lua Web Development Platform", 11 | detailed = [[ 12 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 13 | FastCGI launcher. ]], 14 | license = "MIT/X11", 15 | homepage = "http://www.keplerproject.org/kepler" 16 | } 17 | 18 | dependencies = { 19 | "kepler >= 1.1", 20 | "wsapi-fcgi >= 1.0", 21 | "coxpcall >= 1.13", 22 | } 23 | 24 | build = { 25 | type = "make", 26 | build_pass = false, 27 | install_target = "install-fastcgi", 28 | install_variables = { 29 | PREFIX = "$(PREFIX)", 30 | LUA_DIR = "$(LUADIR)", 31 | BIN_DIR = "$(BINDIR)" 32 | }, 33 | platforms = { 34 | win32 = { 35 | build_pass = true, 36 | build_target = "fcgi", 37 | build_variables = { 38 | CFLAGS = "$(CFLAGS)", 39 | LUA_INCDIR = "$(LUA_INCDIR)", 40 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-1.1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "1.1.1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 9 | FastCGI launcher. ]], 10 | license = "MIT/X11", 11 | homepage = "http://www.keplerproject.org/kepler" 12 | } 13 | 14 | dependencies = { "kepler >= 1.1.1", "wsapi-fcgi >= 1.1", "coxpcall >= 1.13" } 15 | 16 | source = { 17 | url = "http://luaforge.net/frs/download.php/3983/kepler-1.1.1.tar.gz" 18 | } 19 | 20 | build = { 21 | platforms = { 22 | unix = { 23 | type = "none", 24 | install = { 25 | bin = { "src/cgilua.fcgi", "src/op.fcgi" }, 26 | }, 27 | }, 28 | windows = { 29 | type = "make", 30 | build_pass = true, 31 | build_target = "fcgi", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | }, 37 | install_target = "install-fastcgi", 38 | install_variables = { 39 | PREFIX = "$(PREFIX)", 40 | LUA_DIR = "$(LUADIR)", 41 | BIN_DIR = "$(BINDIR)" 42 | }, 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-1.1.1-2.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "1.1.1-2" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 9 | FastCGI launcher. ]], 10 | license = "MIT/X11", 11 | homepage = "http://www.keplerproject.org/kepler" 12 | } 13 | 14 | dependencies = { "kepler >= 1.1.1", "wsapi-fcgi >= 1.1", "coxpcall >= 1.13", "rings >= 1.2.2" } 15 | 16 | source = { 17 | url = "http://luaforge.net/frs/download.php/3983/kepler-1.1.1.tar.gz" 18 | } 19 | 20 | build = { 21 | platforms = { 22 | unix = { 23 | type = "none", 24 | install = { 25 | bin = { "src/cgilua.fcgi", "src/op.fcgi" }, 26 | }, 27 | }, 28 | windows = { 29 | type = "make", 30 | build_pass = true, 31 | build_target = "fcgi", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | }, 37 | install_target = "install-fastcgi", 38 | install_variables = { 39 | PREFIX = "$(PREFIX)", 40 | LUA_DIR = "$(LUADIR)", 41 | BIN_DIR = "$(BINDIR)" 42 | }, 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-1.1rc1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "1.1rc1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 9 | FastCGI launcher. ]], 10 | license = "MIT/X11", 11 | homepage = "http://www.keplerproject.org/kepler" 12 | } 13 | 14 | dependencies = { "kepler 1.1rc1", "wsapi-fcgi 1.0rc1" } 15 | 16 | source = { 17 | url = "http://kepler.luaforge.net/kepler-1.1rc1.tar.gz", 18 | } 19 | 20 | build = { 21 | type = "make", 22 | build_pass = false, 23 | install_target = "install-fastcgi", 24 | install_variables = { 25 | PREFIX = "$(PREFIX)", 26 | LUA_DIR = "$(LUADIR)", 27 | BIN_DIR = "$(BINDIR)" 28 | }, 29 | platforms = { 30 | win32 = { 31 | build_pass = true, 32 | build_target = "fcgi", 33 | build_variables = { 34 | CFLAGS = "$(CFLAGS)", 35 | LUA_INCDIR = "$(LUA_INCDIR)", 36 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-cvs-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "cvs-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 9 | FastCGI launcher. ]], 10 | license = "MIT/X11", 11 | homepage = "http://www.keplerproject.org/kepler" 12 | } 13 | 14 | dependencies = { "kepler cvs", "wsapi-fcgi cvs", "coxpcall cvs" } 15 | 16 | source = { 17 | url = "http://kepler.luaforge.net/rocks/kepler-rocks-cvs.tar.gz", 18 | } 19 | 20 | build = { 21 | type = "make", 22 | build_pass = false, 23 | install_target = "install-fastcgi", 24 | install_variables = { 25 | PREFIX = "$(PREFIX)", 26 | LUA_DIR = "$(LUADIR)", 27 | BIN_DIR = "$(BINDIR)" 28 | }, 29 | platforms = { 30 | win32 = { 31 | build_pass = true, 32 | build_target = "fcgi", 33 | build_variables = { 34 | CFLAGS = "$(CFLAGS)", 35 | LUA_INCDIR = "$(LUA_INCDIR)", 36 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rockspec/kepler-fastcgi-cvs-2.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Fastcgi" 2 | 3 | version = "cvs-2" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This is the 9 | FastCGI launcher. ]], 10 | license = "MIT/X11", 11 | homepage = "http://www.keplerproject.org/kepler" 12 | } 13 | 14 | dependencies = { "kepler cvs", "wsapi-fcgi cvs", "coxpcall cvs", "rings cvs" } 15 | 16 | source = { 17 | url = "git://github.com/keplerproject/kepler.git" 18 | } 19 | 20 | build = { 21 | platforms = { 22 | unix = { 23 | type = "none", 24 | install = { 25 | bin = { "src/cgilua.fcgi", "src/op.fcgi" }, 26 | }, 27 | }, 28 | windows = { 29 | type = "make", 30 | build_pass = true, 31 | build_target = "fcgi", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | }, 37 | install_target = "install-fastcgi", 38 | install_variables = { 39 | PREFIX = "$(PREFIX)", 40 | LUA_DIR = "$(LUADIR)", 41 | BIN_DIR = "$(BINDIR)" 42 | }, 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /rockspec/kepler-xavante-1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Xavante" 2 | 3 | version = "1.1-1" 4 | 5 | source = { 6 | url = "http://luaforge.net/frs/download.php/3461/kepler-1.1.tar.gz", 7 | } 8 | 9 | description = { 10 | summary = "The Lua Web Development Platform", 11 | detailed = [[ 12 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This installs the Xavante webserver. ]], 13 | license = "MIT/X11", 14 | homepage = "http://www.keplerproject.org/kepler" 15 | } 16 | 17 | dependencies = { 18 | "kepler >= 1.1", 19 | "rings >= 1.2.1", 20 | "xavante >= 2.0", 21 | } 22 | 23 | build = { 24 | type = "make", 25 | build_pass = false, 26 | install_target = "install-xavante", 27 | install_variables = { 28 | PREFIX = "$(PREFIX)", 29 | LUA_DIR = "$(LUADIR)", 30 | BIN_DIR = "$(BINDIR)" 31 | }, 32 | platforms = { 33 | win32 = { 34 | build_pass = true, 35 | build_target = "xavante", 36 | build_variables = { 37 | CFLAGS = "$(CFLAGS)", 38 | LUA_INCDIR = "$(LUA_INCDIR)", 39 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rockspec/kepler-xavante-1.1.1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Xavante" 2 | 3 | version = "1.1.1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This installs the Xavante webserver. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "kepler >= 1.1.1", "xavante >= 2.0.1", "coxpcall >= 1.13", "rings >= 1.2.2" } 14 | 15 | source = { 16 | url = "http://luaforge.net/frs/download.php/3983/kepler-1.1.1.tar.gz" 17 | } 18 | 19 | build = { 20 | platforms = { 21 | unix = { 22 | type = "none", 23 | install = { 24 | bin = { "src/xavante_start" } 25 | } 26 | }, 27 | windows = { 28 | type = "make", 29 | build_pass = true, 30 | build_target = "xavante", 31 | build_variables = { 32 | CFLAGS = "$(CFLAGS)", 33 | LUA_INCDIR = "$(LUA_INCDIR)", 34 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 35 | }, 36 | install_target = "install-xavante", 37 | install_variables = { 38 | PREFIX = "$(PREFIX)", 39 | LUA_DIR = "$(LUADIR)", 40 | BIN_DIR = "$(BINDIR)" 41 | }, 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rockspec/kepler-xavante-1.1rc1-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Xavante" 2 | 3 | version = "1.1rc1-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This installs the Xavante webserver. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "kepler 1.1rc1", "xavante 2.0rc1" } 14 | 15 | source = { 16 | url = "http://kepler.luaforge.net/kepler-1.1rc1.tar.gz", 17 | } 18 | 19 | build = { 20 | type = "make", 21 | build_pass = false, 22 | install_target = "install-xavante", 23 | install_variables = { 24 | PREFIX = "$(PREFIX)", 25 | LUA_DIR = "$(LUADIR)", 26 | BIN_DIR = "$(BINDIR)" 27 | }, 28 | platforms = { 29 | win32 = { 30 | build_pass = true, 31 | build_target = "xavante", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rockspec/kepler-xavante-cvs-1.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Xavante" 2 | 3 | version = "cvs-1" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This installs the Xavante webserver. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "kepler cvs", "xavante cvs" } 14 | 15 | source = { 16 | url = "http://kepler.luaforge.net/rocks/kepler-rocks-cvs.tar.gz", 17 | } 18 | 19 | build = { 20 | type = "make", 21 | build_pass = false, 22 | install_target = "install-xavante", 23 | install_variables = { 24 | PREFIX = "$(PREFIX)", 25 | LUA_DIR = "$(LUADIR)", 26 | BIN_DIR = "$(BINDIR)" 27 | }, 28 | platforms = { 29 | win32 = { 30 | build_pass = true, 31 | build_target = "xavante", 32 | build_variables = { 33 | CFLAGS = "$(CFLAGS)", 34 | LUA_INCDIR = "$(LUA_INCDIR)", 35 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rockspec/kepler-xavante-cvs-2.rockspec: -------------------------------------------------------------------------------- 1 | package = "Kepler-Xavante" 2 | 3 | version = "cvs-2" 4 | 5 | description = { 6 | summary = "The Lua Web Development Platform", 7 | detailed = [[ 8 | Kepler is a Lua web development platform that offers the same advantages of Lua. Kepler is simple, portable, light, embeddable and extensible. This installs the Xavante webserver. ]], 9 | license = "MIT/X11", 10 | homepage = "http://www.keplerproject.org/kepler" 11 | } 12 | 13 | dependencies = { "kepler cvs", "xavante cvs", "coxpcall cvs", "rings cvs" } 14 | 15 | source = { 16 | url = "git://github.com/keplerproject/kepler.git" 17 | } 18 | 19 | build = { 20 | platforms = { 21 | unix = { 22 | type = "none", 23 | install = { 24 | bin = { "src/xavante_start" } 25 | } 26 | }, 27 | windows = { 28 | type = "make", 29 | build_pass = true, 30 | build_target = "xavante", 31 | build_variables = { 32 | CFLAGS = "$(CFLAGS)", 33 | LUA_INCDIR = "$(LUA_INCDIR)", 34 | LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib" 35 | }, 36 | install_target = "install-xavante", 37 | install_variables = { 38 | PREFIX = "$(PREFIX)", 39 | LUA_DIR = "$(LUADIR)", 40 | BIN_DIR = "$(BINDIR)" 41 | }, 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/cgilua.cgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | -- CGILua (SAPI) launcher, extracts script to launch 4 | -- either from the command line (use #!cgilua in the script) 5 | -- or from SCRIPT_FILENAME/PATH_TRANSLATED 6 | 7 | pcall(require, "luarocks.require") 8 | 9 | local common = require "wsapi.common" 10 | local cgi = require "wsapi.cgi" 11 | local sapi = require "wsapi.sapi" 12 | 13 | local arg_filename = (...) 14 | 15 | local function sapi_loader(wsapi_env) 16 | require"kepler_init" 17 | common.normalize_paths(wsapi_env, arg_filename, "cgilua.cgi") 18 | return sapi.run(wsapi_env) 19 | end 20 | 21 | cgi.run(sapi_loader) 22 | -------------------------------------------------------------------------------- /src/cgilua.fcgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | -- CGILua (SAPI) launcher, extracts script to launch 4 | -- either from the command line (use #!cgilua in the script) 5 | -- or from SCRIPT_FILENAME/PATH_TRANSLATED 6 | 7 | pcall(require, "luarocks.require") 8 | pcall(require, "kepler_init") 9 | 10 | local common = require "wsapi.common" 11 | local fastcgi = require "wsapi.fastcgi" 12 | 13 | local reload = false -- set to true if you want to always run in a new state 14 | 15 | local function sapi_loader(wsapi_env) 16 | common.normalize_paths(wsapi_env, nil, "cgilua.fcgi") 17 | local bootstrap = "" 18 | for _, global in ipairs(RINGS_CGILUA_GLOBALS) do 19 | bootstrap = bootstrap .. 20 | "_, _G[\"" .. global .. "\"] = remotedostring(\"return _G['" .. 21 | global .. "']\")\n" 22 | end 23 | local app = wsapi.common.load_isolated_launcher(wsapi_env.PATH_TRANSLATED, "wsapi.sapi", 24 | bootstrap, reload) 25 | return app(wsapi_env) 26 | end 27 | 28 | fastcgi.run(sapi_loader) 29 | 30 | -------------------------------------------------------------------------------- /src/kepler_init.lua: -------------------------------------------------------------------------------- 1 | 2 | error("Kepler is not properly setup. Please run setup-kepler") 3 | 4 | -------------------------------------------------------------------------------- /src/make_rc.lua: -------------------------------------------------------------------------------- 1 | 2 | io.write("#define IDS_WSAPI 1\r\n") 3 | io.write("STRINGTABLE\r\nBEGIN\r\n") 4 | io.write("IDS_WSAPI \"") 5 | 6 | for line in io.lines((...)) do 7 | if not line:match("^#!") then 8 | line = line:gsub("\\", "\\\\"):gsub('"', '""'):gsub("[\r\n]+", "") 9 | io.write(line .. "\\n\\\r\n") 10 | end 11 | end 12 | 13 | io.write("\"\r\nEND\r\n") 14 | -------------------------------------------------------------------------------- /src/op.cgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | -- Orbit pages launcher, extracts script to launch 4 | -- from SCRIPT_FILENAME/PATH_TRANSLATED 5 | 6 | pcall(require, "luarocks.require") 7 | 8 | local common = require "wsapi.common" 9 | local cgi = require "wsapi.cgi" 10 | local op = require "orbit.pages" 11 | 12 | local arg_filename = (...) 13 | 14 | local function op_loader(wsapi_env) 15 | common.normalize_paths(wsapi_env, arg_filename, "op.cgi") 16 | return op.run(wsapi_env) 17 | end 18 | 19 | cgi.run(op_loader) 20 | -------------------------------------------------------------------------------- /src/op.fcgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | -- Orbit pages launcher, extracts script to launch 4 | 5 | pcall(require, "luarocks.require") 6 | 7 | local common = require "wsapi.common" 8 | local fastcgi = require "wsapi.fastcgi" 9 | 10 | local function op_loader(wsapi_env) 11 | common.normalize_paths(wsapi_env, nil, "op.fcgi") 12 | local app = wsapi.common.load_isolated_launcher(wsapi_env.PATH_TRANSLATED, "orbit.pages") 13 | return app(wsapi_env) 14 | end 15 | 16 | fastcgi.run(op_loader) 17 | -------------------------------------------------------------------------------- /src/rclauncher.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ** Simple Lua interpreter. 4 | ** This program is used to run a Lua file embedded as a resource. 5 | ** It creates a Lua state, opens all its standard libraries, and run 6 | ** the Lua file in a protected environment just to redirect the error 7 | ** messages to stdout and stderr. 8 | ** 9 | ** $Id: rclauncher.c,v 1.1 2008/06/30 14:29:59 carregal Exp $ 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | #include "lua.h" 16 | #include "lauxlib.h" 17 | #include "lualib.h" 18 | #include 19 | #include 20 | #include 21 | 22 | /* 23 | ** Report error message. 24 | ** Assumes that the error message is on top of the stack. 25 | */ 26 | static int report (lua_State *L) { 27 | fprintf (stderr, "lua: fatal error: `%s'\n", lua_tostring (L, -1)); 28 | fflush (stderr); 29 | printf ("Content-type: text/plain\n\nConfiguration fatal error: see error log!\n"); 30 | printf ("%s", lua_tostring(L, -1)); 31 | return 1; 32 | } 33 | 34 | static int runlua (lua_State *L, LPTSTR lua_string) { 35 | int err_func; 36 | 37 | lua_pushliteral(L, "debug"); 38 | lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ 39 | lua_pushliteral(L, "traceback"); 40 | lua_gettable(L, -2); 41 | err_func = lua_gettop (L); 42 | return (luaL_loadstring (L, lua_string)) || 43 | (lua_pcall (L, 0, LUA_MULTRET, err_func)); 44 | } 45 | 46 | static DWORD GetModulePath( HINSTANCE hInst, LPTSTR pszBuffer, DWORD dwSize ) 47 | // 48 | // Return the size of the path in bytes. 49 | { 50 | DWORD dwLength = GetModuleFileName( hInst, pszBuffer, dwSize ); 51 | if( dwLength ) 52 | { 53 | while( dwLength && pszBuffer[ dwLength ] != '.' ) 54 | { 55 | dwLength--; 56 | } 57 | 58 | if( dwLength ) 59 | pszBuffer[ dwLength ] = '\000'; 60 | } 61 | return dwLength; 62 | } 63 | 64 | 65 | /* 66 | ** MAIN 67 | */ 68 | int main (int argc, char *argv[]) { 69 | char name[ MAX_PATH ]; 70 | DWORD dwLength; 71 | int size; 72 | TCHAR lua_string[10000]; 73 | lua_State *L = lua_open(); 74 | (void)argc; /* avoid "unused parameter" warning */ 75 | luaL_openlibs(L); 76 | dwLength = GetModulePath( NULL, name, MAX_PATH ); 77 | if(dwLength) { /* Optional bootstrap */ 78 | strcat(name, ".lua"); 79 | if(!luaL_loadfile (L, name)) { 80 | if(lua_pcall (L, 0, LUA_MULTRET, 0)) { 81 | report (L); 82 | lua_close (L); 83 | return EXIT_FAILURE; 84 | } 85 | } 86 | } 87 | size = LoadString(GetModuleHandle(NULL), 1, lua_string, 88 | sizeof(lua_string)/sizeof(TCHAR)); 89 | if(size) { 90 | if (runlua (L, lua_string)) { 91 | report (L); 92 | lua_close (L); 93 | return EXIT_FAILURE; 94 | } 95 | } else { 96 | lua_close(L); 97 | fprintf(stderr, "could not load Lua resource\n"); 98 | printf ("Content-type: text/plain\n\nConfiguration fatal error: see error log!\n"); 99 | } 100 | lua_close (L); 101 | return EXIT_SUCCESS; 102 | } 103 | -------------------------------------------------------------------------------- /src/setup-kepler: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lua 2 | 3 | KEPLER_INIT = [==[ 4 | 5 | -- 6 | -- Kepler bootstrap file 7 | -- Defines the default directories for Kepler 8 | -- 9 | 10 | -- Kepler applications directory 11 | KEPLER_APPS = [[KEPLER_APPS]] 12 | 13 | -- Kepler configuration directory 14 | KEPLER_CONF = [[KEPLER_CONF]] 15 | 16 | -- Kepler logs directory 17 | KEPLER_LOG = [[KEPLER_LOG]] 18 | 19 | -- Kepler temporary directory 20 | KEPLER_TMP = [[KEPLER_TMP]] 21 | 22 | -- Kepler default web directory 23 | KEPLER_WEB = [[KEPLER_WEB]] 24 | 25 | -- CGILua globals (usually defined using KEPLER globals) 26 | CGILUA_APPS = KEPLER_APPS.."/cgilua" 27 | CGILUA_CONF = KEPLER_CONF.."/cgilua" 28 | CGILUA_TMP = KEPLER_TMP 29 | CGILUA_ISDIRECT = true 30 | 31 | RINGS_CGILUA_GLOBALS = { 32 | "KEPLER_APPS", "KEPLER_CONF", "KEPLER_LIB", 33 | "KEPLER_LOG", "KEPLER_LUA", "KEPLER_TMP", "KEPLER_WEB", 34 | "CGILUA_APPS", "CGILUA_CONF", "CGILUA_TMP", "CGILUA_ISDIRECT", 35 | } 36 | 37 | ]==] 38 | 39 | HELP = [[ 40 | This is the Kepler 1.1 setup. 41 | 42 | --help This help. 43 | --prefix=DIR Prefix where Kepler should be installed. 44 | Default is /usr/local/kepler 45 | (C:\LuaRocks\Kepler on Windows) 46 | --conf=DIR Prefix where config files should be installed. 47 | Default is $(PREFIX)/etc 48 | --web=DIR Prefix for Kepler's document root 49 | Default is $(PREFIX)/htdocs 50 | --log=DIR Directory for Kepler logs. 51 | Default is $(PREFIX)/log 52 | --apps=DIR Prefix for Kepler applications 53 | Default is $(PREFIX)/apps 54 | --tmp=DIR Directory for temporary files 55 | Default is /tmp (C:\WINDOWS\Temp on Windows) 56 | ]] 57 | 58 | args = { ... } 59 | 60 | for _, arg in ipairs(args) do 61 | if arg == "--help" then 62 | print(HELP) 63 | os.exit(0) 64 | end 65 | local name, val = arg:match("^%-%-(%w+)=(.*)$") 66 | if val == "" then val = nil end 67 | if val:match("^%$%([%w_]+%)$") then val = nil end 68 | if name == "conf" then 69 | KEPLER_CONF = val 70 | elseif name == "prefix" then 71 | PREFIX = val 72 | elseif name == "web" then 73 | KEPLER_WEB = val 74 | elseif name == "apps" then 75 | KEPLER_APPS = val 76 | elseif name == "tmp" then 77 | KEPLER_TMP = val 78 | elseif name == "log" then 79 | KEPLER_LOG = val 80 | elseif name == "plat" then 81 | platform = val 82 | else 83 | print("Error: invalid option. Please see setup-kepler --help") 84 | os.exit(1) 85 | end 86 | end 87 | 88 | if not platform then 89 | test = os.execute("mkdir -p /tmp/foo") 90 | if test == 0 then platform = "unix" else platform = "windows" end 91 | end 92 | 93 | if platform == "unix" then 94 | PREFIX = PREFIX or "/usr/local/kepler" 95 | else 96 | PREFIX = PREFIX or "c:\\LuaRocks\\kepler" 97 | KEPLER_TMP = KEPLER_TMP or "c:\\WINDOWS\\Temp" 98 | end 99 | 100 | KEPLER_CONF = KEPLER_CONF or PREFIX .. "/etc" 101 | KEPLER_WEB = KEPLER_WEB or PREFIX .. "/htdocs" 102 | KEPLER_APPS = KEPLER_APPS or PREFIX .. "/apps" 103 | KEPLER_TMP = KEPLER_TMP or "/tmp" 104 | KEPLER_LOG = KEPLER_LOG or PREFIX .. "/log" 105 | 106 | print() 107 | print("Please review Kepler's configuration.") 108 | print() 109 | print("Kepler configuration: " .. KEPLER_CONF) 110 | print("Kepler web root: " .. KEPLER_WEB) 111 | print("Kepler apps: " .. KEPLER_APPS) 112 | print("Kepler logs: " .. KEPLER_LOG) 113 | print("Kepler temp dir: " .. KEPLER_TMP) 114 | print() 115 | io.write("Configure Kepler with these parameters? [Y/n] ") 116 | yesno = io.read("*l") 117 | if yesno:match("%s*n%s*") then 118 | print("Aborted. Please run setup-kepler to configure Kepler with your desired parameters.") 119 | os.exit(1) 120 | end 121 | 122 | this = arg[0] 123 | 124 | kepler_install_dir = this:match("^(.+)/bin/setup%-kepler$") 125 | 126 | print() 127 | 128 | kepler_init = kepler_install_dir .. "/lua/kepler_init.lua" 129 | 130 | ki = loadfile(kepler_init) 131 | setfenv(ki, { error = error }) 132 | ok = pcall(ki) 133 | 134 | if ok then 135 | io.write(kepler_init .. " already exists, replace it? [y/N] ") 136 | yesno = io.read("*l") 137 | if not yesno:match("%s*y%s*") then 138 | print("Setup aborted") 139 | os.exit(1) 140 | end 141 | end 142 | 143 | print("Writing " .. kepler_init) 144 | 145 | function replace(...) 146 | for _, var in ipairs{ ... } do 147 | KEPLER_INIT = KEPLER_INIT:gsub("%[%[KEPLER_" .. var .. "%]%]", 148 | "[[" .. _G["KEPLER_" .. var] .. "]]") 149 | end 150 | end 151 | 152 | replace("CONF", "WEB", "APPS", "TMP", "LOG") 153 | 154 | file = io.open(kepler_init, "w+") 155 | file:write(KEPLER_INIT) 156 | file:close() 157 | 158 | if platform == "unix" then 159 | write_conf = true 160 | file = io.open(KEPLER_CONF .. "/cgilua") 161 | if file then 162 | file:close() 163 | io.write("You have a previous Kepler configuration at " .. KEPLER_CONF .. ", replace it? [y/N] ") 164 | yesno = io.read("*l") 165 | if not yesno:match("%s*y%s*") then 166 | write_conf = false 167 | end 168 | end 169 | if write_conf then 170 | print("Copying configuration files to " .. KEPLER_CONF) 171 | os.execute("mkdir -p " .. KEPLER_CONF) 172 | os.execute("cp -R " .. kepler_install_dir .. "/conf/* " .. KEPLER_CONF) 173 | end 174 | print("Copying docs and sample scripts to " .. KEPLER_WEB) 175 | os.execute("mkdir -p " .. KEPLER_WEB) 176 | os.execute("mkdir -p " .. KEPLER_WEB .. "/doc") 177 | os.execute("mkdir -p " .. KEPLER_WEB .. "/doc/kepler") 178 | os.execute("cp -R " .. kepler_install_dir .. "/web/* " .. KEPLER_WEB) 179 | os.execute("cp -R " .. kepler_install_dir .. "/doc/us/* " .. KEPLER_WEB .. "/doc/kepler") 180 | os.execute("cp -R " .. kepler_install_dir .. "/css/* " .. KEPLER_WEB .. 181 | "/css/") 182 | print("Creating " .. KEPLER_APPS) 183 | os.execute("mkdir -p " .. KEPLER_APPS) 184 | print("Creating " .. KEPLER_TMP) 185 | os.execute("mkdir -p " .. KEPLER_TMP) 186 | print("Creating " .. KEPLER_LOG) 187 | os.execute("mkdir -p " .. KEPLER_LOG) 188 | else 189 | -- Windows 190 | write_conf = true 191 | file = io.open(KEPLER_CONF) 192 | if file then 193 | file:close() 194 | io.write(KEPLER_CONF .. " already exists, replace it? [y/N] ") 195 | yesno = io.read("*l") 196 | if not yesno:match("%s*y%s*") then 197 | write_conf = false 198 | end 199 | end 200 | if write_conf then 201 | print("Copying configuration files to " .. KEPLER_CONF) 202 | os.execute("if not exist \"" .. KEPLER_CONF .. "\" mkdir \"" .. KEPLER_CONF .. "\"") 203 | os.execute("xcopy /Y /E \"" .. kepler_install_dir .. "\\conf\" \"" .. KEPLER_CONF .. "\\\"") 204 | end 205 | print("Copying docs and sample scripts to " .. KEPLER_WEB) 206 | os.execute("if not exist \"" .. KEPLER_WEB .. "\" mkdir \"" .. KEPLER_WEB .. "\\\"") 207 | os.execute("xcopy /Y /E \"" .. kepler_install_dir .. "\\web\" \"" .. KEPLER_WEB .. "\\\"") 208 | os.execute("if not exist \"" .. KEPLER_WEB .. "\\doc\" mkdir \"" .. KEPLER_WEB .. "\\doc\\\"") 209 | os.execute("xcopy /Y /E \"" .. kepler_install_dir .. "\\doc\\us\" \"" .. KEPLER_WEB .. "\\doc\\kepler\\\"") 210 | os.execute("xcopy /Y /E \"" .. kepler_install_dir .. "\\css\" \"" .. KEPLER_WEB .. "\\css\\\"") 211 | print("Creating " .. KEPLER_APPS) 212 | os.execute("if not exist \"" .. KEPLER_APPS .. "\" mkdir \"" .. KEPLER_APPS .. "\"") 213 | print("Creating " .. KEPLER_TMP) 214 | os.execute("if not exist \"" .. KEPLER_TMP .. "\" mkdir \"" .. KEPLER_TMP .. "\"") 215 | print("Creating " .. KEPLER_LOG) 216 | os.execute("if not exist \"" .. KEPLER_LOG .. "\" mkdir \"" .. KEPLER_LOG .. "\"") 217 | end 218 | 219 | print("Enjoy Kepler!") 220 | -------------------------------------------------------------------------------- /src/xavante_start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lua 2 | 3 | ------------------------------------------------------------------------------- 4 | -- Starts the Xavante Web server. 5 | -- 6 | -- See xavante/config.lua and the online documentation for configuration details. 7 | -- 8 | -- Authors: Javier Guerra and Andre Carregal 9 | -- Copyright (c) 2004-2007 Kepler Project 10 | -- 11 | -- $Id: xavante_start,v 1.3 2008/07/03 20:25:47 carregal Exp $ 12 | ------------------------------------------------------------------------------- 13 | 14 | pcall(require, "luarocks.require") 15 | 16 | require "kepler_init" 17 | 18 | XAVANTE_CFG = KEPLER_CONF.."/xavante/config.lua" 19 | XAVANTE_LOG = KEPLER_LOG.."/xavante.log" 20 | XAVANTE_TMP = KEPLER_TMP 21 | XAVANTE_WEB = KEPLER_WEB 22 | 23 | local tostring = tostring 24 | 25 | local log = io.open(XAVANTE_LOG, "a+") 26 | 27 | if not log then 28 | error("Could not open log file. Please check the write permissions for:"..XAVANTE_LOG) 29 | end 30 | 31 | io.stdout = log 32 | io.stderr = log 33 | print = function (...) 34 | local nargs = select('#', ...) 35 | for i = 1, nargs-1 do 36 | log:write(tostring((select(i, ...)))) 37 | log:write("\t") 38 | end 39 | log:write(tostring(select(nargs, ...))) 40 | log:write("\n") 41 | end 42 | 43 | XAVANTE_ISFINISHED = XAVANTE_ISFINISHED or function() return false end 44 | 45 | local res, err = pcall(require, "xavante") 46 | 47 | if not res then 48 | io.stderr:write(err .. "\n") 49 | else 50 | --------------------------------------------------------------------------- 51 | -- Loads the configuration file and starts Xavante 52 | -- 53 | -- XAVANTE_ISFINISHED and XAVANTE_TIMEOUT are optional globals that can 54 | -- control how Xavante will behave when being externally controlled. 55 | -- XAVANTE_ISFINISHED is a function to be called on every step of Xavante, 56 | -- XAVANTE_TIMEOUT is the timeout to be used by Copas. 57 | --------------------------------------------------------------------------- 58 | io.stdout:write("[Xavante launcher] Starting Xavante...\n") 59 | 60 | -- tries to load the user configuration 61 | res, err = loadfile(XAVANTE_CFG) 62 | if res then 63 | res() 64 | else 65 | error("Error loading user config.lua" .. err) 66 | end 67 | res, err = pcall(xavante.start, function (...) 68 | log:flush() 69 | return XAVANTE_ISFINISHED(...) 70 | end, XAVANTE_TIMEOUT) 71 | if not res then 72 | io.stderr:write(err .. "\n") 73 | else 74 | io.stderr:write("[Xavante launcher] Xavante stopped\n") 75 | end 76 | end 77 | 78 | log:close() 79 | 80 | -------------------------------------------------------------------------------- /src/xavantetray/SystemTraySDK.h: -------------------------------------------------------------------------------- 1 | // TrayIcon.h: interface for the CSystemTray class. 2 | // 3 | // Written by Chris Maunder (cmaunder@mail.com) 4 | // Copyright (c) 1998. 5 | // 6 | // This code may be used in compiled form in any way you desire. This 7 | // file may be redistributed unmodified by any means PROVIDING it is 8 | // not sold for profit without the authors written consent, and 9 | // providing that this notice and the authors name is included. If 10 | // the source code in this file is used in any commercial application 11 | // then acknowledgement must be made to the author of this file 12 | // (in whatever form you wish). 13 | // 14 | // This file is provided "as is" with no expressed or implied warranty. 15 | // 16 | // Expect bugs. 17 | // 18 | // Please use and enjoy. Please let me know of any bugs/mods/improvements 19 | // that you have found/implemented and I will fix/incorporate them into this 20 | // file. 21 | // 22 | ////////////////////////////////////////////////////////////////////// 23 | 24 | #if !defined(AFX_TRAYICON_H__43104212_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_) 25 | #define AFX_TRAYICON_H__43104212_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_ 26 | 27 | #ifndef _WIN32_IE 28 | #define _WIN32_IE 0x0501 29 | #endif 30 | 31 | #include 32 | 33 | #if _MSC_VER > 1000 34 | #pragma once 35 | #endif // _MSC_VER > 1000 36 | 37 | // The debugger can't handle symbols more than 255 characters long. 38 | // STL often creates symbols longer than that. 39 | // When symbols are longer than 255 characters, the warning is disabled. 40 | #pragma warning(disable:4786) 41 | #include 42 | #include 43 | using namespace std; 44 | typedef vector ICONVECTOR; 45 | 46 | #ifdef NOTIFYICONDATA_V1_SIZE // If NOTIFYICONDATA_V1_SIZE, then we can use fun stuff 47 | #define SYSTEMTRAY_USEW2K 48 | #else 49 | #define NIIF_NONE 0 50 | #endif 51 | 52 | class CSystemTray 53 | { 54 | // Construction/destruction 55 | public: 56 | CSystemTray(); 57 | CSystemTray(HINSTANCE hInst, HWND hParent, UINT uCallbackMessage, 58 | LPCTSTR szTip, HICON icon, UINT uID, 59 | BOOL bhidden = FALSE, 60 | LPCTSTR szBalloonTip = NULL, LPCTSTR szBalloonTitle = NULL, 61 | DWORD dwBalloonIcon = NIIF_NONE, UINT uBalloonTimeout = 10); 62 | virtual ~CSystemTray(); 63 | 64 | // Operations 65 | public: 66 | BOOL Enabled() { return m_bEnabled; } 67 | BOOL Visible() { return !m_bHidden; } 68 | 69 | // Create the tray icon 70 | BOOL Create(HINSTANCE hInst, HWND hParent, UINT uCallbackMessage, LPCTSTR szTip, 71 | HICON icon, UINT uID, BOOL bHidden = FALSE, 72 | LPCTSTR szBalloonTip = NULL, LPCTSTR szBalloonTitle = NULL, 73 | DWORD dwBalloonIcon = NIIF_NONE, UINT uBalloonTimeout = 10); 74 | 75 | // Change or retrieve the Tooltip text 76 | BOOL SetTooltipText(LPCTSTR pszTooltipText); 77 | BOOL SetTooltipText(UINT nID); 78 | LPTSTR GetTooltipText() const; 79 | 80 | // Change or retrieve the icon displayed 81 | BOOL SetIcon(HICON hIcon); 82 | BOOL SetIcon(LPCTSTR lpszIconName); 83 | BOOL SetIcon(UINT nIDResource); 84 | BOOL SetStandardIcon(LPCTSTR lpIconName); 85 | BOOL SetStandardIcon(UINT nIDResource); 86 | HICON GetIcon() const; 87 | 88 | void SetFocus(); 89 | BOOL HideIcon(); 90 | BOOL ShowIcon(); 91 | BOOL AddIcon(); 92 | BOOL RemoveIcon(); 93 | BOOL MoveToRight(); 94 | 95 | BOOL ShowBalloon(LPCTSTR szText, LPCTSTR szTitle = NULL, 96 | DWORD dwIcon = NIIF_NONE, UINT uTimeout = 10); 97 | 98 | // For icon animation 99 | BOOL SetIconList(UINT uFirstIconID, UINT uLastIconID); 100 | BOOL SetIconList(HICON* pHIconList, UINT nNumIcons); 101 | BOOL Animate(UINT nDelayMilliSeconds, int nNumSeconds = -1); 102 | BOOL StepAnimation(); 103 | BOOL StopAnimation(); 104 | 105 | // Change menu default item 106 | void GetMenuDefaultItem(UINT& uItem, BOOL& bByPos); 107 | BOOL SetMenuDefaultItem(UINT uItem, BOOL bByPos); 108 | 109 | // Change menu 110 | UINT GetMenuID(); 111 | BOOL SetMenuID(UINT menuId); 112 | 113 | // Change or retrieve the window to send icon notification messages to 114 | BOOL SetNotificationWnd(HWND hNotifyWnd); 115 | HWND GetNotificationWnd() const; 116 | 117 | // Change or retrieve the window to send menu commands to 118 | BOOL SetTargetWnd(HWND hTargetWnd); 119 | HWND GetTargetWnd() const; 120 | 121 | // Change or retrieve notification messages sent to the window 122 | BOOL SetCallbackMessage(UINT uCallbackMessage); 123 | UINT GetCallbackMessage() const; 124 | 125 | HWND GetSafeHwnd() const { return (this)? m_hWnd : NULL; } 126 | UINT_PTR GetTimerID() const { return m_nTimerID; } 127 | 128 | // Static functions 129 | public: 130 | static void MinimiseToTray(HWND hWnd); 131 | static void MaximiseFromTray(HWND hWnd); 132 | 133 | public: 134 | // Default handler for tray notification message 135 | virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent); 136 | 137 | // Overrides 138 | // ClassWizard generated virtual function overrides 139 | //{{AFX_VIRTUAL(CSystemTray) 140 | //}}AFX_VIRTUAL 141 | 142 | // Static callback functions and data 143 | public: 144 | static LRESULT PASCAL WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 145 | static CSystemTray* m_pThis; 146 | 147 | // Implementation 148 | protected: 149 | void Initialise(); 150 | void InstallIconPending(); 151 | ATOM RegisterClass(HINSTANCE hInstance); 152 | 153 | virtual void CustomizeMenu(HMENU) {} 154 | 155 | // Implementation 156 | protected: 157 | NOTIFYICONDATA m_tnd; 158 | UINT m_menuId; 159 | HINSTANCE m_hInstance; 160 | HWND m_hWnd; 161 | HWND m_hTargetWnd; // Window that menu commands are sent 162 | 163 | BOOL m_bEnabled; // does O/S support tray icon? 164 | BOOL m_bHidden; // Has the icon been hidden? 165 | BOOL m_bRemoved; // Has the icon been removed? 166 | BOOL m_bShowIconPending; // Show the icon once tha taskbar has been created 167 | BOOL m_bWin2K; // Use new W2K features? 168 | 169 | ICONVECTOR m_IconList; 170 | UINT_PTR m_uIDTimer; 171 | int m_nCurrentIcon; 172 | time_t m_StartTime; 173 | int m_nAnimationPeriod; 174 | HICON m_hSavedIcon; 175 | UINT m_DefaultMenuItemID; 176 | BOOL m_DefaultMenuItemByPos; 177 | UINT m_uCreationFlags; 178 | 179 | // Static data 180 | protected: 181 | static BOOL RemoveTaskbarIcon(HWND hWnd); 182 | 183 | static const UINT_PTR m_nTimerID; 184 | static UINT m_nMaxTooltipLength; 185 | static const UINT m_nTaskbarCreatedMsg; 186 | static HWND m_hWndInvisible; 187 | 188 | static BOOL GetW2K(); 189 | #ifndef _WIN32_WCE 190 | static void GetTrayWndRect(LPRECT lprect); 191 | static BOOL GetDoWndAnimation(); 192 | #endif 193 | 194 | // message map functions 195 | public: 196 | LRESULT OnTimer(UINT nIDEvent); 197 | LRESULT OnTaskbarCreated(WPARAM wParam, LPARAM lParam); 198 | #ifndef _WIN32_WCE 199 | LRESULT OnSettingChange(UINT uFlags, LPCTSTR lpszSection); 200 | #endif 201 | }; 202 | 203 | 204 | #endif // !defined(AFX_TRAYICON_H__43104212_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_) 205 | -------------------------------------------------------------------------------- /src/xavantetray/XavanteTray.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/src/xavantetray/XavanteTray.ICO -------------------------------------------------------------------------------- /src/xavantetray/XavanteTray.cpp: -------------------------------------------------------------------------------- 1 | // XavanteTray.cpp : Defines the entry point for the application. 2 | // 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | 7 | // Windows Header Files: 8 | #include 9 | 10 | // C RunTime Header Files 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include "resource.h" 20 | #include "SystemTraySDK.h" 21 | extern "C" { 22 | #include "lua.h" 23 | #include "lualib.h" 24 | #include "lauxlib.h" 25 | } 26 | 27 | #define MAX_LOADSTRING 100 28 | #define WM_ICON_NOTIFY WM_APP+10 29 | #define SELECT_TIMEOUT 1 30 | 31 | // Global Variables: 32 | HINSTANCE hInst; // current instance 33 | HWND currenthWnd; 34 | HANDLE hStopSemaphore; 35 | CSystemTray TrayIcon; 36 | lua_State *L; 37 | int xavante_started; 38 | long exit_thread; 39 | const char* xavante_log; 40 | FILE *log; 41 | FILE *aux; 42 | TCHAR xavante_start[10000]; 43 | 44 | // Foward declarations of functions included in this code module: 45 | ATOM MyRegisterClass(HINSTANCE hInstance); 46 | BOOL InitInstance(HINSTANCE, int); 47 | LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); 48 | LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); 49 | 50 | int Alert(lua_State *L) { 51 | const char *errmsg; 52 | errmsg = lua_tostring(L, 1); 53 | return 1; 54 | } 55 | 56 | int CheckExit(lua_State *L) { 57 | if(!xavante_log) { 58 | lua_getglobal(L, "XAVANTE_LOG"); 59 | xavante_log = lua_tostring(L, -1); 60 | } 61 | if(InterlockedExchange(&exit_thread, 0)) 62 | lua_pushboolean(L, 1); 63 | else 64 | lua_pushboolean(L, 0); 65 | return 1; 66 | } 67 | 68 | static DWORD GetModulePath( HINSTANCE hInst, LPTSTR pszBuffer, DWORD dwSize ) 69 | // 70 | // Return the size of the path in bytes. 71 | { 72 | DWORD dwLength = GetModuleFileName( hInst, pszBuffer, dwSize ); 73 | if( dwLength ) 74 | { 75 | while( dwLength && pszBuffer[ dwLength ] != '.' ) 76 | { 77 | dwLength--; 78 | } 79 | 80 | if( dwLength ) 81 | pszBuffer[ dwLength ] = '\000'; 82 | } 83 | return dwLength; 84 | } 85 | 86 | void LuaThread(void *) { 87 | char name[MAX_PATH]; 88 | DWORD dwLength; 89 | exit_thread = 0; 90 | 91 | // Initialize Lua 92 | L = lua_open(); 93 | luaL_openlibs(L); 94 | 95 | lua_pushcfunction(L, (lua_CFunction)Alert); 96 | lua_setglobal(L, "_ALERT"); 97 | 98 | // Set finish function 99 | lua_pushcfunction(L, (lua_CFunction)CheckExit); 100 | lua_setglobal(L, "XAVANTE_ISFINISHED"); 101 | 102 | // Set select timeout 103 | lua_pushnumber(L, SELECT_TIMEOUT); 104 | lua_setglobal(L, "XAVANTE_TIMEOUT"); 105 | 106 | // Call helper to find paths 107 | dwLength = GetModulePath( NULL, name, MAX_PATH ); 108 | if(dwLength) { /* Optional bootstrap */ 109 | strcat(name, ".lua"); 110 | if(!luaL_loadfile (L, name)) { 111 | if(lua_pcall (L, 0, LUA_MULTRET, 0)) { 112 | MessageBox(currenthWnd, lua_tostring(L, -1), 113 | "Error in Bootstrap Helper", MB_ICONERROR | MB_OK | MB_APPLMODAL); 114 | xavante_started = 0; 115 | lua_close(L); 116 | if(aux) fclose(aux); 117 | if(log) fclose(log); 118 | ReleaseSemaphore(hStopSemaphore, 1, NULL); 119 | _endthread(); 120 | } 121 | } 122 | } 123 | 124 | // Start Xavante 125 | if (luaL_loadstring(L, xavante_start)) { 126 | MessageBox(currenthWnd, lua_tostring(L, -1), 127 | "Error loading xavante_start", MB_ICONERROR | MB_OK | MB_APPLMODAL); 128 | } else if (lua_pcall(L, 0, 0, 0)) { 129 | MessageBox(currenthWnd, lua_tostring(L, -1), 130 | "Lua Error", MB_ICONERROR | MB_OK | MB_APPLMODAL); 131 | } 132 | xavante_started = 0; 133 | 134 | lua_close(L); 135 | 136 | if(aux) fclose(aux); 137 | if(log) fclose(log); 138 | 139 | ReleaseSemaphore(hStopSemaphore, 1, NULL); 140 | 141 | _endthread(); 142 | } 143 | 144 | void StartXavante() { 145 | xavante_started = 1; 146 | xavante_log = NULL; 147 | hStopSemaphore = CreateSemaphore(NULL, 0, 1, NULL); 148 | _beginthread(LuaThread, 0, NULL); 149 | } 150 | 151 | void StopXavante() { 152 | InterlockedExchange(&exit_thread, 1); 153 | WaitForSingleObject(hStopSemaphore, INFINITE); 154 | CloseHandle(hStopSemaphore); 155 | } 156 | 157 | int APIENTRY WinMain(HINSTANCE hInstance, 158 | HINSTANCE hPrevInstance, 159 | LPSTR lpCmdLine, 160 | int nCmdShow) 161 | { 162 | // TODO: Place code here. 163 | MSG msg; 164 | HACCEL hAccelTable; 165 | HANDLE singleton_mutex; 166 | 167 | LoadString(GetModuleHandle(NULL), 1, xavante_start, 168 | sizeof(xavante_start)/sizeof(TCHAR)); 169 | 170 | singleton_mutex = CreateMutex(NULL, TRUE, "XavanteTray"); 171 | 172 | if(GetLastError() == ERROR_ALREADY_EXISTS) return 1; 173 | 174 | // Initialize global strings 175 | MyRegisterClass(hInstance); 176 | 177 | // Perform application initialization: 178 | if (!InitInstance (hInstance, nCmdShow)) 179 | { 180 | return FALSE; 181 | } 182 | 183 | hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_XAVANTETRAY); 184 | 185 | if(strcmp(lpCmdLine, "--start") == 0) { 186 | StartXavante(); 187 | TrayIcon.SetIcon(IDI_XAVANTESTART); 188 | TrayIcon.SetMenuID(IDR_POPUP_CLOSE); 189 | } 190 | 191 | // Main message loop: 192 | while (GetMessage(&msg, NULL, 0, 0)) 193 | { 194 | if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 195 | { 196 | TranslateMessage(&msg); 197 | DispatchMessage(&msg); 198 | } 199 | } 200 | 201 | return msg.wParam; 202 | } 203 | 204 | 205 | 206 | // 207 | // FUNCTION: MyRegisterClass() 208 | // 209 | // PURPOSE: Registers the window class. 210 | // 211 | // COMMENTS: 212 | // 213 | // This function and its usage is only necessary if you want this code 214 | // to be compatible with Win32 systems prior to the 'RegisterClassEx' 215 | // function that was added to Windows 95. It is important to call this function 216 | // so that the application will get 'well formed' small icons associated 217 | // with it. 218 | // 219 | ATOM MyRegisterClass(HINSTANCE hInstance) 220 | { 221 | WNDCLASSEX wcex; 222 | 223 | wcex.cbSize = sizeof(WNDCLASSEX); 224 | 225 | wcex.style = CS_HREDRAW | CS_VREDRAW; 226 | wcex.lpfnWndProc = (WNDPROC)WndProc; 227 | wcex.cbClsExtra = 0; 228 | wcex.cbWndExtra = 0; 229 | wcex.hInstance = hInstance; 230 | wcex.hIcon = (HICON) LoadImage(hInstance, 231 | (LPCTSTR)IDI_XAVANTETRAY, 232 | IMAGE_ICON, 233 | 32, 32, 234 | LR_DEFAULTCOLOR); 235 | wcex.hCursor = LoadCursor(NULL, IDC_ARROW); 236 | wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); 237 | wcex.lpszMenuName = NULL; 238 | wcex.lpszClassName = _T("XavanteWndClass"); 239 | wcex.hIconSm = (HICON) LoadImage(hInstance, 240 | (LPCTSTR)IDI_XAVANTETRAY, 241 | IMAGE_ICON, 242 | 16, 16, 243 | LR_DEFAULTCOLOR); 244 | 245 | return RegisterClassEx(&wcex); 246 | } 247 | 248 | // 249 | // FUNCTION: InitInstance(HANDLE, int) 250 | // 251 | // PURPOSE: Saves instance handle and creates main window 252 | // 253 | // COMMENTS: 254 | // 255 | // In this function, we save the instance handle in a global variable and 256 | // create and display the main program window. 257 | // 258 | BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) 259 | { 260 | HWND hWnd; 261 | 262 | hInst = hInstance; // Store instance handle in our global variable 263 | 264 | hWnd = CreateWindow(_T("XavanteWndClass"), _T("Xavante Launcher"), WS_OVERLAPPEDWINDOW, 265 | CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); 266 | 267 | if (!hWnd) 268 | { 269 | return FALSE; 270 | } 271 | 272 | // Create the tray icon 273 | if (!TrayIcon.Create(hInstance, 274 | hWnd, // Parent window 275 | WM_ICON_NOTIFY, // Icon notify message to use 276 | _T("Xavante Launcher - Right click for options"), // tooltip 277 | (HICON) LoadImage(hInstance, 278 | (LPCTSTR)IDI_XAVANTESTOP, 279 | IMAGE_ICON, 280 | 16, 16, 281 | LR_DEFAULTCOLOR), 282 | IDR_POPUP_MENU)) 283 | return FALSE; 284 | 285 | // ShowWindow(hWnd, nCmdShow); 286 | UpdateWindow(hWnd); 287 | 288 | return TRUE; 289 | } 290 | 291 | // 292 | // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) 293 | // 294 | // PURPOSE: Processes messages for the main window. 295 | // 296 | // WM_COMMAND - process the application menu 297 | // WM_PAINT - Paint the main window 298 | // WM_DESTROY - post a quit message and return 299 | // 300 | // 301 | LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 302 | { 303 | STARTUPINFO si; 304 | PROCESS_INFORMATION pi; 305 | int wmId, wmEvent; 306 | 307 | currenthWnd = hWnd; 308 | 309 | switch (message) 310 | { 311 | case WM_ICON_NOTIFY: 312 | return TrayIcon.OnTrayNotification(wParam, lParam); 313 | 314 | case WM_COMMAND: 315 | wmId = LOWORD(wParam); 316 | wmEvent = HIWORD(wParam); 317 | // Parse the menu selections: 318 | switch (wmId) 319 | { 320 | case IDM_CYCLE: 321 | if(xavante_started) { 322 | StopXavante(); 323 | TrayIcon.SetIcon(IDI_XAVANTESTOP); 324 | TrayIcon.SetMenuID(IDR_POPUP_MENU); 325 | } else { 326 | StartXavante(); 327 | TrayIcon.SetIcon(IDI_XAVANTESTART); 328 | TrayIcon.SetMenuID(IDR_POPUP_CLOSE); 329 | } 330 | break; 331 | case IDM_ABOUT: 332 | DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); 333 | break; 334 | /* case IDM_SHOWLOG: 335 | if(xavante_log) { 336 | execlp("cmd.exe", "cmd.exe", "/c", "start", "notepad.exe", 337 | "\"C:\\LuaRocks\\kepler\\log\\xavante.log\"", NULL); 338 | } else MessageBox(hWnd, "Please start Xavante at least once.", 339 | "Log not Found", MB_ICONERROR | MB_OK | MB_APPLMODAL); 340 | break;*/ 341 | case IDM_EXIT: 342 | if(xavante_started) 343 | StopXavante(); 344 | DestroyWindow(hWnd); 345 | break; 346 | default: 347 | return DefWindowProc(hWnd, message, wParam, lParam); 348 | } 349 | break; 350 | case WM_DESTROY: 351 | PostQuitMessage(0); 352 | break; 353 | default: 354 | return DefWindowProc(hWnd, message, wParam, lParam); 355 | } 356 | return 0; 357 | } 358 | 359 | // Mesage handler for about box. 360 | LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) 361 | { 362 | switch (message) 363 | { 364 | case WM_INITDIALOG: 365 | return TRUE; 366 | 367 | case WM_COMMAND: 368 | if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 369 | { 370 | EndDialog(hDlg, LOWORD(wParam)); 371 | return TRUE; 372 | } 373 | break; 374 | } 375 | return FALSE; 376 | } 377 | -------------------------------------------------------------------------------- /src/xavantetray/XavanteTray.h: -------------------------------------------------------------------------------- 1 | 2 | #if !defined(AFX_XAVANTETRAY_H__4310421A_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_) 3 | #define AFX_XAVANTETRAY_H__4310421A_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_ 4 | 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | 9 | #include "resource.h" 10 | 11 | 12 | #endif // !defined(AFX_XAVANTETRAY_H__4310421A_F2C1_11D2_A9E9_8EA47C000000__INCLUDED_) 13 | -------------------------------------------------------------------------------- /src/xavantetray/XavanteTray.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #define APSTUDIO_HIDDEN_SYMBOLS 11 | #include "windows.h" 12 | #undef APSTUDIO_HIDDEN_SYMBOLS 13 | #include "resource.h" 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | #undef APSTUDIO_READONLY_SYMBOLS 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // English (U.S.) resources 20 | 21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 22 | #ifdef _WIN32 23 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 24 | #pragma code_page(1252) 25 | #endif //_WIN32 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | // 29 | // Icon 30 | // 31 | 32 | // Icon with lowest ID value placed first to ensure application icon 33 | // remains consistent on all systems. 34 | IDI_XAVANTETRAY ICON DISCARDABLE "XavanteTray.ICO" 35 | IDI_XAVANTESTART ICON DISCARDABLE "start.ico" 36 | IDI_XAVANTESTOP ICON DISCARDABLE "stop.ico" 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | // 40 | // Menu 41 | // 42 | 43 | IDR_POPUP_MENU MENU DISCARDABLE 44 | BEGIN 45 | POPUP "POPUP" 46 | BEGIN 47 | MENUITEM "Start Xavante", IDM_CYCLE 48 | // MENUITEM "Show Log...", IDM_SHOWLOG 49 | MENUITEM "About Xavante Launcher...", IDM_ABOUT 50 | MENUITEM "Exit Launcher", IDM_EXIT 51 | END 52 | END 53 | 54 | IDR_POPUP_CLOSE MENU DISCARDABLE 55 | BEGIN 56 | POPUP "POPUP" 57 | BEGIN 58 | MENUITEM "Stop Xavante", IDM_CYCLE 59 | // MENUITEM "Show Log...", IDM_SHOWLOG 60 | MENUITEM "About Xavante Launcher...", IDM_ABOUT 61 | MENUITEM "Exit Launcher", IDM_EXIT 62 | END 63 | END 64 | 65 | 66 | ///////////////////////////////////////////////////////////////////////////// 67 | // 68 | // Accelerator 69 | // 70 | 71 | IDC_XAVANTETRAY ACCELERATORS MOVEABLE PURE 72 | BEGIN 73 | "?", IDM_ABOUT, ASCII, ALT 74 | "/", IDM_ABOUT, ASCII, ALT 75 | END 76 | 77 | 78 | ///////////////////////////////////////////////////////////////////////////// 79 | // 80 | // Dialog 81 | // 82 | 83 | IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 256, 69 84 | STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU 85 | CAPTION "About" 86 | FONT 8, "MS Sans Serif" 87 | BEGIN 88 | LTEXT "Xavante 2.0 Launcher (v 1.2)",IDC_STATIC,64,8,119,8, 89 | SS_NOPREFIX 90 | LTEXT "Copyright (C) 2005-2007 - Kepler Project",IDC_STATIC,64,24, 91 | 117,8 92 | DEFPUSHBUTTON "OK",IDOK,192,48,56,16,WS_GROUP 93 | CONTROL 134,IDC_STATIC,"Static",SS_BITMAP,7,4,43,39 94 | LTEXT "http://www.keplerproject.org",IDC_STATIC,64,40,92,8 95 | END 96 | 97 | 98 | #ifdef APSTUDIO_INVOKED 99 | ///////////////////////////////////////////////////////////////////////////// 100 | // 101 | // TEXTINCLUDE 102 | // 103 | 104 | 2 TEXTINCLUDE DISCARDABLE 105 | BEGIN 106 | "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" 107 | "#include ""windows.h""\r\n" 108 | "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" 109 | "#include ""resource.h""\r\n" 110 | "\0" 111 | END 112 | 113 | 3 TEXTINCLUDE DISCARDABLE 114 | BEGIN 115 | "\r\n" 116 | "\0" 117 | END 118 | 119 | #endif // APSTUDIO_INVOKED 120 | 121 | 122 | ///////////////////////////////////////////////////////////////////////////// 123 | // 124 | // DESIGNINFO 125 | // 126 | 127 | #ifdef APSTUDIO_INVOKED 128 | GUIDELINES DESIGNINFO DISCARDABLE 129 | BEGIN 130 | IDD_ABOUTBOX, DIALOG 131 | BEGIN 132 | RIGHTMARGIN, 252 133 | BOTTOMMARGIN, 65 134 | END 135 | END 136 | #endif // APSTUDIO_INVOKED 137 | 138 | #endif // English (U.S.) resources 139 | ///////////////////////////////////////////////////////////////////////////// 140 | 141 | 142 | ///////////////////////////////////////////////////////////////////////////// 143 | // Portuguese (Brazil) resources 144 | 145 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) 146 | #ifdef _WIN32 147 | LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN 148 | #pragma code_page(1252) 149 | #endif //_WIN32 150 | 151 | ///////////////////////////////////////////////////////////////////////////// 152 | // 153 | // Bitmap 154 | // 155 | 156 | IDB_XAVANTELOGO BITMAP DISCARDABLE "xavante.bmp" 157 | #endif // Portuguese (Brazil) resources 158 | ///////////////////////////////////////////////////////////////////////////// 159 | 160 | 161 | ///////////////////////////////////////////////////////////////////////////// 162 | // English (Australia) resources 163 | 164 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) 165 | #ifdef _WIN32 166 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS 167 | #pragma code_page(1252) 168 | #endif //_WIN32 169 | 170 | #ifdef APSTUDIO_INVOKED 171 | ///////////////////////////////////////////////////////////////////////////// 172 | // 173 | // TEXTINCLUDE 174 | // 175 | 176 | 1 TEXTINCLUDE DISCARDABLE 177 | BEGIN 178 | "resource.h\0" 179 | END 180 | 181 | #endif // APSTUDIO_INVOKED 182 | 183 | #endif // English (Australia) resources 184 | ///////////////////////////////////////////////////////////////////////////// 185 | 186 | 187 | 188 | #ifndef APSTUDIO_INVOKED 189 | ///////////////////////////////////////////////////////////////////////////// 190 | // 191 | // Generated from the TEXTINCLUDE 3 resource. 192 | // 193 | 194 | 195 | ///////////////////////////////////////////////////////////////////////////// 196 | #endif // not APSTUDIO_INVOKED 197 | 198 | -------------------------------------------------------------------------------- /src/xavantetray/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by XavanteTray.rc 4 | // 5 | #define IDC_MYICON 2 6 | #define IDD_XAVANTETRAY_DIALOG 102 7 | #define IDD_ABOUTBOX 103 8 | #define IDS_APP_TITLE 103 9 | #define IDM_ABOUT 104 10 | #define IDM_EXIT 105 11 | #define IDS_HELLO 106 12 | #define IDI_XAVANTETRAY 107 13 | #define IDI_XAVANTESTART 108 14 | #define IDC_XAVANTETRAY 109 15 | #define IDI_XAVANTESTOP 109 16 | #define IDR_MAINFRAME 128 17 | #define IDR_POPUP_MENU 130 18 | #define IDI_ICON1 130 19 | #define IDI_ICON2 131 20 | #define IDR_POPUP_CLOSE 131 21 | #define IDI_ICON3 132 22 | #define IDI_ICON4 133 23 | #define IDB_XAVANTELOGO 134 24 | #define ID_POPUP_OPTION1 32771 25 | #define ID_POPUP_OPTION2 32772 26 | #define ID_POPUP_ANIMATE 32773 27 | #define IDM_ANIMATE 32773 28 | #define IDM_CYCLE 32773 29 | #define IDM_SHOWLOG 32775 30 | #define ID_APP_ABOUT 0xE140 31 | #define ID_APP_EXIT 0xE141 32 | #define IDC_STATIC -1 33 | 34 | // Next default values for new objects 35 | // 36 | #ifdef APSTUDIO_INVOKED 37 | #ifndef APSTUDIO_READONLY_SYMBOLS 38 | #define _APS_NEXT_RESOURCE_VALUE 135 39 | #define _APS_NEXT_COMMAND_VALUE 32776 40 | #define _APS_NEXT_CONTROL_VALUE 1000 41 | #define _APS_NEXT_SYMED_VALUE 110 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/xavantetray/start.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/src/xavantetray/start.ico -------------------------------------------------------------------------------- /src/xavantetray/stop.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/src/xavantetray/stop.ico -------------------------------------------------------------------------------- /src/xavantetray/xavante.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/src/xavantetray/xavante.bmp -------------------------------------------------------------------------------- /web/app.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cgilua.cgi 2 | 3 | -- Basic application bootstraper 4 | local name, path_info = cgilua.splitonfirst(cgilua.script_vpath) 5 | 6 | if name == nil or name == "" then 7 | if io.open("index.lua") then 8 | cgilua.handle("index.lua") 9 | elseif io.open("index.lp") then 10 | cgilua.handle("index.lp") 11 | else 12 | error("No script defined") 13 | end 14 | else 15 | local appdir = CGILUA_APPS.."/"..name 16 | local appinit = "init.lua" 17 | lfs.chdir(appdir) 18 | 19 | if io.open(appinit) then 20 | -- checks for authentication if necessary 21 | if cgilua.authentication and not cgilua.authentication.username() then 22 | cgilua.redirect(cgilua.authentication.checkURL()) 23 | else 24 | -- prepares the application environment 25 | package.path = CGILUA_APPS.."/"..name.."/lua/?.lua;"..package.path 26 | cgilua.script_pdir = CGILUA_APPS.."/"..name 27 | cgilua.script_file = nil 28 | cgilua.script_vdir = "/" 29 | cgilua.urlpath = cgilua.urlpath.."/"..name 30 | cgilua.script_vpath = path_info 31 | cgilua.app_name = name 32 | 33 | cgilua.doif(appinit) 34 | end 35 | else 36 | cgilua.handle(cgilua.script_pdir..name..path_info) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /web/css/doc.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 1em; 3 | margin-right: 1em; 4 | font-family: arial, helvetica, geneva, sans-serif; 5 | background-color:#ffffff; margin:0px; 6 | } 7 | 8 | code { 9 | font-family: "Andale Mono", monospace; 10 | } 11 | 12 | tt { 13 | font-family: "Andale Mono", monospace; 14 | } 15 | 16 | body, td, th { font-size: 11pt; } 17 | 18 | h1, h2, h3, h4 { margin-left: 0em; } 19 | 20 | textarea, pre, tt { font-size:10pt; } 21 | body, td, th { color:#000000; } 22 | small { font-size:0.85em; } 23 | h1 { font-size:1.5em; } 24 | h2 { font-size:1.25em; } 25 | h3 { font-size:1.15em; } 26 | h4 { font-size:1.06em; } 27 | 28 | a:link { font-weight:bold; color: #004080; text-decoration: none; } 29 | a:visited { font-weight:bold; color: #006699; text-decoration: none; } 30 | a:link:hover { text-decoration:underline; } 31 | hr { color:#cccccc } 32 | img { border-width: 0px; } 33 | 34 | 35 | h3 { padding-top: 1em; } 36 | 37 | p { margin-left: 1em; } 38 | 39 | p.name { 40 | font-family: "Andale Mono", monospace; 41 | padding-top: 1em; 42 | margin-left: 0em; 43 | } 44 | 45 | blockquote { margin-left: 3em; } 46 | 47 | .example { 48 | background-color: rgb(245, 245, 245); 49 | border-top-width: 1px; 50 | border-right-width: 1px; 51 | border-bottom-width: 1px; 52 | border-left-width: 1px; 53 | border-top-style: solid; 54 | border-right-style: solid; 55 | border-bottom-style: solid; 56 | border-left-style: solid; 57 | border-top-color: silver; 58 | border-right-color: silver; 59 | border-bottom-color: silver; 60 | border-left-color: silver; 61 | padding: 1em; 62 | margin-left: 1em; 63 | margin-right: 1em; 64 | font-family: "Andale Mono", monospace; 65 | font-size: smaller; 66 | } 67 | 68 | 69 | hr { 70 | margin-left: 0em; 71 | background: #00007f; 72 | border: 0px; 73 | height: 1px; 74 | } 75 | 76 | ul { list-style-type: disc; } 77 | 78 | table.index { border: 1px #00007f; } 79 | table.index td { text-align: left; vertical-align: top; } 80 | table.index ul { padding-top: 0em; margin-top: 0em; } 81 | 82 | table { 83 | border: 1px solid black; 84 | border-collapse: collapse; 85 | margin-left: auto; 86 | margin-right: auto; 87 | } 88 | th { 89 | border: 1px solid black; 90 | padding: 0.5em; 91 | } 92 | td { 93 | border: 1px solid black; 94 | padding: 0.5em; 95 | } 96 | div.header, div.footer { margin-left: 0em; } 97 | 98 | #container 99 | { 100 | margin-left: 1em; 101 | margin-right: 1em; 102 | background-color: #f0f0f0; 103 | } 104 | 105 | #product 106 | { 107 | text-align: center; 108 | border-bottom: 1px solid #cccccc; 109 | background-color: #ffffff; 110 | } 111 | 112 | #product big { 113 | font-size: 2em; 114 | } 115 | 116 | #product_logo 117 | { 118 | } 119 | 120 | #product_name 121 | { 122 | } 123 | 124 | #product_description 125 | { 126 | } 127 | 128 | #main 129 | { 130 | background-color: #f0f0f0; 131 | border-left: 2px solid #cccccc; 132 | } 133 | 134 | #navigation 135 | { 136 | float: left; 137 | width: 12em; 138 | margin: 0; 139 | vertical-align: top; 140 | background-color: #f0f0f0; 141 | overflow:visible; 142 | } 143 | 144 | #navigation h1 { 145 | background-color:#e7e7e7; 146 | font-size:1.1em; 147 | color:#000000; 148 | text-align:left; 149 | margin:0px; 150 | padding:0.2em; 151 | border-top:1px solid #dddddd; 152 | border-bottom:1px solid #dddddd; 153 | } 154 | 155 | #navigation ul 156 | { 157 | font-size:1em; 158 | list-style-type: none; 159 | padding: 0; 160 | margin: 1px; 161 | } 162 | 163 | #navigation li 164 | { 165 | text-indent: -1em; 166 | margin: 0em 0em 0em 0.5em; 167 | display: block; 168 | padding: 3px 0px 0px 12px; 169 | } 170 | 171 | #navigation li li a 172 | { 173 | padding: 0px 3px 0px -1em; 174 | } 175 | 176 | #content 177 | { 178 | margin-left: 12em; 179 | padding: 1em; 180 | border-left: 2px solid #cccccc; 181 | border-right: 2px solid #cccccc; 182 | background-color: #ffffff; 183 | } 184 | 185 | #about 186 | { 187 | clear: both; 188 | margin: 0; 189 | padding: 5px; 190 | border-top: 2px solid #cccccc; 191 | background-color: #ffffff; 192 | } 193 | 194 | @media print { 195 | body { 196 | font: 10pt "Times New Roman", "TimeNR", Times, serif; 197 | } 198 | a { font-weight:bold; color: #004080; text-decoration: underline; } 199 | 200 | #main { background-color: #ffffff; border-left: 0px; } 201 | #container { margin-left: 2%; margin-right: 2%; background-color: #ffffff; } 202 | 203 | #content { margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; } 204 | 205 | #navigation { display: none; 206 | } 207 | 208 | #product_logo 209 | { 210 | display: none; 211 | } 212 | 213 | #about img 214 | { 215 | display: none; 216 | } 217 | 218 | .example { 219 | font-family: "Andale Mono", monospace; 220 | font-size: 8pt; 221 | page-break-inside: avoid; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /web/htaccess_cgi: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options +ExecCGI 4 | AddHandler cgi-script .lua 5 | AddHandler cgi-script .lp 6 | AddHandler cgi-script .ws 7 | AddHandler cgi-script .op 8 | DirectoryIndex index.lp 9 | 10 | -------------------------------------------------------------------------------- /web/htaccess_fcgi: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options +ExecCGI 4 | AddHandler fcgid-script .lua 5 | AddHandler fcgid-script .lp 6 | AddHandler fcgid-script .ws 7 | AddHandler fcgid-script .op 8 | FCGIWrapper "/usr/bin/env cgilua.fcgi" .lua 9 | FCGIWrapper "/usr/bin/env cgilua.fcgi" .lp 10 | FCGIWrapper "/usr/bin/env wsapi.fcgi" .ws 11 | FCGIWrapper "/usr/bin/env op.fcgi" .op 12 | DirectoryIndex index.lp 13 | 14 | -------------------------------------------------------------------------------- /web/img/keplerproject.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/web/img/keplerproject.gif -------------------------------------------------------------------------------- /web/img/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/web/img/test.jpg -------------------------------------------------------------------------------- /web/index.lp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cgilua.cgi 2 | 3 | 5 | 6 | 7 | Welcome to Kepler! 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 20 |
21 |
Welcome page
22 |
23 | 24 |
25 | 26 | 59 | 60 |
61 | 62 |

Congratulations!

63 | 64 |

65 | If you are reading this page, 66 | <%= cgilua.servervariable("SERVER_SOFTWARE") %> 67 | has been successfully configured for CGILua on your system using 68 | <%= SAPI.Info._VERSION %> and <%= _VERSION %>. 69 |

70 | 71 |

72 | This is a page generated by CGILua that points to the installed modules documentation. 73 | It serves both as a documentation index and as a simple example of a dynamic Lua Page. 74 |

75 | 76 |

What now?

77 |

78 | From here you can also run some tests. 79 |

80 | 81 |

Contact us

82 | 83 |

84 | For more information on Kepler modules please 85 | contact us. 86 | Comments are welcome! 87 |

88 | 89 |

90 | You can also reach other Kepler developers and users on the Kepler 91 | Project mailing list. 92 |

93 | 94 |

95 | Copyright 2004-2007 - Kepler Project 96 |

97 | 98 |
99 | 100 |
101 | 102 |
103 |

Valid XHTML 1.0

104 |

$Id: index.lp,v 1.1 2008/06/30 14:29:59 carregal Exp $

105 |
106 | 107 |
108 | 109 | 110 | -------------------------------------------------------------------------------- /web/orbit/pages/bar.op: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env op.cgi 2 | 3 |

This is bar, and you passed $web|input|msg!

4 | -------------------------------------------------------------------------------- /web/orbit/pages/foo.op: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env op.cgi 2 | 3 | 4 | 5 |

Hello Cosmo!

6 |

I am in $web|real_path, and the script is 7 | $web|script_name.

8 | $lua{[[ 9 | if not web.input.msg then 10 | web.input.msg = "nothing" 11 | end 12 | ]]} 13 |

You passed: $web|input|msg.

14 | $include{ "bar.op" } 15 | 16 | 17 | -------------------------------------------------------------------------------- /web/orbit/pages/index.op: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env op.cgi 2 | 3 | 5 | 6 | 7 | Welcome to Kepler! 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 20 |
21 |
Welcome page
22 |
23 | 24 |
25 | 26 | 52 | 53 |
54 | 55 |

Congratulations!

56 | 57 |

58 | If you are reading this page, 59 | $web|vars|SERVER_SOFTWARE 60 | has been successfully configured for Orbit Pages on your system. 61 |

62 | 63 |

64 | This is a page generated by CGILua that points to the installed modules documentation. 65 | It serves both as a documentation index and as a simple example of a dynamic Lua Page. 66 |

67 | 68 |

What now?

69 |

70 | From here you can also run some tests. 71 |

72 | 73 |

Contact us

74 | 75 |

76 | For more information on Kepler modules please 77 | contact us. 78 | Comments are welcome! 79 |

80 | 81 |

82 | You can also reach other Kepler developers and users on the Kepler 83 | Project mailing list. 84 |

85 | 86 |

87 | Copyright 2004-2007 - Kepler Project 88 |

89 | 90 |
91 | 92 |
93 | 94 |
95 |

Valid XHTML 1.0

96 |

$Id: index.op,v 1.1 2008/06/30 14:29:59 carregal Exp $

97 |
98 | 99 |
100 | 101 | 102 | -------------------------------------------------------------------------------- /web/orbit/pages/items.op: -------------------------------------------------------------------------------- 1 | $lua{[[ 2 | items = todo_list:find_all{ order = "created_at desc" } 3 | ]]} 4 | $if{$items|1}[==[ 5 | $items[[ 6 |
  • $title 7 | Remove
  • 8 | ]] 9 | ]==],[==[Nothing to do!]==] 10 | -------------------------------------------------------------------------------- /web/orbit/pages/test.op: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env op.cgi 2 | 3 | 5 | 6 | 7 | Orbit Pages Test 8 | 9 | 10 | $lua{[[ 11 | if web.input.user then 12 | web:set_cookie("cookie_kepler", web.input.user) 13 | end 14 | ]]} 15 | 16 | 17 | 18 | 19 |
    20 | 21 |
    22 | 25 |
    26 |
    Orbit Pages simple tests
    27 |
    28 | 29 |
    30 | 31 | 56 | 57 |
    58 | 59 | 60 |

    Form Handling

    61 | 62 |

    63 | Entering values on this form should display them as values in the first submission, 64 | and as a cookie in the next submission 65 |

    66 | 67 |
    68 | 69 | 70 | 71 | 72 |
    73 | 74 |

    75 | The values should show the previous POST 76 |

    77 | 78 |

    79 | Values: Username = $if{$web|input|user}[[$it]],[[(not set)]], Password = $if{$web|input|pass}[[$it]],[[(not set)]] 80 |

    81 | 82 |

    Cookies test

    83 | 84 |

    85 | Here you should see the values posted before the ones shown above 86 |

    87 | 88 |

    89 | cookie_kepler = $if{$web|cookies|cookie_kepler}[[$it]],[[(not set)]] 90 |

    91 | 92 |

    File Upload

    93 | 94 |

    Choose a file to upload, press "Upload" and a link to the file should 95 | appear below with the corresponding "Remove" button. 96 |

    97 | 98 | 99 |
    100 | 101 | $lua{[[ 102 | local f = web.input.file 103 | upload = {} 104 | if f then 105 | local name = f.name 106 | local bytes = f.contents 107 | local dest = io.open(web.real_path .. "/" .. name, "wb") 108 | if dest then 109 | dest:write(bytes) 110 | dest:close() 111 | upload[1] = name 112 | end 113 | end 114 | ]]} 115 | $upload[[ 116 | $it 117 |
    118 | 119 | 120 |
    121 | ]] 122 | $lua{[[ 123 | if web.input.remove then 124 | os.remove(web.input.filename) 125 | end 126 | ]]} 127 | 128 | $lua{[=[ 129 | function showtable(arg) 130 | local t = arg[1] 131 | local out = {} 132 | local put = function (s) table.insert(out, s) end 133 | put "{" 134 | for i,v in pairs (t) do 135 | put("\n") 136 | if type(v) == "table" then 137 | local vv = "{\n" 138 | for a,b in pairs(v) do 139 | vv = string.format ("%s %s = [[%s]],\n", vv, a, tostring(b)) 140 | end 141 | v = vv.." }," 142 | put (string.format (" %s = %s", i, tostring(v))) 143 | else 144 | put (string.format (" %s = [[%s]],", i, tostring(v))) 145 | end 146 | end 147 | if next(t) then 148 | put "\n" 149 | end 150 | put "}\n" 151 | return table.concat(out) 152 | end 153 | ]=]} 154 | 155 |

    web.GET

    156 | 157 |
    158 | $showtable{ $web|GET }
    159 | 
    160 | 161 |

    web.POST

    162 | 163 |
    164 | $showtable{ $web|POST }
    165 | 
    166 | 167 |

    Web Variables

    168 | 169 | 170 | $lua{[[ 171 | vars = { 172 | "real_path", "path_info", "doc_root", "script_name", "path_translated", "prefix", "method" 173 | } 174 | webvar = function (arg) return web[arg[1] ] end 175 | ]]} 176 | $vars[[ 177 | 178 | ]] 179 |
    web.$it$webvar{ $it }
    180 | 181 | 182 |

    Server Variables

    183 | 184 | 185 | $lua{[[ 186 | vars = { 187 | "SERVER_SOFTWARE", "SERVER_NAME", "SERVER_PROTOCOL", "SERVER_PORT", 188 | "GATEWAY_INTERFACE", "REQUEST_METHOD", 189 | "SCRIPT_NAME", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", 190 | "CONTENT_TYPE", "CONTENT_LENGTH", 191 | "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_USER", "REMOTE_IDENT", 192 | "AUTH_TYPE", 193 | } 194 | servervar = function (arg) return web.vars[arg[1] ] end 195 | ]]} 196 | $vars[[ 197 | 198 | ]] 199 |
    $it$servervar{ $it }
    200 | 201 |

    Date

    202 | 203 |

    Today is: $os|date

    204 | 205 |

    Image test

    206 | 207 |

    Here should be a small image: a small photograph

    208 | 209 |

    FileSystem test

    210 | 211 |

    212 | $lua{[[ 213 | dirname = web.doc_root or "" 214 | dir = {} 215 | for file in lfs.dir(dirname) do dir[#dir + 1] = "   "..file.."
    " end 216 | ]]} 217 | Iterating over $dirname $dir[[$it]] 218 |

    219 | 220 |

    Containment test

    221 | 222 |

    223 | $lua{[[ if not x then x = 1 else x = x + 1 end ]]} 224 | Expected value: 1, actual value: $x. 225 |

    226 | 227 | 228 |
    229 | 230 |
    231 | 232 |
    233 |

    Valid XHTML 1.0

    234 |

    $Id: test.op,v 1.1 2008/06/30 14:29:59 carregal Exp $

    235 |
    236 | 237 |
    238 | 239 | 240 | -------------------------------------------------------------------------------- /web/orbit/pages/todo.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keplerproject/kepler/8c58466a21614aac2fbbeb360bf339e859adb921/web/orbit/pages/todo.db -------------------------------------------------------------------------------- /web/orbit/pages/todo.op: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env op.cgi 2 | 3 | $lua{[[ 4 | require "luasql.sqlite3" 5 | app.conn = app.conn or luasql.sqlite3():connect(web.real_path .. "/todo.db") 6 | mapper.conn = app.conn 7 | todo_list = model("todo_list") 8 | if web.method == "post" then 9 | if web.input.id then 10 | local item = todo_list:find(tonumber(web.input.id)) 11 | if web.input.toggle then 12 | item.done = not item.done 13 | item:save() 14 | elseif web.input.remove then 15 | item:delete() 16 | forward("items.op") 17 | end 18 | finish() 19 | else 20 | local item = todo_list:new() 21 | item.title = web.input.item or "" 22 | item:save() 23 | forward("items.op") 24 | end 25 | end 26 | ]]} 27 | 28 | 29 | 30 | To-do List 31 | 32 | 55 | 60 | 61 | 62 |

    To-do

    63 |
      64 | $include{ "items.op" } 65 |
    66 |
    67 | 68 | 69 |
    70 | 71 | 72 | -------------------------------------------------------------------------------- /web/orbit/pages/todo.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE todo_list 2 | ("id" INTEGER PRIMARY KEY NOT NULL, 3 | "title" VARCHAR(255) DEFAULT "", 4 | "done" BOOLEAN DEFAULT "f", 5 | "created_at" DATETIME); 6 | -------------------------------------------------------------------------------- /web/orbit/pages/todo.ws: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env wsapi.cgi 2 | 3 | require "orbit" 4 | require "orbit.pages" 5 | require "cosmo" 6 | require "luasql.sqlite3" 7 | 8 | local todo = orbit.new() 9 | 10 | todo.mapper.conn = luasql.sqlite3():connect(todo.real_path .. "/todo.db") 11 | 12 | local todo_list = todo:model("todo_list") 13 | 14 | local function item_list() 15 | return todo_list:find_all{ order = "created_at desc" } 16 | end 17 | 18 | local function index(web) 19 | local list = web:page_inline(todo.items, { items = item_list() }) 20 | return web:page_inline(todo.index, { items = list }) 21 | end 22 | 23 | todo:dispatch_get(index, "/") 24 | 25 | local function add(web) 26 | local item = todo_list:new() 27 | item.title = web.input.item or "" 28 | item:save() 29 | return web:page_inline(todo.items, { items = item_list() }) 30 | end 31 | 32 | todo:dispatch_post(add, "/add") 33 | 34 | local function remove(web, id) 35 | local item = todo_list:find(tonumber(id)) 36 | item:delete() 37 | return web:page_inline(todo.items, { items = item_list() }) 38 | end 39 | 40 | todo:dispatch_post(remove, "/remove/(%d+)") 41 | 42 | local function toggle(web, id) 43 | local item = todo_list:find(tonumber(id)) 44 | item.done = not item.done 45 | item:save() 46 | return "toggle" 47 | end 48 | 49 | todo:dispatch_post(toggle, "/toggle/(%d+)") 50 | 51 | todo.index = [===[ 52 | 53 | 54 | To-do List 55 | 56 | 79 | 84 | 85 | 86 |

    To-do

    87 |
      88 | $items 89 |
    90 |
    91 | 92 | 93 |
    94 | 95 | 96 | ]===] 97 | 98 | todo.items = [===[ 99 | $if{$items|1}[==[ 100 | $items[[ 101 |
  • $title 102 | Remove
  • 103 | ]] 104 | ]==],[==[Nothing to do!]==] 105 | ]===] 106 | 107 | return todo 108 | -------------------------------------------------------------------------------- /web/orbit/songs/songs.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env wsapi.cgi 2 | 3 | local orbit = require"orbit" 4 | local cosmo = require"cosmo" 5 | 6 | local songs = orbit.new() 7 | 8 | function songs.index(web) 9 | local songlist = { 10 | "Sgt. Pepper's Lonely Hearts Club Band", 11 | "With a Little Help from My Friends", 12 | "Lucy in the Sky with Diamonds", 13 | "Getting Better", 14 | "Fixing a Hole", 15 | "She's Leaving Home", 16 | "Being for the Benefit of Mr. Kite!", 17 | "Within You Without You", 18 | "When I'm Sixty-Four", 19 | "Lovely Rita", 20 | "Good Morning Good Morning", 21 | "Sgt. Pepper's Lonely Hearts Club Band (Reprise)", 22 | "A Day in the Life" 23 | } 24 | return songs.layout(songs.render_index({ songs = songlist })) 25 | end 26 | 27 | songs:dispatch_get(songs.index, "/") 28 | 29 | function songs.layout(inner_html) 30 | return html{ 31 | head{ title"Song List" }, 32 | body{ inner_html } 33 | } 34 | end 35 | 36 | orbit.htmlify(songs, "layout") 37 | 38 | songs.render_index = cosmo.compile[[ 39 |

    Songs

    40 | 41 | $songs[=[]=] 42 |
    $it
    43 | ]] 44 | 45 | return songs.run 46 | -------------------------------------------------------------------------------- /web/orbit/songs/songs.ws: -------------------------------------------------------------------------------- 1 | return require("songs") 2 | -------------------------------------------------------------------------------- /web/test.lp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env cgilua.cgi 2 | 3 | 5 | 6 | 7 | CGILua Test 8 | 9 | 10 | <% 11 | require"cgilua.cookies" 12 | if cgilua.POST.user then 13 | cgilua.cookies.sethtml("cookie_kepler", cgilua.POST.user) 14 | end 15 | %> 16 | 17 | 18 | 19 | 20 |
    21 | 22 |
    23 | 26 |
    27 |
    CGILua simple tests
    28 |
    29 | 30 |
    31 | 32 | 65 | 66 |
    67 | 68 | 69 |

    Form Handling

    70 | 71 |

    72 | Entering values on this form should display them as values in the first submission, 73 | and as a cookie in the next submission 74 |

    75 | 76 |
    77 | 78 | 79 | 80 | 81 |
    82 | 83 |

    84 | The values should show the previous POST 85 |

    86 | 87 |

    88 | Values: Username = <%= cgilua.POST.user or "(not set)"%>, Password = <%= cgilua.POST.pass or "(not set)"%> 89 |

    90 | 91 |

    Cookies test

    92 | 93 |

    94 | Here you should see the values posted before the ones shown above 95 |

    96 | 97 |

    98 | cookie_kepler = <%= cgilua.cookies.get("cookie_kepler") or "(not set)" %> 99 |

    100 | 101 |

    File Upload

    102 | 103 |

    Choose a file to upload, press "Upload" and a link to the file should 104 | appear below with the corresponding "Remove" button. 105 |

    106 | 107 | 108 |
    109 | 110 | <% 111 | local f = cgilua.POST.file 112 | if f and next(f) then 113 | local _, name = cgilua.splitonlast(f.filename) 114 | local file = f.file 115 | local dest = io.open(name, "wb") 116 | if dest then 117 | local bytes = file:read("*a") 118 | dest:write(bytes) 119 | dest:close() 120 | cgilua.print(""..name.."\n") 121 | cgilua.print([[
    ]]) 122 | cgilua.print([[]]) 123 | cgilua.print([[]]) 124 | cgilua.print([[
    ]]) 125 | end 126 | end 127 | %> 128 | 129 | <% 130 | if cgilua.POST.remove then 131 | os.remove(cgilua.POST.filename) 132 | end 133 | %> 134 | 135 | <% 136 | local function showtable(t) 137 | cgilua.put "{" 138 | for i,v in pairs (t) do 139 | cgilua.put("\n") 140 | if type(v) == "table" then 141 | local vv = "{\n" 142 | for a,b in pairs(v) do 143 | vv = string.format ("%s %s = [[%s]],\n", vv, a, tostring(b)) 144 | end 145 | v = vv.." }," 146 | cgilua.put (string.format (" %s = %s", i, tostring(v))) 147 | else 148 | cgilua.put (string.format (" %s = [[%s]],", i, tostring(v))) 149 | end 150 | end 151 | if next(t) then 152 | cgilua.put "\n" 153 | end 154 | cgilua.put "}\n" 155 | end 156 | %> 157 | 158 |

    cgilua.QUERY

    159 | 160 |
    161 | <% showtable (cgilua.QUERY) %>
    162 | 
    163 | 164 |

    cgilua.POST

    165 |
    166 | <% showtable (cgilua.POST) %>
    167 | 
    168 | 169 |

    CGILua Variables

    170 | 171 | 172 | <% 173 | local vars = { 174 | "script_file", "script_path", "script_pdir", "script_vdir", "script_vpath", "urlpath", 175 | } 176 | for _, v in ipairs(vars) do %> 177 | 178 | <% end %> 179 |
    cgilua.<%= v %><%= tostring(cgilua[v]) %>
    180 | 181 | 182 |

    Server Variables

    183 | 184 | 185 | <% 186 | local vars = { 187 | "SERVER_SOFTWARE", "SERVER_NAME", "SERVER_PROTOCOL", "SERVER_PORT", 188 | "GATEWAY_INTERFACE", "REQUEST_METHOD", 189 | "SCRIPT_NAME", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", 190 | "CONTENT_TYPE", "CONTENT_LENGTH", 191 | "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_USER", "REMOTE_IDENT", 192 | "AUTH_TYPE", 193 | } 194 | for _, v in ipairs(vars) do %> 195 | 196 | <% end %> 197 |
    <%= v %><%= tostring(cgilua.servervariable(v)) %>
    198 | 199 |

    Multiple Output

    200 | 201 |

    202 | The next test should show numbers, from 1 to 3, and the string "OK" together. 203 | The first line should show the results without spaces and the second should separate them with tabs. 204 |

    205 | 206 |
    207 | cgilua.put(1, 2, 3, "OK")   --> <% cgilua.put(1, 2, 3, "OK") %>
    208 | 
    209 | 210 |

    The next test should show numbers, from 1 to 3, and the string "OK" separated by tabs.

    211 | 212 |
    213 | cgilua.print(1, 2, 3, "OK") --> <% cgilua.print(1, 2, 3, "OK") %>
    214 | 
    215 | 216 |

    Date

    217 | 218 |

    Today is: <%= os.date() %>

    219 | 220 |

    Image test

    221 | 222 |

    Here should be a small image: a small photograph

    223 | 224 |

    FileSystem test

    225 | 226 |

    227 | <% 228 | local d = lfs.currentdir () or "" 229 | cgilua.put("Iterating over "..d.."
    ") 230 | for file in lfs.dir(d) do cgilua.put("   "..file.."
    ") end 231 | %> 232 |

    233 | 234 |

    Containment test

    235 | 236 |

    237 | <% if (x == nil) then x = 1 else x = x + 1 end %> 238 | Expected value: 1, actual value: <%= x %>. 239 |

    240 | 241 | 242 |
    243 | 244 |
    245 | 246 |
    247 |

    Valid XHTML 1.0

    248 |

    $Id: test.lp,v 1.3 2008/07/03 20:34:36 carregal Exp $

    249 |
    250 | 251 |
    252 | 253 | 254 | -------------------------------------------------------------------------------- /web/wsapi/hello.ws: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env wsapi.cgi 2 | 3 | module("hello", package.seeall) 4 | 5 | function run(wsapi_env) 6 | local headers = { ["Content-type"] = "text/html" } 7 | 8 | local function hello_text() 9 | coroutine.yield("") 10 | coroutine.yield("

    Hello Wsapi!

    ") 11 | coroutine.yield("

    PATH_INFO: " .. wsapi_env.PATH_INFO .. "

    ") 12 | coroutine.yield("

    SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "

    ") 13 | coroutine.yield("") 14 | end 15 | 16 | return 200, headers, coroutine.wrap(hello_text) 17 | end 18 | 19 | return _M 20 | --------------------------------------------------------------------------------