summaryrefslogtreecommitdiff
path: root/packages/lua/files/debian.patch
blob: 38ca37946d2aa273ad5eeb23afda0d662a6555fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
--- lua-5.0.2.orig/doc/lua.1
+++ lua-5.0.2/doc/lua.1
@@ -152,6 +152,16 @@
 .TP
 .B \-v
 show version information.
+.TP
+.B \-C
+load the compatibility library into the interpreter. If you specify
+this, then you will also need to specify the
+.B \-i
+option in order to enter an interactive interpreter.
+.TP
+.B \-P
+suppress the creation of a standard LUA_PATH variable. Use this if
+you need to run scripts which conflict with system-installed libraries.
 .SH "SEE ALSO"
 .BR luac (1)
 .br
@@ -163,5 +173,11 @@
 L. H. de Figueiredo,
 and
 W. Celes
-(lua@tecgraf.puc-rio.br)
+.LP
+.BI <lua@tecgraf.puc-rio.br>
+.LP
+Debian modifications to the manpage by 
+Daniel Silverstone 
+.LP
+.BI <dsilvers@debian.org>
 .\" EOF
--- lua-5.0.2.orig/src/luac/Makefile
+++ lua-5.0.2/src/luac/Makefile
@@ -12,8 +12,8 @@
 
 all:	$T
 
