[c7918a9] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY lua-download-http "http://www.lua.org/ftp/lua-&lua52-version;.tar.gz">
|
---|
| 8 | <!ENTITY lua-download-ftp " ">
|
---|
| 9 | <!ENTITY lua-md5sum "913fdb32207046b273fdb17aad70be13">
|
---|
| 10 | <!ENTITY lua-size "248 KB">
|
---|
| 11 | <!ENTITY lua-buildsize "3.6 MB">
|
---|
| 12 | <!ENTITY lua-time "less than 0.1 SBU">
|
---|
| 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="lua52" xreflabel="Lua-&lua52-version;">
|
---|
| 16 | <?dbhtml filename="lua52.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>Lua-&lua52-version;</title>
|
---|
| 24 |
|
---|
[d13b695] | 25 | <indexterm zone="lua52">
|
---|
[c7918a9] | 26 | <primary sortas="a-Lua">Lua</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to Lua 5.2</title>
|
---|
| 31 |
|
---|
| 32 | <para>
|
---|
| 33 | <application>Lua</application> is a powerful light-weight programming
|
---|
| 34 | language designed for extending applications. It is also frequently used
|
---|
| 35 | as a general-purpose, stand-alone language. <application>Lua</application>
|
---|
| 36 | is implemented as a small library of C functions, written in ANSI C, and
|
---|
| 37 | compiles unmodified in all known platforms. The implementation goals are
|
---|
| 38 | simplicity, efficiency, portability, and low embedding cost. The result is
|
---|
| 39 | a fast language engine with small footprint, making it ideal in embedded
|
---|
| 40 | systems too.
|
---|
| 41 | </para>
|
---|
| 42 |
|
---|
| 43 | <para>
|
---|
| 44 | This is an older verion of <application>Lua</application> needed only
|
---|
| 45 | for compatibility with other programs such as <xref linkend='wireshark'/>.
|
---|
| 46 | </para>
|
---|
| 47 |
|
---|
[4a2c778d] | 48 | &lfs101_checked;
|
---|
[c7918a9] | 49 |
|
---|
| 50 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 51 | <itemizedlist spacing="compact">
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>
|
---|
| 54 | Download (HTTP): <ulink url="&lua-download-http;"/>
|
---|
| 55 | </para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>
|
---|
| 59 | Download (FTP): <ulink url="&lua-download-ftp;"/>
|
---|
| 60 | </para>
|
---|
| 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
| 63 | <para>
|
---|
| 64 | Download MD5 sum: &lua-md5sum;
|
---|
| 65 | </para>
|
---|
| 66 | </listitem>
|
---|
| 67 | <listitem>
|
---|
| 68 | <para>
|
---|
| 69 | Download size: &lua-size;
|
---|
| 70 | </para>
|
---|
| 71 | </listitem>
|
---|
| 72 | <listitem>
|
---|
| 73 | <para>
|
---|
| 74 | Estimated disk space required: &lua-buildsize;
|
---|
| 75 | </para>
|
---|
| 76 | </listitem>
|
---|
| 77 | <listitem>
|
---|
| 78 | <para>
|
---|
| 79 | Estimated build time: &lua-time;
|
---|
| 80 | </para>
|
---|
| 81 | </listitem>
|
---|
| 82 | </itemizedlist>
|
---|
| 83 |
|
---|
| 84 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 85 | <itemizedlist spacing="compact">
|
---|
| 86 | <listitem>
|
---|
| 87 | <para>
|
---|
| 88 | Required patch:
|
---|
| 89 | <ulink url="&patch-root;/lua-&lua52-version;-shared_library-1.patch"/>
|
---|
| 90 | </para>
|
---|
| 91 | </listitem>
|
---|
| 92 | </itemizedlist>
|
---|
| 93 |
|
---|
| 94 | <para condition="html" role="usernotes">User Notes:
|
---|
| 95 | <ulink url="&blfs-wiki;/lua"/>
|
---|
| 96 | </para>
|
---|
| 97 | </sect2>
|
---|
| 98 |
|
---|
| 99 | <sect2 role="installation">
|
---|
| 100 | <title>Installation of Lua 5.2</title>
|
---|
| 101 |
|
---|
[de33b2a] | 102 | <para>
|
---|
| 103 | Some packages check for the <application>pkg-config</application> file
|
---|
| 104 | for <application>Lua</application>, which is created with:
|
---|
| 105 | </para>
|
---|
[c7918a9] | 106 |
|
---|
| 107 | <screen><userinput>cat > lua.pc << "EOF"
|
---|
| 108 | <literal>V=5.2
|
---|
| 109 | R=&lua52-version;
|
---|
| 110 |
|
---|
| 111 | prefix=/usr
|
---|
| 112 | INSTALL_BIN=${prefix}/bin
|
---|
| 113 | INSTALL_INC=${prefix}/include/lua5.2
|
---|
| 114 | INSTALL_LIB=${prefix}/lib
|
---|
| 115 | INSTALL_MAN=${prefix}/share/man/man1
|
---|
| 116 | INSTALL_LMOD=${prefix}/share/lua/${V}
|
---|
| 117 | INSTALL_CMOD=${prefix}/lib/lua/${V}
|
---|
| 118 | exec_prefix=${prefix}
|
---|
| 119 | libdir=${exec_prefix}/lib
|
---|
| 120 | includedir=${prefix}/include/lua5.2
|
---|
| 121 |
|
---|
| 122 | Name: Lua
|
---|
| 123 | Description: An Extensible Extension Language
|
---|
| 124 | Version: ${R}
|
---|
| 125 | Requires:
|
---|
| 126 | Libs: -L${libdir} -llua -lm -ldl
|
---|
| 127 | Cflags: -I${includedir}</literal>
|
---|
| 128 | EOF</userinput></screen>
|
---|
| 129 |
|
---|
| 130 | <para>
|
---|
| 131 | Install <application>Lua</application> by running the following
|
---|
| 132 | commands:
|
---|
| 133 | </para>
|
---|
| 134 |
|
---|
| 135 | <screen><userinput>patch -Np1 -i ../lua-&lua52-version;-shared_library-1.patch &&
|
---|
| 136 |
|
---|
| 137 | sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h &&
|
---|
| 138 |
|
---|
| 139 | sed -r -e '/^LUA_(SO|A|T)=/ s/lua/lua5.2/' \
|
---|
| 140 | -e '/^LUAC_T=/ s/luac/luac5.2/' \
|
---|
| 141 | -i src/Makefile &&
|
---|
| 142 |
|
---|
| 143 | make MYCFLAGS="-fPIC" linux</userinput></screen>
|
---|
| 144 | <!--
|
---|
| 145 | <para>
|
---|
| 146 | To test the results, issue: <command>make test</command>.
|
---|
| 147 | <quote>This will run the interpreter and print its version.</quote>.
|
---|
| 148 | More comprehensive tests can be performed if you downloaded the "Test
|
---|
| 149 | suite" tarball. Those tests need to be executed after the package is
|
---|
| 150 | installed, thus we defer to the description below.
|
---|
| 151 | </para>
|
---|
| 152 | -->
|
---|
| 153 | <para>
|
---|
| 154 | The installation of this package is complex, so we will use
|
---|
| 155 | the DESTDIR method of installation:
|
---|
| 156 | </para>
|
---|
| 157 |
|
---|
| 158 | <screen><userinput>make TO_BIN='lua5.2 luac5.2' \
|
---|
| 159 | TO_LIB="liblua5.2.so liblua5.2.so.5.2 liblua5.2.so.&lua52-version;" \
|
---|
| 160 | INSTALL_DATA="cp -d" \
|
---|
| 161 | INSTALL_TOP=$PWD/install/usr \
|
---|
| 162 | INSTALL_INC=$PWD/install/usr/include/lua5.2 \
|
---|
| 163 | INSTALL_MAN=$PWD/install/usr/share/man/man1 \
|
---|
| 164 | install &&
|
---|
| 165 |
|
---|
| 166 | install -Dm644 lua.pc install/usr/lib/pkgconfig/lua52.pc &&
|
---|
| 167 |
|
---|
| 168 | mkdir -pv install/usr/share/doc/lua-&lua52-version; &&
|
---|
| 169 | cp -v doc/*.{html,css,gif,png} install/usr/share/doc/lua-&lua52-version; &&
|
---|
| 170 |
|
---|
| 171 | ln -s liblua5.2.so install/usr/lib/liblua.so.5.2 &&
|
---|
| 172 | ln -s liblua5.2.so install/usr/lib/liblua.so.&lua52-version; &&
|
---|
| 173 |
|
---|
[eb7de89] | 174 | mv install/usr/share/man/man1/{lua.1,lua5.2.1} &&
|
---|
| 175 | mv install/usr/share/man/man1/{luac.1,luac5.2.1}</userinput></screen>
|
---|
[c7918a9] | 176 |
|
---|
| 177 | <para>
|
---|
| 178 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 179 | </para>
|
---|
| 180 |
|
---|
| 181 | <screen role="root"><userinput>chown -R root:root install &&
|
---|
| 182 | cp -a install/* /</userinput></screen>
|
---|
| 183 |
|
---|
| 184 | </sect2>
|
---|
| 185 |
|
---|
| 186 | <sect2 role="commands">
|
---|
| 187 | <title>Command Explanations</title>
|
---|
| 188 |
|
---|
| 189 | <para>
|
---|
| 190 | <command>sed -i ... src/luaconf.h</command>: This command changes the
|
---|
| 191 | <application>Lua</application> search path to match the install path.
|
---|
| 192 | </para>
|
---|
| 193 |
|
---|
| 194 | <para>
|
---|
| 195 | <command>sed -i ... src/Makefile</command>: This command deconflicts
|
---|
| 196 | this installation with the latest version of lua.
|
---|
| 197 | </para>
|
---|
| 198 |
|
---|
| 199 | </sect2>
|
---|
| 200 |
|
---|
| 201 | <sect2 role="content">
|
---|
| 202 | <title>Contents</title>
|
---|
| 203 |
|
---|
| 204 | <segmentedlist>
|
---|
| 205 | <segtitle>Installed Programs</segtitle>
|
---|
| 206 | <segtitle>Installed Library</segtitle>
|
---|
| 207 | <segtitle>Installed Directories</segtitle>
|
---|
| 208 |
|
---|
| 209 | <seglistitem>
|
---|
| 210 | <seg>
|
---|
[eb7de89] | 211 | lua5.2 and luac5.2
|
---|
[c7918a9] | 212 | </seg>
|
---|
| 213 | <seg>
|
---|
| 214 | liblua5.2.so
|
---|
| 215 | </seg>
|
---|
| 216 | <seg>
|
---|
| 217 | /usr/include/lua5.2,
|
---|
| 218 | /usr/lib/lua/5.2,
|
---|
| 219 | /usr/share/doc/lua-&lua52-version;, and
|
---|
| 220 | /usr/share/lua/5.2
|
---|
| 221 | </seg>
|
---|
| 222 | </seglistitem>
|
---|
| 223 | </segmentedlist>
|
---|
| 224 |
|
---|
| 225 | <variablelist>
|
---|
| 226 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 227 | <?dbfo list-presentation="list"?>
|
---|
| 228 | <?dbhtml list-presentation="table"?>
|
---|
| 229 |
|
---|
| 230 | <varlistentry id="lua52-prog">
|
---|
[741f35be] | 231 | <term><command>lua5.2</command></term>
|
---|
[c7918a9] | 232 | <listitem>
|
---|
| 233 | <para>
|
---|
[4c24eb0a] | 234 | is the standalone Lua version 5.2 interpreter
|
---|
[c7918a9] | 235 | </para>
|
---|
| 236 | <indexterm zone="lua52 lua-prog">
|
---|
[eb7de89] | 237 | <primary sortas="b-lua52">lua5.2</primary>
|
---|
[c7918a9] | 238 | </indexterm>
|
---|
| 239 | </listitem>
|
---|
| 240 | </varlistentry>
|
---|
| 241 |
|
---|
| 242 | <varlistentry id="luac52">
|
---|
[741f35be] | 243 | <term><command>luac5.2</command></term>
|
---|
[c7918a9] | 244 | <listitem>
|
---|
| 245 | <para>
|
---|
[4c24eb0a] | 246 | is the Lua version 5.2 compiler
|
---|
[c7918a9] | 247 | </para>
|
---|
| 248 | <indexterm zone="lua52 luac52">
|
---|
[eb7de89] | 249 | <primary sortas="b-luac52">luac5.2</primary>
|
---|
[c7918a9] | 250 | </indexterm>
|
---|
| 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
| 253 |
|
---|
| 254 | <varlistentry id="liblua52">
|
---|
| 255 | <term><filename class="libraryfile">liblua5.2.so</filename></term>
|
---|
| 256 | <listitem>
|
---|
| 257 | <para>
|
---|
[4c24eb0a] | 258 | contains the <application>Lua</application> version 5.2 API functions
|
---|
[c7918a9] | 259 | </para>
|
---|
| 260 | <indexterm zone="lua52 liblua52">
|
---|
| 261 | <primary sortas="c-liblua52">liblua5.2.so</primary>
|
---|
| 262 | </indexterm>
|
---|
| 263 | </listitem>
|
---|
| 264 | </varlistentry>
|
---|
| 265 |
|
---|
| 266 | </variablelist>
|
---|
| 267 |
|
---|
| 268 | </sect2>
|
---|
| 269 |
|
---|
| 270 | </sect1>
|
---|