~ubuntu-branches/ubuntu/natty/lua-gtk/natty

« back to all changes in this revision

Viewing changes to script/install.lua

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2009-05-17 18:16:21 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090517181621-9kmdd82nxg54jsio
* new upstream snapshot comprising many more GNOME libraries:
    Gtk, GDK, GLib, Pango, Atk, Libxml2, Cairo, Clutter, Gtkhtml, 
    GtkSourceView, Gio, Gtkspell and GConf. 
* new upstream release includes a new configure script written in Lua,
  no more bashisms there (Closes: #507205)
* renamed binary packages to liblua5.1-gnome-*
* updated standards-version to 3.8.1, no changes needed
* patch to load .so.* version of libraries and not .so (that was requiring
  -dev packages) (Closes: #522087)
* removed redundant Architecture line from the source stanza of control
  (Closes: #498120)
* updated copyright file, Wolfgang Oertl holds it for 2009 too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
-- Simple installation script for Lua-Gtk.
4
4
-- by Wolfgang Oertl
5
5
 
 
6
 
 
7
require "lfs"
 
8
 
6
9
---
7
10
-- Install a file or directory into the first applicable target directory from
8
11
-- the Lua search path.
11
14
-- @param pattern  What to replace in the search path
12
15
-- @param source  File or directory in the current directory to install
13
16
--
14
 
function do_install(ar, pattern, source)
15
 
    local dest, cmd
 
17
function do_install(ar, pattern, source, dest)
 
18
    local dest2, cmd
16
19
 
17
20
    for path in string.gmatch(ar, "[^;]+") do
18
21
        -- if too short, then it's ./?.so or something.
19
22
        if path:len() > 10 then
20
 
            dest = path:gsub(pattern, source)
21
 
            if dest ~= path then
22
 
                cmd = string.format("cp -a %s %s", source, dest)
 
23
            dest2 = path:gsub(pattern, dest)
 
24
            if dest2 ~= path then
 
25
                if lfs.attributes(dest2, "mode") then
 
26
                    print("Destination exists:", dest2)
 
27
                    break
 
28
                end
 
29
                cmd = string.format("cp -a %s %s", source, dest2)
23
30
                print(cmd)
24
31
                os.execute(cmd)
25
32
                break
28
35
    end
29
36
end
30
37
 
31
 
do_install(package.cpath, "%?.so", "gtk.so")
32
 
do_install(package.path, "%?.lua", "gtk")
 
38
do_install(package.cpath, "%?.so", "build/linux-i386/gtk.so", "gtk.so")
 
39
do_install(package.path, "%?.lua", "lib", "gtk")
33
40