-$T:	$(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a
-	$(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB)
+$T:	$(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a
+	$(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS)
 
 # print.c needs opcode names from lopcodes.c
 lopcodes.o:	../lopcodes.c ../lopcodes.h
--- lua-5.0.2.orig/src/lib/Makefile
+++ lua-5.0.2/src/lib/Makefile
@@ -9,16 +9,18 @@
 OBJS= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o ltablib.o lstrlib.o loadlib.o
 SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c lstrlib.c loadlib.c
 
-T= $(LIB)/liblualib.a
+SOBJS := $(patsubst %.o,%.os,$(OBJS))
+
+T= $(LIB)/liblualib.a
 
 all:	$T
 
-$T:	$(OBJS)
+$T:	$(OBJS) $(SOBJS)
 	$(AR) $@ $(OBJS)
 	$(RANLIB) $@
 
 clean:
-	rm -f $(OBJS) $T
+	rm -f $(OBJS) $(SOBJS) $T
 
 co:
 	co -q -f -M $(SRCS)
--- lua-5.0.2.orig/src/lib/liolib.c
+++ lua-5.0.2/src/lib/liolib.c
@@ -149,7 +149,14 @@
   if (f == stdin || f == stdout || f == stderr)
     return 0;  /* file cannot be closed */
   else {
-    int ok = (pclose(f) != -1) || (fclose(f) == 0);
+    int ok;
+    errno = 0;
+    ok = (pclose(f) != -1);
+    if (!ok) {
+      if (errno == ECHILD) ok = 1; /* pclose worked, but could reap child */
+      else ok = (fclose(f) == 0);
+    }
+    
     if (ok)
       *(FILE **)lua_touserdata(L, 1) = NULL;  /* mark file as closed */
     return ok;
--- lua-5.0.2.orig/src/lua/Makefile
+++ lua-5.0.2/src/lua/Makefile
@@ -12,8 +12,8 @@
 
 all:	$T
 
-$T:	$(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a
-	$(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB)
+$T:	$(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a
+	$(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB)
 
 $(LIB)/liblua.a:
 	cd ..; $(MAKE)
--- lua-5.0.2.orig/src/lua/lua.c
+++ lua-5.0.2/src/lua/lua.c
@@ -65,7 +65,57 @@
 
 static const char *progname = PROGNAME;
 
+/* These bits are added for Debian's -P functionality */
 
+static int done_path = 0;
+static int suppress_path = 0;
+
+static const char* paths[] = {
+  "~/.lua",
+  "~/share/lua",
+  "/usr/share/lua",
+  "/usr/local/share/lua",
+  NULL
+};
+
+static void do_path()
+{
+  const char** p = paths;
+  int any;
+  if( done_path || suppress_path ) return;
+  if( ! L ) return;
+  done_path = 1;
+  lua_pushliteral(L,"LUA_PATH");
+  lua_pushliteral(L,"");
+  while( *p ) {
+    any = 0;
+    if( **p == '~' ) {
+      const char* home = getenv("HOME");
+      if( home ) {
+        lua_pushstring(L,home);
+        lua_pushstring(L,*p+1);
+        lua_pushliteral(L,"/?.lua;");
+        lua_pushstring(L,home);
+        lua_pushstring(L,*p+1);
+        lua_pushliteral(L,"/?;");
+        any = 6;
+      }
+    } else {
+      lua_pushstring(L,*p);
+      lua_pushliteral(L,"/?.lua;");
+      lua_pushstring(L,*p);
+      lua_pushliteral(L,"/?;");
+      any = 4;
+    }
+    if( any ) {
+      lua_concat(L,any+1);
+    }
+    p++;
+  }
+  lua_pushliteral(L, "?.lua;?");
+  lua_concat(L,2);
+  lua_settable(L, LUA_GLOBALSINDEX);
+}
 
 static const luaL_reg lualibs[] = {
   {"base", luaopen_base},
@@ -85,13 +135,12 @@
 static void lstop (lua_State *l, lua_Debug *ar) {
   (void)ar;  /* unused arg. */
   lua_sethook(l, NULL, 0, 0);
-  luaL_error(l, "interrupted!");
+  lua_pushnil(l);
+  lua_error(l);
 }
 
 
 static void laction (int i) {
-  signal(i, SIG_DFL); /* if another SIGINT happens before lstop,
-                              terminate process (default action) */
   lua_sethook(L, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
 }
 
@@ -105,6 +154,9 @@
   "  -i       enter interactive mode after executing `script'\n"
   "  -l name  load and run library `name'\n"
   "  -v       show version information\n"
+  "  -C       load the compatibility library before startup\n"
+  "  -P       suppress the setting of LUA_PATH. If not specified\n"
+  "           very early, this setting may not take effect.\n"
   "  --       stop handling options\n" ,
   progname);
 }
@@ -120,23 +172,42 @@
   const char *msg;
   if (status) {
     msg = lua_tostring(L, -1);
-    if (msg == NULL) msg = "(error with no message)";
-    l_message(progname, msg);
+    if (msg == NULL) {
+      const char *str;
+      lua_getglobal(L, "LUA_DEFAULT_ERROR");  /* try global variable */
+      str = lua_tostring(L, -1);
+      lua_pop(L, 1);
+      if (str) {
+        if (*str != '\0') msg = str;
+      } else msg = "(error with no message)";
+    }
+    if (msg) l_message(progname, msg);
     lua_pop(L, 1);
   }
   return status;
 }
 
+static void sig_catch(int sig, void (*handler)(int))
+{
+  struct sigaction sa;
+  sa.sa_handler = handler;
+  sa.sa_flags = 0;
+  sigemptyset(&sa.sa_mask);
+  sigaction(sig, &sa, 0);         /* XXX ignores errors */
+}
+
 
 static int lcall (int narg, int clear) {
   int status;
   int base = lua_gettop(L) - narg;  /* function index */
+  do_path();
+  lua_settop(L,base);
   lua_pushliteral(L, "_TRACEBACK");
   lua_rawget(L, LUA_GLOBALSINDEX);  /* get traceback function */
   lua_insert(L, base);  /* put it under chunk and args */
-  signal(SIGINT, laction);
+  sig_catch(SIGINT, laction);
   status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
-  signal(SIGINT, SIG_DFL);
+  sig_catch(SIGINT, SIG_DFL);
   lua_remove(L, base);  /* remove traceback function */
   return status;
 }
@@ -179,6 +250,7 @@
 
 
 static int load_file (const char *name) {
+  do_path();
   lua_pushliteral(L, "require");
   lua_rawget(L, LUA_GLOBALSINDEX);
   if (!lua_isfunction(L, -1)) {  /* no `require' defined? */
@@ -279,6 +351,7 @@
   int status;
   const char *oldprogname = progname;
   progname = NULL;
+  do_path();
   while ((status = load_string()) != -1) {
     if (status == 0) status = lcall(0, 0);
     report(status);
@@ -352,6 +425,18 @@
             return 1;  /* stop if file fails */
           break;
         }
+        case 'C': {
+          const char *filename = "compat.lua";
+          if (load_file(filename))
+            return 1;  /* stop if file fails */
+          break;
+        }      
+        case 'P': {
+          if( done_path )
+            l_message(progname, "option `-P' is too late, ignored");
+          suppress_path = 1;
+          break;
+        }
         case 'c': {
           l_message(progname, "option `-c' is deprecated");
           break;
@@ -413,6 +498,7 @@
   status = handle_luainit();
   if (status == 0) {
     status = handle_argv(s->argv, &interactive);
+    do_path();
     if (status == 0 && interactive) manual_input();
   }
   s->status = status;
--- lua-5.0.2.orig/src/Makefile
+++ lua-5.0.2/src/Makefile
@@ -67,16 +67,19 @@
 	lvm.h \
 	lzio.h
 
-T= $(LIB)/liblua.a
+T= $(LIB)/liblua.a
+
+SOBJS := $(patsubst %.o,%.os,$(OBJS))
 
 all:	$T
 
-$T:	$(OBJS)
+$T:	$(OBJS) $(SOBJS)
 	$(AR) $@ $(OBJS)
 	$(RANLIB) $@
 
+
 clean:
-	rm -f $(OBJS) $T
+	rm -f $(OBJS) $(SOBJS) $T
 
 co:
 	co -q -f -M $(SRCS)
--- lua-5.0.2.orig/lua-config
+++ lua-5.0.2/lua-config
@@ -0,0 +1,165 @@
+#!/usr/bin/lua
+-- -*- Lua -*-
+
+-- This file is under the terms of the MIT licence. Do as you will.
+
+-- Process the arg table
+function usage()
+   info();
+   io.stderr:write([[Usage: lua-config <options>
+
+  Valid options are:
+
+  --include      Outputs the -I switches needed to find <lua.h> etc.
+
+  --static       Outputs the full path to the static libraries
+
+  --libs         Outputs the -L and -l switches needed to find the library
+  --libs-only-L  Outputs only the -L switches
+  --libs-only-l  Outputs only the -l switches
+
+  --extralibs    Outputs the -l switches appropriate to the extra libs needed by lua
+
+  Note that --static is mututally exclusive with the --libs* options
+
+  Also, you can specify the following
+
+  --vmonly       Outputs only the switches for finding the VM libraries
+  --libonly      Outputs only the switches for finding the standard libraries
+  --both         Outputs the switches for both [The default]
+
+  Example:
+
+  gcc `lua-config --include` my_prog.c -o my_prog `lua-config --libs`
+
+]] );
+   os.exit(1);
+end
+
+function version()
+   io.stdout:write( [[5.0.0
+]] );
+   os.exit(0);
+end
+
+function info()
+   io.stdout:write( [[lua-config version 1.10 (c) Daniel Silverstone 2002
+
+lua-config was written for the Debian GNU/Linux project. This version
+of lua-config will provide switches appropriate to Lua 5.0
+
+]] );
+end
+
+if( table.getn(arg) == 0 ) then
+   usage()
+end
+
+output_vm      = 1
+output_lib     = 1
+
+output_static  = 0
+output_libs_l  = 0
+output_libs_L  = 0
+output_include = 0
+output_extras  = 0
+
+table.foreachi( arg, 
+	 function(n,param)
+	    if( param == '--version' ) then
+	       version()
+	    end
+	    if( param == '--help' ) then
+	       usage()
+	    end
+	    if( param == '--include' ) then
+	       output_include = 1;
+	       return
+	    end
+	    if( param == '--libs' ) then
+	       output_libs_l = 1;
+	       output_libs_L = 1;
+	       return
+	    end
+	    if( param == '--libs-only-L' ) then
+	       output_libs_L = 1;
+	       return
+	    end
+	    if( param == '--libs-only-l' ) then
+	       output_libs_l = 1;
+	       return
+	    end
+	    if( param == '--extralibs' ) then
+	       output_extras = 1;
+	       return
+	    end
+	    if( param == '--static' ) then
+	       output_static = 1;
+	       return
+	    end
+	    if( param == '--vmonly' ) then
+	       output_vm = 1;
+	       output_lib = 0;
+	       return
+	    end
+	    if( param == '--libonly' ) then
+	       output_lib = 1;
+	       output_vm = 0;
+	       return
+	    end
+	    if( param == '--both' ) then
+	       output_lib = 1;
+	       output_vm = 1;
+	       return
+	    end
+	    io.stderr:write( "Unknown argument ", param );
+	    usage();
+	 end );
+
+if( (output_extras + output_libs_l + output_libs_L + output_include + output_static) == 0 ) then
+   usage()
+end
+
+if( (output_static + (output_libs_l or output_libs_L)) > 1 ) then
+   usage();
+end
+
+outargs = {}
+
+if( output_include == 1 ) then
+   table.insert( outargs, "-I/usr/include/lua" );
+end
+
+if( output_libs_L == 1 ) then
+   table.insert( outargs, "-L/usr/include" );
+end
+
+if( output_libs_l == 1 ) then
+   if( output_lib == 1 ) then
+      table.insert( outargs, "-llualib" );
+   end
+   if( output_vm == 1 ) then
+      table.insert( outargs, "-llua" );
+   end
+end
+
+if( output_static == 1 ) then
+   if( output_lib == 1 ) then
+      table.insert( outargs, "/usr/lib/liblualib.a" );
+   end
+   if( output_vm == 1 ) then
+      table.insert( outargs, "/usr/lib/liblua.a" );
+   end
+end
+
+if( output_extras == 1 ) then
+   table.insert( outargs, "-lm" );
+end
+
+io.stdout:write( outargs[1] );
+
+for i=2,table.getn(outargs) do
+   io.stdout:write( " ", outargs[i] );
+end
+
+io.stdout:write( "\n" );
--- lua-5.0.2.orig/config
+++ lua-5.0.2/config
@@ -25,15 +25,15 @@
 # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others),
 # uncomment the next two lines.
 #
-#LOADLIB= -DUSE_DLOPEN=1
-#DLLIB= -ldl
+LOADLIB= -DUSE_DLOPEN=1
+DLLIB= -ldl
 #
 # In Linux with gcc, you should also uncomment the next definition for
 # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option
 # allows dynamic libraries to link back to the `lua' program, so that they do
 # not need the Lua libraries. (Other systems may have an equivalent facility.)
 #
-#MYLDFLAGS= -Wl,-E
+MYLDFLAGS= -Wl,-E
 #
 # On Windows systems. support for dynamic loading is enabled by default.
 # To disable this support, uncomment the next line.
@@ -92,7 +92,7 @@
 # or if you are using a modified interpreter that does not need them,
 # then comment the following line or add the appropriates libraries.
 #
-EXTRA_LIBS= -lm
+#EXTRA_LIBS= -lm
 
 # If you want to customize the stand-alone Lua interpreter, uncomment and
 # edit the following two lines; also edit etc/saconfig.c to suit your needs.
@@ -100,8 +100,8 @@
 # to add -lreadline (and perhaps also -lhistory and -lcurses or -lncurses)
 # to EXTRA_LIBS.
 #
-#USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE
-#EXTRA_LIBS= -lm -ldl -lreadline # -lhistory -lcurses -lncurses
+USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE
+EXTRA_LIBS= -lreadline -lm -ldl # -lhistory -lcurses -lncurses
 
 # ------------------------------------------------------------------ C compiler
 
@@ -119,7 +119,7 @@
 # debug information. If you only want the shared libraries, you may want to
 # add -fPIC to MYCFLAGS.
 #
-MYCFLAGS= -O2
+MYCFLAGS= -O3 -g
 #MYCFLAGS= -O3 -fomit-frame-pointer # -fPIC
 
 # Write here any options you may need for your C linker.
@@ -148,19 +148,20 @@
 
 # Locations for "make install". You may need to be root do "make install".
 #
-INSTALL_ROOT= /usr/local
+INSTALL_ROOT= $(PREFIX)/usr/
 INSTALL_BIN= $(INSTALL_ROOT)/bin
-INSTALL_INC= $(INSTALL_ROOT)/include
+INSTALL_INC= $(INSTALL_ROOT)/include/lua
 INSTALL_LIB= $(INSTALL_ROOT)/lib
-INSTALL_MAN= $(INSTALL_ROOT)/man/man1
+INSTALL_MAN= $(INSTALL_ROOT)/share/man/man1
+INSTALL_SHARE= $(INSTALL_ROOT)/share/lua
 
 # You may prefer to use "install" instead of "cp" if you have it.
 # If you use "install", you may also want to change the permissions after -m.
 #
-INSTALL_EXEC= cp
-INSTALL_DATA= cp
-#INSTALL_EXEC= install -m 0755
-#INSTALL_DATA= install -m 0644
+#INSTALL_EXEC= cp
+#INSTALL_DATA= cp
+INSTALL_EXEC= install -m 0755
+INSTALL_DATA= install -m 0644
 
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
 
@@ -173,6 +174,10 @@
 INCS= -I$(INC) $(EXTRA_INCS)
 DEFS= $(NUMBER) $(EXTRA_DEFS)
 
-CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS)
+CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS) -DINSTALL_SHARE=\"$(INSTALL_SHARE)\"
+
+# Extra rule for .os files
+%.os: %.c
+	$(CC) $(CFLAGS) -fPIC -DPIC -o $@ -c $<
 
 # (end of config)
--- lua-5.0.2.orig/Makefile
+++ lua-5.0.2/Makefile
@@ -38,9 +38,13 @@
 
 # shared libraries (for Linux)
 so:
-	ld -o lib/liblua.so.$V -shared src/*.o
-	ld -o lib/liblualib.so.$V -shared src/lib/*.o
-	cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so
+	gcc -o lib/liblua.so.$V -shared -Wl,-soname,liblua.so.$V \
+               src/*.os -lc
+	ln -fs liblua.so.$V lib/liblua-build.so
+	gcc -o lib/liblualib.so.$V -shared -Wl,-soname,liblualib.so.$V \
+               src/lib/*.os -Llib -llua-build -lm -ldl -lc
+	cd lib; ln -fs liblua.so.$V liblua.so; \
+                ln -fs liblualib.so.$V liblualib.so
 
 # binaries using shared libraries
 sobin:
--- lua-5.0.2.orig/lua.pc
+++ lua-5.0.2/lua.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include/
+
+Name: lua
+Description: The Lua 5.0 programming language
+Version: 5.0.0
+Libs: -L${libdir} -llua
+Cflags: -I${includedir}/lua
+
--- lua-5.0.2.orig/lualib.pc
+++ lua-5.0.2/lualib.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include/
+
+Name: lua
+Description: The Lua 5.0 programming language addon libraries
+Version: 5.0.0
+Requires: lua
+Libs: -L${libdir} -llualib
+Cflags: -I${includedir}/lua
+
--- lua-5.0.2.orig/lua-config.1
+++ lua-5.0.2/lua-config.1
@@ -0,0 +1,64 @@
+.\" Manual page for lua-config
+.\" Written by Daniel Silverstone <dsilvers@debian.org>
+.\" For the Debian GNU/Linux system
+
+.TH lua-config 1
+.SH NAME
+lua-config \- Lua configuration information
+.SH SYNOPSIS
+Basic usage
+.PP
+.B gcc
+`
+.B lua-config
+.I \-\-include
+`
+my_prog.c
+.B \-o
+my_prog
+`
+.B lua-config
+.I \-\-libs
+`
+
+.SH DESCRIPTION
+The lua-config script allows you to determine useful information
+about the chosen version of lua running on the Debian GNU/Linux
+system in use.
+More information can be found by running
+.B lua-config
+without any arguments.
+.SH CAVEATS
+This script is unique to Debian and as such you shouldn't rely
+on its presence on every system. Lua is an embedded language
+by default and different Linux distributions each take a different
+approach to making it possible to compile with Lua. The 
+.B pkg-config
+system also provides a way to look for libraries and is more likely
+to be supported across different Linux distributions. Debian's
+.B pkg-config
+name for Lua 5.0 is
+.I lua
+and the libraries are in
+.I lualib.
+These
+.B pkg-config
+files can be found in the 
+.I liblua-dev 
+and 
+.I liblualib-dev 
+packages.
+.SH AUTHOR
+lua-config was written by 
+.B Daniel Silverstone
+.BI <dsilvers@debian.org>.
+
+This manual page was written by
+.B Daniel Silverstone
+.BI <dsilvers@debian.org>.
+For the Debian project. It may be used without restriction in any
+other system.
+.SH "SEE ALSO"
+.IR lua (1)
+.IR pkg-config (1)
+