setup-3.4.1/ 0000755 0001750 0001750 00000000000 10340062165 013362 5 ustar aamine aamine 0000000 0000000 setup-3.4.1/TODO 0000644 0001750 0001750 00000000714 10123706726 014063 0 ustar aamine aamine 0000000 0000000 - --prefix
- support srcdir
- output installed file names to the file
- single package installer
- restruct setup.rb on the top of single package installers
- developper level hook again
- pass options to extconf.rb
- --without-ext
- (multi-package archive) package installation order
- "ruby setup.rb" means "config; setup; install"
* package checker (for developpers)
* pass options to hook
? .rpm/.deb automatic creation
? restruct extconf.rb
setup-3.4.1/test/ 0000755 0001750 0001750 00000000000 10340062165 014341 5 ustar aamine aamine 0000000 0000000 setup-3.4.1/test/test_installer.rb 0000644 0001750 0001750 00000011473 10340062022 017720 0 ustar aamine aamine 0000000 0000000 require 'setup'
require 'fileutils'
require 'stringio'
require 'test/unit'
class DummyConfig
def initialize(config)
@config = config
end
def [](key)
@config[key]
end
def no_harm?
false
end
def verbose?
false
end
end
class TestInstaller < Test::Unit::TestCase
include FileUtils
def setup
rm_rf %w(srcdir objdir)
mkdir %w(srcdir objdir)
Dir.chdir 'objdir'
$stderr, $orig_stderr = StringIO.new, $stderr
end
def teardown
$stderr = $orig_stderr
Dir.chdir '..'
rm_rf %w(srcdir objdir)
end
def setup_installer(config = {})
@installer = Installer.new(DummyConfig.new(config), '../srcdir', '.')
end
def do_update_shebang_line(id, str)
create id, str
@installer.update_shebang_line "../srcdir/#{id}"
read(id)
end
def create(filename, content)
File.open("../srcdir/#{filename}", 'wb') {|f|
f.write content
}
end
def read(filename)
path = File.exist?(filename) ? filename : "../srcdir/#{filename}"
File.open(path, 'rb') {|f|
return f.read
}
end
def test_update_shebang_line__never
setup_installer 'shebang' => 'never', 'rubypath' => 'ERROR'
assert_equal "#!/usr/local/bin/ruby\nprogram",
do_update_shebang_line('ruby', "#!/usr/local/bin/ruby\nprogram")
assert_equal "#! /usr/local/bin/ruby\nprogram",
do_update_shebang_line('ruby-sp', "#! /usr/local/bin/ruby\nprogram")
assert_equal "#!/usr/local/bin/ruby -Ke\nprogram",
do_update_shebang_line('ruby-arg', "#!/usr/local/bin/ruby -Ke\nprogram")
assert_equal "#!/usr/bin/ruby -n -p\nprogram",
do_update_shebang_line('ruby-args', "#!/usr/bin/ruby -n -p\nprogram")
assert_equal "#!/usr/bin/env ruby\nprogram",
do_update_shebang_line('env-ruby', "#!/usr/bin/env ruby\nprogram")
assert_equal "#!/usr/bin/env perl\nprogram",
do_update_shebang_line('env-noruby', "#!/usr/bin/env perl\nprogram")
assert_equal "#!/bin/sh\nprogram",
do_update_shebang_line('interp', "#!/bin/sh\nprogram")
assert_equal "#!/bin/sh -l -r -\nprogram",
do_update_shebang_line('interp-args', "#!/bin/sh -l -r -\nprogram")
assert_equal "program",
do_update_shebang_line('bare', "program")
assert_equal "\001\002\003\n\004\005\006",
do_update_shebang_line('binary', "\001\002\003\n\004\005\006")
end
def test_update_shebang_line__all
setup_installer 'shebang' => 'all', 'rubypath' => 'RUBYPATH'
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('ruby', "#!/usr/local/bin/ruby\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('ruby-sp', "#! /usr/local/bin/ruby\nprogram")
assert_equal "#! RUBYPATH -Ke\nprogram",
do_update_shebang_line('ruby-arg', "#!/usr/local/bin/ruby -Ke\nprogram")
assert_equal "#! RUBYPATH -n -p\nprogram",
do_update_shebang_line('ruby-args', "#!/usr/bin/ruby -n -p\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('env-ruby', "#!/usr/bin/env ruby\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('env-noruby', "#!/usr/bin/env perl\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('interp', "#!/bin/sh\nprogram")
assert_equal "#! RUBYPATH\nprogram", # args removed
do_update_shebang_line('interp-args', "#!/bin/sh -l -r -\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('bare', "program")
assert_equal "#! RUBYPATH\n\001\002\003\n\004\005\006",
do_update_shebang_line('binary', "\001\002\003\n\004\005\006")
end
def test_update_shebang_line__ruby
setup_installer 'shebang' => 'ruby', 'rubypath' => 'RUBYPATH'
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('ruby', "#!/usr/local/bin/ruby\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('ruby-sp', "#! /usr/local/bin/ruby\nprogram")
assert_equal "#! RUBYPATH -Ke\nprogram",
do_update_shebang_line('ruby-arg', "#!/usr/local/bin/ruby -Ke\nprogram")
assert_equal "#! RUBYPATH -n -p\nprogram",
do_update_shebang_line('ruby-args', "#!/usr/bin/ruby -n -p\nprogram")
assert_equal "#! RUBYPATH\nprogram",
do_update_shebang_line('env-ruby', "#!/usr/bin/env ruby\nprogram")
assert_equal "#!/usr/bin/env perl\nprogram",
do_update_shebang_line('env-noruby', "#!/usr/bin/env perl\nprogram")
assert_equal "#!/bin/sh\nprogram",
do_update_shebang_line('interp', "#!/bin/sh\nprogram")
assert_equal "#!/bin/sh -l -r -\nprogram",
do_update_shebang_line('interp-args', "#!/bin/sh -l -r -\nprogram")
assert_equal "program",
do_update_shebang_line('bare', "program")
assert_equal "\001\002\003\n\004\005\006",
do_update_shebang_line('binary', "\001\002\003\n\004\005\006")
end
end
setup-3.4.1/Makefile 0000644 0001750 0001750 00000003253 10340062166 015026 0 ustar aamine aamine 0000000 0000000 #
# setup/Makefile
#
ident = setup
version = 3.4.1
include $(HOME)/.makeparams
default: update
.PHONY: default doc text dist clean
clean:
rm -rf NEWS.ja NEWS.en Usage_* doc.*
publish: update
cp setup.rb $(datadir)
update:
update-version --version=$(version) setup.rb
doc:
rm -rf doc.ja doc.en
mkdir doc.ja doc.en
mldoc-split --lang=ja NEWS.m | crd2html > doc.ja/news.html
mldoc-split --lang=en NEWS.m | crd2html > doc.en/news.html
compile-documents --lang=ja --template=$(tmpldir)/manual.ja doc doc.ja
compile-documents --lang=en --template=$(tmpldir)/manual.en doc doc.en
text: Usage_ja.txt Usage_en.txt NEWS.ja NEWS.en
Usage_ja.txt: doc/usage.rd.m
mldoc-split --lang=ja doc/usage.rd.m | crd2plain > $@
Usage_en.txt: doc/usage.rd.m
mldoc-split --lang=en doc/usage.rd.m | crd2plain > $@
NEWS.ja: NEWS.m
mldoc-split --lang=ja NEWS.m > $@
NEWS.en: NEWS.m
mldoc-split --lang=en NEWS.m > $@
dist:
rm -rf tmp; mkdir tmp
cd tmp; cvs -Q export -r`echo V$(version) | tr . -` -d setup-$(version) setup
cd tmp/setup-$(version); make doc text
cd tmp/setup-$(version); rm -rf web doc *.m
cd tmp; tar czf $(siteardir)/setup-$(version).tar.gz setup-$(version)
rm -rf tmp
site:
erb web/setup.ja.rhtml | wrap-html --template=$(tmpldir)/basic.ja | nkf -j > $(projdir_ja)/index.html
erb web/setup.en.rhtml | wrap-html --template=$(tmpldir)/basic.en > $(projdir_en)/index.html
mldoc-split --lang=ja NEWS.m | crd2html > $(projdir_ja)/doc/news.html
mldoc-split --lang=en NEWS.m | crd2html > $(projdir_en)/doc/news.html
compile-documents --lang=ja --template=$(tmpldir)/basic.ja doc $(projdir_ja)/doc
compile-documents --lang=en --template=$(tmpldir)/basic.en doc $(projdir_en)/doc
setup-3.4.1/README.en 0000644 0001750 0001750 00000001110 10315246653 014644 0 ustar aamine aamine 0000000 0000000 setup.rb README
===============
setup.rb is a generic installer for Ruby programs.
Usage
-----
Just copy setup.rb in to your package.
For details, see HTML documents located under doc.en/.
License
-------
GNU LGPL, Lesser General Public License version 2.1.
For details of LGPL, see the file "COPYING".
Bug Reports
-----------
Any kind of bug reports are welcome.
If you find bugs, please email me.
Minero Aoki
aamine@loveruby.net
http://i.loveruby.net
setup-3.4.1/README.ja 0000644 0001750 0001750 00000001330 10315246653 014640 0 ustar aamine aamine 0000000 0000000 setup.rb README
===============
Ruby プログラム向けの汎用インストーラです。
インストール先などを柔軟に設定可能なのが特徴です。
また、パッケージ独自の要求に合わせてカスタマイズ
することもできます。
使いかた
--------
単に setup.rb を自分のパッケージにコピーするだけです。
詳しいことは doc.ja/ 以下の HTML ドキュメントを参照
してください。
ライセンス
----------
GNU LGPL (Lesser General Public License) version 2.1
です。
バグ報告など
------------
以下のメールアドレスまでお願いします。
青木峰郎
あおきみねろう
aamine@loveruby.net
http://i.loveruby.net
setup-3.4.1/NEWS.en 0000644 0001750 0001750 00000011537 10340062165 014471 0 ustar aamine aamine 0000000 0000000 = NEWS
== 3.4.1 (2005-11-20)
* [CHANGE] do not apply *.rb filter for lib/**.
* [CHANGE] updates "#!/usr/bin/env ruby" on --shebang=ruby (it is default).
* [fix] --shebang option did not work.
* [fix] --without-ext option did not work.
* [fix] default --rubypath value should include file extension. (Thanks U.Nakamura)
* [fix] task SHOW, SETUP, TEST, CLEAN, DISTCLEAN with any argument wrongly caused exception.
== 3.4.0 (2005-09-25)
* [fix] fix Windows specific bug, which causes error while
modifying bin/*.rb files in setup phase.
* [new] new task `test'.
* [new] installs configuration files from conf/.
* [new] installs man pages from man/.
* [new] new config option: --installdirs.
* [new] new config option: --shebang.
* [new] new config option: --sysconfdir.
* [new] new config option: --mandir.
* [new] new config option: --libruby.
* [new] new config option: --localstetedir.
== 3.3.1 (2004-10-02)
* [fix] `install' did not work if bin/*.rb exists.
* [fix] relative $prefix path caused infinite loop.
== 3.3.0 (2004-09-21)
* [new] Invoke config-setup-install when no global task is given.
* [new] new task `all', which invokes config-setup-install.
== 3.2.4 (2004-02-12)
* [new] get default value of --make-prog from CONFIG['configure_args']. [ruby-list:39186]
* [fix] open files in binary mode, also on ruby 1.8. [ruby-list:39184]
* [fix] wrong path was written in InstalledFiles.
== 3.2.3 (2004-02-12)
* [fix] open files in binary mode. [ruby-list:39158]
== 3.2.2 (2003-12-16)
* [fix] did not work with metaconfig. (thanks Guillaume Marcais)
* [fix] should save configurations after running all hooks. (thanks Alex Fenton)
* [fix] does not reject *.elc, *.so, etc. (thanks Rubikitch)
== 3.2.1 (2003-09-01)
* [fix] did not work.
== 3.2.0 (2003-08-27)
* [CHANGE] install.rb is merged into the setup.rb.
* [fix] clean/distclean should be able to invoke before configuring.
== 3.1.5 (2003-08-21)
* [CHANGE] install only *.rb from the lib/ directory.
* [CHANGE] ban MANIFEST.
== 3.1.4 (2003-02-25)
* [new] ignore CVS/ *~ *.bak #* .* etc.
* [new] explicit file designation by MANIFEST.
* [new] new task `distclean'.
* bundle Makefile and asm.rb, which are tools to create
install.rb/setup.rb from source file.
== 3.1.3 (2002-12-06)
* better help message.
== 3.1.2 (2002-05-07)
* [fix] config --without did not work.
* [fix] wrong filenames were written to InstalledFiles.
== 3.1.1 (2002-01-11)
* [CHANGE] changes "config --install-prefix" to "install --prefix"
* [new] new config option --site-ruby-common
* [new] new metaconfig interface set_config_default(n,v)
== 3.1.0 (2002-01-08)
* [new] new config option --without-ext
* [new] new config option --install-prefix
* [new] new hook interface get_config(k), set_config(k,v)
* [new] config option config file 'metaconfig'
* [fix] setup.rb executes hooks in top directory
(does not run hooks in packages/ dir. This is a feature.)
== 3.0.2 (2001-10-01)
* did not work on Ruby 1.4.4 ... 1.6.3
(rbconfig['rubylidir'] does not exist.)
== 3.0.1 (2001-09-07)
* new options -q, --quiet, --verbose
* parametarizes 'setup.rb' in strings
== 3.0.0 (2001-08-28)
* archive structure completely changed.
* single package installer install.rb
* restructs setup.rb
* outputs installed file names into the file "InstalledFiles"
* --with/--without accepts only package names.
* "config -- --with-foo=bar" passes options to extconf.rb
* supports customized site_ruby (thanks Akira Yamada)
== 2.2.1 (2001-08-01)
* modify --with and --without (reported by Knu)
== 2.2.0 (2001-06-30)
* ban PATHCONV. Use setup/*.rb instead.
== 2.1.0 (2001-06-30)
* support parameterized config value (i.e. --prefix)
* Developpers can hook any tasks. (thanks rubikitch)
* support srcdir
== 2.0.4 (2001-04-07)
* support Ruby 1.4
== 2.0.3 (2001-03-26)
* ignore if Makefile is not exist when "make clean"
* avoids windows' stat() bug
== 2.0.2 (2001-02-13)
* ignore if Makefile is not exist when "make clean" (thanks rubikitch)
* support DOS's drive letter
== 2.0.1 (2001-02-09)
* does "make clean" on each SETUP
* does not fork new ruby process when executing extconf.rb
* config --rbconfig=file
== 2.0.0 (2000-12-19)
* now setup.rb does not depend on amstd
* install --no-harm
* add templates
== 1.0.7 (2000-11-18)
* allow --without=ext/*
== 1.0.6 (2000-08-27)
* new option --make-prog=[make] (patched by Katsuyuki Komatsu)
== 1.0.5 (2000-08-27)
* generates Makefile every time
== 1.0.4 (2000-07-13)
* can pass directory name (like ext/cparse) for --with, --without
== 1.0.3 (2000-06-08)
* new command dryrun (patched by rubikitch)
== 1.0.2 (2000-06-03)
* update document
== 1.0.1 (2000-06-01)
* modify syntax error (patched by rubikitch)
* new command "clean" (patched by rubikitch)
== 1.0.0 (2000-05-30)
* first release
setup-3.4.1/NEWS.ja 0000644 0001750 0001750 00000012155 10340062165 014456 0 ustar aamine aamine 0000000 0000000 = NEWS
== 3.4.1 (2005-11-20)
* [CHANGE] lib/ 以下からインストールするファイルを *.rb に限定しないことにした。
* [CHANGE] #!/usr/bin/env ruby もデフォルトでアップデートする
* [fix] --shebang オプションが動いていなかった
* [fix] --without-ext オプションが動いていなかった
* [fix] --rubypath のデフォルト値に拡張子をつけた (Thanks U.Nakamura)
* [fix] タスク show, setup, test, clean, distclean に引数を渡すと正しく終了しなかった
== 3.4.0 (2005-09-25)
* [fix] Windows で shebang を修正する途中にエラーになる問題を修正
* [new] 新しいタスク test を追加
* [new] conf/ 以下からコンフィグファイルをインストールするようになった
* [new] man/ 以下から man ページをインストールするようになった
* [new] 新しい config オプション --installdirs
* [new] 新しい config オプション --shebang
* [new] 新しい config オプション --sysconfdir
* [new] 新しい config オプション --mandir
* [new] 新しい config オプション --libruby
* [new] 新しい config オプション --localstatedir
== 3.3.1 (2004-10-02)
* [fix] #!を合わせるコードにバグがあった
* [fix] configで相対パスを設定すると無限ループになる
== 3.3.0 (2004-09-21)
* [new] 引数がないときは自動的に config setup install を実行する
* [new] config setup install を一気に実行する新しいタスク「all」
== 3.2.4 (2004-02-12)
* [new] --make-prog のデフォルト値を CONFIG['configure_args'] から取る [ruby-list:39186]
* [fix] ファイルを開くときは常にバイナリモードにする (その2) [ruby-list:39184]
* [fix] InstalledFiles に書き込まれるパスが間違っていた
== 3.2.3 (2004-02-12)
* [fix] ファイルを開くときは常にバイナリモードにする [ruby-list:39158]
== 3.2.2 (2003-12-16)
* [fix] metaconfigを使うとread_fileでエラーになっていた (thanks Guillaume Marcais)
* [fix] pre-configで設定した値が保存されていなかった (thanks Alex Fenton)
* [fix] data/からは*.elcや*.soもインストールすべき (thanks Rubikitch)
== 3.2.1 (2003-09-01)
* [fix] 全く動かなかった
== 3.2.0 (2003-08-27)
* [CHANGE] install.rb を setup.rb にマージした。
* [fix] clean/distclean が config 前に呼べなかったのを修正。
== 3.1.5 (2003-08-21)
* [CHANGE] lib/ からは *.rb のみインストールすることにした
* [CHANGE] 早くも MANIFEST 廃止
== 3.1.4 (2003-02-25)
* [new] CVS が無視するファイル (CVS/ *~ *.bak #* .* など) を無視する
* [new] MANIFEST というファイルでインストールするファイルを明示的に指定するようにした
* [new] 新しいタスク distclean
* install.rb/setup.rb だけでなく、構築時に使うファイルも配布するようにした
== 3.1.3 (2002-12-06)
* ヘルプメッセージを改善した
== 3.1.2 (2002-05-07)
* [fix] config --without が動かなかった
* [fix] InstalledFiles の中身がおかしかった
== 3.1.1 (2002-01-11)
* [CHANGE] config --install-prefix を install --prefix に移動
* [new] コンフィグ --site-ruby-common を追加
* [new] metaconfig インターフェイス set_config_default(n,v) を追加
== 3.1.0 (2002-01-08)
* [new] コンフィグ --without-ext を追加
* [new] コンフィグ --install-prefix を追加 [rubyist:0984]
* [new] フックインターフェイス get_config(k), set_config(k,v) を追加
* [new] config オプションのコンフィグファイル metaconfig [ruby-list:33139]
* [fix] setup.rb と同じディレクトリにあるフックを実行していなかった
(ただし package/ 直下のファイルは実行しません。仕様です。)
== 3.0.2 (2001-10-01)
* Ruby 1.4.4 〜 1.6.3 で動かなかったバグを修正
(rbconfig['rubylidir'] がない)
== 3.0.1 (2001-09-07)
* 新しいオプション -q, --quiet, --verbose
* 文字列埋めこみの 'setup.rb' をパラメタライズ
== 3.0.0 (2001-08-28)
* 単体パッケージ向けインストーラ install.rb
* install.rb をベースに setup.rb を再構築
* 実際にインストールしたファイルのリストを InstalledFiles に出力
* --with/--without はパッケージ名のみ受けつける
* config - --with-foo=bar で extconf に引数を指定
* site_ruby が変更される可能性に対処 (thanks Akira Yamada)
== 2.2.1 (2001-08-01)
* --with, --without で落ちるバグを修正 (reported by Knu)
== 2.2.0 (2001-06-30)
* PATHCONV から setup/*.rb へ移行
== 2.1.0 (2001-06-30)
* ネストしたコンフィグ設定 (--prefix など) に対応
* タスクをフックできるようにした (thanks rubikitch)
* srcdir 対応
== 2.0.4 (2001-04-07)
* Ruby 1.4 に対応
== 2.0.3 (2001-03-26)
* clean で Makefile がなくても無視 (変えた)
* Windows の stat() のバグに対応
== 2.0.2 (2001-02-13)
* clean で Makefile がなくても無視 (thanks rubikitch)
* DOS のドライブレターに対応
== 2.0.1 (2001-02-09)
* 拡張モジュールをコンパイルする時、毎回 clean するようにした
* extconf.rb を実行するとき新しい Ruby を起動しないようにした
* config --rbconfig=file
== 2.0.0 (2000-12-19)
* amstd 依存をなくした
* setup.rb 用 README のテンプレートをつけた
* install --no-harm
== 1.0.7 (2000-11-18)
* --without=ext/* とできるようにした
== 1.0.6 (2000-08-27)
* 新オプション --make-prog (patched by Katsuyuki Komatsu)
== 1.0.5 (2000-08-27)
* 常に Makefile を作りなおす (reported by Dave Thomas)
== 1.0.4 (2000-07-13)
* --with、--without にディレクトリを指定できるようにした
== 1.0.3 (2000-06-08)
* 新コマンド dryrun (patched by rubikitch)
== 1.0.2 (2000-06-03)
* ドキュメントを更新
== 1.0.1 (2000-06-01)
* いきなりバグがあった (patched by rubikitch)
* 新コマンド clean (patched by rubikitch)
== 1.0.0 (2000-05-30)
* 初リリース
setup-3.4.1/doc.en/ 0000755 0001750 0001750 00000000000 10340062165 014530 5 ustar aamine aamine 0000000 0000000 setup-3.4.1/doc.en/hookapi.html 0000644 0001750 0001750 00000004332 10340062165 017052 0 ustar aamine aamine 0000000 0000000
Hook Script API
Hook Script API
- get_config(key) -> String
- config(key) -> String
get a configuration. (e.g. config('prefix') for --prefix)
- set_config(key, val)
set a configuration KEY to VAL. (e.g. set_config("prefix", "/usr"))
- curr_srcdir -> String
the current srcdir.
- curr_objdir -> String
the current objdir.
- srcdir_root -> String
the root directory of srcdir.
When the hook script is called from setup.rb, this method
returns the top directory of each package directory
(ARCHIVE_TOP/packages/*/).
- objdir_root -> String
the root directory of objdir.
When the hook script is called from setup.rb, this method
returns the top directory of each package directory
(OBJDIR/packages/*/).
- srcfile(filename) -> String
expands relational path FNAME which is in the current srcdir,
into the absolute path.
- srcexist?(filename)
true if a file FNAME exists in the current srcdir.
- srcdirectory?(filename)
true if a directory FNAME exists in the current srcdir.
- srcfile?(filename)
true if a normal file FNAME exists in the current srcdir.
- srcentries(relative_path = '.') -> [String]
returns the list of file entiries in the directory
"current srcdir + '/' + relpath"
- srcfiles(relative_path = '.') -> [String]
returns the list of file names in the directory
"current srcdir + '/' + relpath"
- srcdirectories(relative_path = '.') -> [String]
returns the list of directory names in the directory
"current srcdir + '/' + relpath"
setup-3.4.1/doc.en/index.html 0000644 0001750 0001750 00000001372 10340062165 016530 0 ustar aamine aamine 0000000 0000000
setup.rb User Manual
setup.rb User Manual
setup.rb is the generic installer for ruby scripts/extentions.
You can automate configuration and installation of your program
package.
setup-3.4.1/doc.en/usage.html 0000644 0001750 0001750 00000012324 10340062165 016524 0 ustar aamine aamine 0000000 0000000
Installing Programs with setup.rb
Installing Programs with setup.rb
Quick Start
Type this (You might needs super user previledge):
($ su)
# ruby setup.rb
If you want to install a program in to your home directory
($HOME), use following instead:
$ ruby setup.rb all --prefix=$HOME
Detailed Installtion Process
setup.rb invokes installation by three steps. There are
"config", "setup" and "install". You can invoke each steps
separately as following:
$ ruby setup.rb config
$ ruby setup.rb setup
# ruby setup.rb install
You can controll installation process by giving detailed
options for each tasks. For example, --bin-dir=$HOME/bin
let setup.rb install commands in $HOME/bin.
For details, see "Task Options".
Global Options
"Global Option" is a command line option which you can use
for all tasks. You must give a global option before any task
name.
- -q,--quiet
suppress message outputs
- --verbose
output messages verbosely (default)
- -h,--help
prints help and quit
- -v,--version
prints version and quit
- --copyright
prints copyright and quit
Tasks
These are acceptable tasks:
- all
Invokes `config', `setup', then `install'.
Task options for all is same with config.
- config
Checks and saves configurations.
- show
Prints current configurations.
- setup
Compiles ruby extentions.
- install
Installs files.
- test
Invokes tests.
- clean
Removes created files.
- distclean
Removes all created files.
Task Options for CONFIG/ALL
You can pass following long options for CONFIG task
and ALL task.
All options accept parameterized value, like
--rbdir=$siterubyver or --sodir=$siterubyverarch.
On UNIX shells, you should escape "$" character,
so use --rbdir=\$siterubyver or --sodir=$siterubyverach.
- --installdirs=(std|site|home)
A handy option to set common install target.
std: install files under $libruby.
site: install files under $siteruby.
home: install files under home directory ($HOME).
- --prefix=PATH
The path prefix of target directory pathes like $bindir, $libdir...
- --bindir=PATH
The directory for commands.
- --rbdir=PATH
The directory for ruby scripts.
- --sodir=PATH
The directory for ruby extentions.
- --datadir=PATH
The directory for shared data.
- --sysconfdir=PATH
The directory for configuration files.
- --mandir=PATH
The directory for manual pages.
- --libruby=PATH
The directory for ruby libraries.
- --librubyver=PATH
The directory for standard ruby libraries.
- --librubyverarch=PATH
The directory for standard ruby extensions.
- --siteruby=PATH
The directory for version-independent non-standard
ruby libraries
- --siterubyver=PATH
The directory for non-standard ruby libraries.
- --siterubyverarch=PATH
The directory for non-standard ruby extensions.
- --rubypath=PATH
The path to set to #! line.
- --shebang=(all|ruby|never)
Shenbang line (#!) rewriting mode.
all: replace all shebang lines.
ruby: replace shebang lines which invokes ruby.
never: never rewrite shebang.
- --rubyprog=PATH
The ruby program using for installation.
- --makeprog=NAME
The make program to compile ruby extentions.
- --without-ext
Forces to setup.rb never to compile/install
ruby extentions.
- --rbconfig=PATH
Your rbconfig.rb to load.
If there's the directory named "packages",
You can also use these options:
- --with=NAME,NAME,NAME...
Package names which you want to install.
- --without=NAME,NAME,NAME...
Package names which you do not want to install.
[NOTE] You can pass options to extconf.rb like this:
ruby setup.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
Task Options for INSTALL
- --no-harm
prints what to do and done nothing really.
- --prefix=PATH
The prefix of the installing directory path.
This option may help binary package maintainers.
A default value is an empty string.
setup-3.4.1/doc.en/devel.html 0000644 0001750 0001750 00000012645 10340062165 016525 0 ustar aamine aamine 0000000 0000000
Creating Packages with setup.rb
Creating Packages with setup.rb
Creating Single Package Archive
"Single Package Archive" means the archive which includes
only one PACKAGE. "package" means one set of ruby scripts,
ruby extentions, commands, and data files.
setup.rb requires that the archive is structured like this:
PackageTop/
setup.rb
lib/
(ruby scripts)
ext/
(ruby extentions)
bin/
(commands)
data/
(data files)
conf/
(configuration files)
man/
(manual pages)
test/
(tests)
Each file/directories acts as below:
- setup.rb
The installer. This file is included in this archive.
Just copy it to your package.
- lib/, bin/, data/, conf/, man/
These directories includes files which are to be installed.
This directory tree is mirrored to the target directory, from 'lib/'
to 'RUBYLIB/', from 'bin/' to 'BINDIR/', from 'data/' to 'DATADIR/' ....
Use 'lib/' for ruby scripts, 'bin/' for commands, 'data/' for any
other data files, 'conf/' for configuration files, 'man/' for
manual pages.
- ext/
'ext/' directory includes source code of ruby extentions.
If you want to install 'RUBYLIB/ARCH/someext.so', create
a directory 'ext/someext/' and put source files into it.
[WARNING] All extention source directories MUST include
extconf.rb or MANIFEST.
- test/
'test/' directory contains test scripts. You must write
test scripts which run on test/unit library.
Creating Multi-Package Archive
setup.rb can handle an archive which includes multiple PACKAGEs.
setup.rb requires the archive is structured as below:
PackageTop/
setup.rb
packages/ <--- fixed name
tmail/ <--- tmail package
bin/
lib/
ext/
data/
conf/
man/
test/
raccrt/ <--- raccrt package
bin/
lib/
ext/
data/
conf/
man/
test/
strscan/ <--- strscan package
bin/
lib/
ext/
data/
conf/
man/
test/
amstd/ <--- amstd package
bin/
lib/
ext/
data/
conf/
man/
test/
Hooking Tasks
You can hook any tasks, such as "config" "setup".
For example, you want to make some files in 'lib/tmail/' when setup.
Then create file 'lib/tmail/pre-setup.rb' and put this:
# pre-setup.rb
# process grammer file
system "racc #{srcdir_root + '/src/mp.y'} -o mailp.rb"
# require all ruby scripts in this directory from _loadlib.rb.
list = Dir.glob(curr_srcdir + '/*.rb').collect {|n| File.basename(n) }
File.open( '_loadlib.rb', 'w' ) {|f|
f.puts list.collect {|n| "require 'tmail/" + n + "'" }
}
File.open( '../tmail.rb', 'w' ) {|f|
f.puts "require 'tmail/_loadlib'"
}
This file is evaluated on task "setup" in the directory,
before processing any other thing. Acceptable hook file names are:
{pre,post}-{config,setup,install,test,clean,distclean}.rb
[NOTE] You can also put hook files in the top directory of archive
and/or the type-root directory ('bin/', 'lib/',...).
srcdir/objdir support
setup.rb supports srcdir/objdir separation. In other words,
you can compile everything out of the source directory.
If you write hooks, you should supports srcdir/objdir system.
When you read source code, read it from srcdir. When you write
anything, write it to the current directory. There's also some
APIs to help your work. see
,<a href="hookapi.html">Hook Script APIs Reference Manual</a>
metaconfig
You can add new config options by writing file "metaconfig".
metaconfig must be placed in the package-root directory.
Here is a simple example of metaconfig.
add_path_config 'libc', '/lib/libc.so', 'path to the C standard library'
add_bool_config 'win32', false, 'compile with Win32 support'
This script defined new config option --libc and --win32.
In 'metaconfig', you can use some APIs described in
,<a href="metaconfapi.html">metaconfig API Reference Manual</a>
Backward Compatibility
I do not assure any backward compatibility for the setup.rb.
If you'd like old behavior, just use old version.
License
GNU LGPL, Lesser General Public License version 2.1.
For details, see file "COPYING".
NOTE: You CAN distribute your program under the any licenses
you like. LGPL does not force you to make your programs LGPL
while the installer is LGPL'ed one.
Installation Manual
You can freely copy/edit and/or distribute Usage_*.txt files
which are included in this archive. I do not claim any rights
on them. Removing my copyright is also OK.
setup-3.4.1/doc.en/news.html 0000644 0001750 0001750 00000013544 10340062165 016401 0 ustar aamine aamine 0000000 0000000 NEWS
3.4.1 (2005-11-20)
- [CHANGE] do not apply *.rb filter for lib/**.
- [CHANGE] updates "#!/usr/bin/env ruby" on --shebang=ruby (it is default).
- [fix] --shebang option did not work.
- [fix] --without-ext option did not work.
- [fix] default --rubypath value should include file extension. (Thanks U.Nakamura)
- [fix] task SHOW, SETUP, TEST, CLEAN, DISTCLEAN with any argument wrongly caused exception.
3.4.0 (2005-09-25)
- [fix] fix Windows specific bug, which causes error while
modifying bin/*.rb files in setup phase.
- [new] new task `test'.
- [new] installs configuration files from conf/.
- [new] installs man pages from man/.
- [new] new config option: --installdirs.
- [new] new config option: --shebang.
- [new] new config option: --sysconfdir.
- [new] new config option: --mandir.
- [new] new config option: --libruby.
- [new] new config option: --localstetedir.
3.3.1 (2004-10-02)
- [fix] `install' did not work if bin/*.rb exists.
- [fix] relative $prefix path caused infinite loop.
3.3.0 (2004-09-21)
- [new] Invoke config-setup-install when no global task is given.
- [new] new task `all', which invokes config-setup-install.
3.2.4 (2004-02-12)
- [new] get default value of --make-prog from CONFIG['configure_args']. [ruby-list:39186]
- [fix] open files in binary mode, also on ruby 1.8. [ruby-list:39184]
- [fix] wrong path was written in InstalledFiles.
3.2.3 (2004-02-12)
- [fix] open files in binary mode. [ruby-list:39158]
3.2.2 (2003-12-16)
- [fix] did not work with metaconfig. (thanks Guillaume Marcais)
- [fix] should save configurations after running all hooks. (thanks Alex Fenton)
- [fix] does not reject *.elc, *.so, etc. (thanks Rubikitch)
3.2.1 (2003-09-01)
3.2.0 (2003-08-27)
- [CHANGE] install.rb is merged into the setup.rb.
- [fix] clean/distclean should be able to invoke before configuring.
3.1.5 (2003-08-21)
- [CHANGE] install only *.rb from the lib/ directory.
- [CHANGE] ban MANIFEST.
3.1.4 (2003-02-25)
- [new] ignore CVS/ *~ *.bak #* .* etc.
- [new] explicit file designation by MANIFEST.
- [new] new task `distclean'.
- bundle Makefile and asm.rb, which are tools to create
install.rb/setup.rb from source file.
3.1.3 (2002-12-06)
3.1.2 (2002-05-07)
- [fix] config --without did not work.
- [fix] wrong filenames were written to InstalledFiles.
3.1.1 (2002-01-11)
- [CHANGE] changes "config --install-prefix" to "install --prefix"
- [new] new config option --site-ruby-common
- [new] new metaconfig interface set_config_default(n,v)
3.1.0 (2002-01-08)
- [new] new config option --without-ext
- [new] new config option --install-prefix
- [new] new hook interface get_config(k), set_config(k,v)
- [new] config option config file 'metaconfig'
- [fix] setup.rb executes hooks in top directory
(does not run hooks in packages/ dir. This is a feature.)
3.0.2 (2001-10-01)
- did not work on Ruby 1.4.4 ... 1.6.3
(rbconfig['rubylidir'] does not exist.)
3.0.1 (2001-09-07)
- new options -q, --quiet, --verbose
- parametarizes 'setup.rb' in strings
3.0.0 (2001-08-28)
- archive structure completely changed.
- single package installer install.rb
- restructs setup.rb
- outputs installed file names into the file "InstalledFiles"
- --with/--without accepts only package names.
- "config -- --with-foo=bar" passes options to extconf.rb
- supports customized site_ruby (thanks Akira Yamada)
2.2.1 (2001-08-01)
- modify --with and --without (reported by Knu)
2.2.0 (2001-06-30)
- ban PATHCONV. Use setup/*.rb instead.
2.1.0 (2001-06-30)
- support parameterized config value (i.e. --prefix)
- Developpers can hook any tasks. (thanks rubikitch)
- support srcdir
2.0.4 (2001-04-07)
2.0.3 (2001-03-26)
- ignore if Makefile is not exist when "make clean"
- avoids windows' stat() bug
2.0.2 (2001-02-13)
- ignore if Makefile is not exist when "make clean" (thanks rubikitch)
- support DOS's drive letter
2.0.1 (2001-02-09)
- does "make clean" on each SETUP
- does not fork new ruby process when executing extconf.rb
- config --rbconfig=file
2.0.0 (2000-12-19)
- now setup.rb does not depend on amstd
- install --no-harm
- add templates
1.0.7 (2000-11-18)
1.0.6 (2000-08-27)
- new option --make-prog=[make] (patched by Katsuyuki Komatsu)
1.0.5 (2000-08-27)
- generates Makefile every time
1.0.4 (2000-07-13)
- can pass directory name (like ext/cparse) for --with, --without
1.0.3 (2000-06-08)
- new command dryrun (patched by rubikitch)
1.0.2 (2000-06-03)
1.0.1 (2000-06-01)
- modify syntax error (patched by rubikitch)
- new command "clean" (patched by rubikitch)
1.0.0 (2000-05-30)
setup-3.4.1/doc.en/metaconfapi.html 0000644 0001750 0001750 00000004253 10340062165 017710 0 ustar aamine aamine 0000000 0000000
metaconfig API
metaconfig API
- add_path_config(confname, default, description)
- confname
- String
- default
- String
- description
- String
defines a path config option CONFNAME.
DEFAULT is the default value of this option.
DESCRIPTION is the short description of this option
which is used from '--help' global option.
- add_bool_config(confname, default, description)
- confname
- String
- default
- String
- description
- String
defines a bool config option CONFNAME.
DEFAULT is the default value of this option.
DESCRIPTION is the short description of this option
which is used from '--help' global option.
- set_config_default(confname, val)
- confname
- String
- val
- String | bool
set default value of config CONFNAME to VAL.
If CONFNAME is a bool config, VAL should be boolean.
Else VAL should be a String.
- remove_config(confname)
- confname
- String
removes config entry CONFNAME from the installer completely.
You must use this method at your own lisk. For example,
'remove_config("prefix")' causes fatal error.
- packages -> [String]
Returns the list of package names.
This method raises RuntimeError if called in the single
package archive.
- declare_packages(list)
- list
- [String]
Set the ordered list of installing package names.
This method raises RuntimeError if called in the single
package archive.
setup-3.4.1/doc.ja/ 0000755 0001750 0001750 00000000000 10340062165 014520 5 ustar aamine aamine 0000000 0000000 setup-3.4.1/doc.ja/hookapi.html 0000644 0001750 0001750 00000004365 10340062165 017050 0 ustar aamine aamine 0000000 0000000
$B%U%C%/%9%/%j%W%H(B API $B%j%U%!%l%s%9(B
$B%U%C%/%9%/%j%W%H(B API $B%j%U%!%l%s%9(B
- get_config(key) $B"*(B String
- config(key) $B"*(B String
$B%3%s%U%#%0(B key $B$NCM$r
- set_config(key, val)
$B%3%s%U%#%0(B key $B$K(B val $B$r%;%C%H$7$^$9!#(B
- curr_srcdir $B"*(B String
$B%+%l%s%H(B srcdir
- curr_objdir $B"*(B String
$B%+%l%s%H(B objdir$B!#(B'.' $B$HF1$8!#(B
- srcdir_root $B"*(B String
srcdir $B$N%k!<%H!#(Bsetup.rb $B;HMQ;~$N%k!<%H$O3F%Q%C%1!<%8$N(B
$B%H%C%W%G%#%l%/%H%j$G$9!#(B
- objdir_root $B"*(B String
objdir $B$N%k!<%H!#(Bsetup.rb $B;HMQ;~$N%k!<%H$O3F%Q%C%1!<%8$N(B
$B%H%C%W%G%#%l%/%H%j$G$9!#(B
- srcfile(filename) $B"*(B String
$B%+%l%s%H(B srcdir $B$N%U%!%$%k(B fname $B$r@dBP%Q%9$KE83+$9$k!#(B
- srcexist?(filename)
$B%+%l%s%H(B srcdir $B$K(B fname $B$,B8:_$9$l$P??!#(B
- srcdirectory?(filename)
$B%+%l%s%H(B srcdir $B$K%G%#%l%/%H%j(B fname $B$,$"$l$P??!#(B
- srcfile?(filename)
$B%+%l%s%H(B srcdir $B$K%N!<%^%k%U%!%$%k(B fname $B$,$"$l$P??!#(B
- srcentries(relative_path = '.') $B"*(B [String]
$B%+%l%s%H(B srcdir + '/' + relpath $B$K$"$k%U%!%$%k$N%j%9%H!#(B
- srcfiles(relative_path = '.') $B"*(B [String]
$B%+%l%s%H(B srcdir + '/' + relpath $B$K$"$k%N!<%^%k%U%!%$%k$N%j%9%H!#(B
- srcdirectories(relative_path = '.') $B"*(B [String]
$B%+%l%s%H(B srcdir + '/' + relpath $B$K$"$k%G%#%l%/%H%j$N%j%9%H!#(B
setup-3.4.1/doc.ja/index.html 0000644 0001750 0001750 00000001523 10340062165 016516 0 ustar aamine aamine 0000000 0000000
setup.rb $B%f!<%6%^%K%e%"%k(B
setup.rb $B%f!<%6%^%K%e%"%k(B
setup.rb $B$O(B Ruby $B%W%m%0%i%`$N%Q%C%1!<%8$rBP>]$H$7$?%3%^%s%I%i%$%s(B
$B%Y!<%9$N%$%s%9%H!<%i$G$9!#%$%s%9%H!<%k@h$J$I$rHs>o$K=@Fp$K@_Dj(B
$B$G$-$k$N$,FCD'$G$9!#(B
setup-3.4.1/doc.ja/usage.html 0000644 0001750 0001750 00000016377 10340062165 016530 0 ustar aamine aamine 0000000 0000000
setup.rb $B$r;H$C$?%W%m%0%i%`$N%$%s%9%H!<%k(B
setup.rb $B$r;H$C$?%W%m%0%i%`$N%$%s%9%H!<%k(B
$B$3$NJ8=q$G$O%(%s%I%f!<%6$,(B setup.rb $B$r;H$C$F(B
$B%Q%C%1!<%8$r%$%s%9%H!<%k$9$kJ}K!$r@bL@$7$^$9!#(B
$B:G$bC1=c$JJ}K!(B
$BDL>o$O
($ su)
# ruby setup.rb
$B<+J,$N%[!<%`%G%#%l%/%H%j0J2<$K%$%s%9%H!<%k$7$?$$$H$-$O(B
$B
$ ruby setup.rb all --prefix=$HOME
$B%$%s%9%H!<%k$N>\:Y(B
$B0J2/$7>\:Y$K@bL@$7$^$9!#(B
setup.rb $B$G$O%$%s%9%H!<%k$N%W%m%;%9$,!V(Bconfig$B!W!V(Bsetup$B!W!V(Binstall$B!W(B
$B$N;0$D$NCJ3,$KJ,$+$l$F$$$^$9!#(Bsetup.rb $B$r0z?t$J$7$G
$ ruby setup.rb config
$ ruby setup.rb setup
# ruby setup.rb install
$B$=$7$F3FCJ3,$K%*%W%7%g%s$rIU$1$k$H%$%s%9%H!<%k@h$J$I$r:Y$+$/@)8f(B
$B$9$k$3$H$,$G$-$^$9!#Nc$($P(B config $B$K!V(B--bin-dir=$HOME/bin$B!W%*%W(B
$B%7%g%s$rIU$1$k$H%3%^%s%I$,(B $HOME/bin $B$K%$%s%9%H!<%k$5$l$^$9!#(B
$B>\$7$/$O!V%?%9%/%*%W%7%g%s!W$N@a$r8+$F$/$@$5$$!#(B
$B%0%m!<%P%k%*%W%7%g%s(B
$B%0%m!<%P%k%*%W%7%g%s$H$O!"%?%9%/(B (config $B$d(B setup) $B$K4X$i$:(B
$B;XDj$G$-$k%*%W%7%g%s$N$3$H$G$9!#I,$:%?%9%/$NA0$K;XDj$7$F$/$@$5$$!#(B
- -q,--quiet
$B%a%C%;!<%8=PNO$r:G>.8B$K$9$k(B
- --verbose
$Bu67$r>\:Y$KI=<($9$k(B ($B%G%U%)%k%H$O%*%s(B)
- -h,--help
setup.rb $B$N;H$$$+$?$J$I$rI=<((B
- -v,--version
setup.rb $B$N%P!<%8%g%s$rI=<((B
- --copyright
setup.rb $B$NCx:n8"$rI=<((B
$B%?%9%/(B
$B%?%9%/$O0J2<$N<7$D$G$9!#(B
- all
config, setup, install $B$r0l5$$K9T$&!#(B
$B%?%9%/%*%W%7%g%s$O(B config $B$H6&DL!#(B
- config
$B@_Dj$r%A%'%C%/$7$?$&$($GJ]B8$9$k(B
- show
$B8=:_$N@_Dj$rI=<($9$k(B
- setup
$B%3%s%Q%$%k$J$I!"%U%!%$%kFbMF$NJQ99$r9T$&$b$N(B
- install
$B%$%s%9%H!<%k$r9T$&!#(B
- test
$B%F%9%H$r
- clean
setup $B$G:n@.$7$?$b$N$r>C$9(B
- distclean
setup $B$G:n@.$7$?$b$N$r>C$9(B ($B$h$j6/NO(B)
config/all $B$N%?%9%/%*%W%7%g%s(B
config $B%?%9%/$G;H$($k%*%W%7%g%s$r@bL@$7$^$9!#(B
$BCM$r
$B$9$Y$F$N%*%W%7%g%s$G!"CM$KJL$NJQ?t$r;H$&$3$H$,$G$-$^$9!#(B
$BNc$($P(B Ruby $B%i%$%V%i%j$r(B site_ruby $B$K%$%s%9%H!<%k(B
$B$7$?$1$l$P!"(B--rbdir=$siterubyver $B$H;XDj$G$-$^$9!#(B
UNIX $B%7%'%k$G$O!V(B$$B!W$r%(%9%1!<%W$7$F(B --rbdir=\$siterubyver
$B$H$7$F$/$@$5$$!#(B
- --installdirs=(std|site|home)
$B$h$/;H$o$l$k%$%s%9%H!<%k@h%G%#%l%/%H%j$r(B
$B$^$H$a$F%;%C%H$9$k%*%W%7%g%s!#(B
std: $libruby $B0J2<$K%$%s%9%H!<%k$9$k!#(B
site: $siteruby $B0J2<$K%$%s%9%H!<%k$9$k!#(B
home: $B%[!<%`%G%#%l%/%H%j2<$K%$%s%9%H!<%k$9$k!#(B
- --prefix=PATH
$bindir, $libdir $B$J$I$N6&DLItJ,(B
- --bindir=PATH
$B
- --rbdir=PATH
Ruby $B%i%$%V%i%j$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j!#(B
- --sodir=PATH
Ruby $B$N3HD%%b%8%e!<%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j!#(B
- --datadir=PATH
$B$=$NB>$N%G!<%?%U%!%$%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j!#(B
- --sysconfdir=PATH
$B@_Dj%U%!%$%k$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j!#(B
- --mandir=PATH
man $B%Z!<%8$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j!#(B
- --libruby=PATH
Ruby $B%i%$%V%i%j$r%$%s%9%H!<%k$9$k%G%#%l%/%H%j(B
- --librubyver=PATH
Ruby $B$NI8=`E:IU%i%$%V%i%j$,%$%s%9%H!<%k$5$l$k%G%#%l%/%H%j(B
- --librubyverarch=PATH
Ruby $B$NI8=`E:IU3HD%%i%$%V%i%j$,%$%s%9%H!<%k$5$l$k%G%#%l%/%H%j(B
- --siteruby=PATH
Ruby $B$N%P!<%8%g%s$K0MB8$7$J$$!"HsI8=`$N(B Ruby $B%i%$%V%i%j$,(B
$B%$%s%9%H!<%k$5$l$k%G%#%l%/%H%j(B (site_ruby)
- --siterubyver=PATH
Ruby $B$N%P!<%8%g%s$K0MB8$9$k!"HsI8=`$N(B Ruby $B%i%$%V%i%j$,(B
$B%$%s%9%H!<%k$5$l$k%G%#%l%/%H%j(B ($B%P!<%8%g%s$D$-(B site_ruby)$B!#(B
- --siterubyverarch=PATH
$BHsI8=`$N(B Ruby $B3HD%%i%$%V%i%j$,%$%s%9%H!<%k$5$l$k%G%#%l%/%H%j(B
($B%P!<%8%g%s!&%"!<%-%F%/%A%cL>$D$-(B site_ruby)$B!#(B
- --rubypath=PATH
shebang $B9T(B (#!) $B$K%;%C%H$9$k(B Ruby $B%$%s%?%W%j%?$N%Q%9!#(B
$B$D$^$j!"%$%s%9%H!<%k$7$?%W%m%0%i%`$r
- --shebang=(all|ruby|never)
shebang $B9T(B (#!) $B$N=q$-49$(%b!<%I$G$9!#(B
all: $B$9$Y$F$N%U%!%$%k$N(B shenbang $B9T$r=q$-49$($b$7$/$ODI2C$9$k!#(B
ruby: ruby $B$r5/F0$7$F$$$k$H;W$o$l$k(B shebang $B9T$@$1$r=q$-49$($k!#(B
never: $B$$$C$5$$(B shebang $B9T$r=q$-49$($J$$!#(B
- --rubyprog=PATH
$B%$%s%9%H!<%k;~$K;H$&(B ruby $B%W%m%0%i%`$X$N%Q%9!#(B
- --makeprog=NAME
$B3HD%%i%$%V%i%j$N%3%s%Q%$%k$K;HMQ$9$k(B make $B%W%m%0%i%`!#(B
- --without-ext
$B3HD%%b%8%e!<%k$N%3%s%Q%$%k!&%$%s%9%H!<%k$rL5>r7o$K(B
$B%9%-%C%W$9$k!#$?$@$7EvA3$J$,$i!"%$%s%9%H!<%k$5$l$k(B
$B%W%m%0%i%`<+BN$,3HD%%b%8%e!<%k$J$7$GF0$/$h$&$K$J$C$F(B
$B$$$J$1$l$P0UL#$,$"$j$^$;$s!#(B
- --rbconfig=PATH
$B%G%U%)%k%HCM$N@_Dj$K;H$&(B rbconfig.rb
$B$^$?%^%k%A%Q%C%1!<%8%"!<%+%$%V$G$O$3$l$K2C$($F0J2<$N%*%W%7%g%s$b;H$($^$9!#(B
- --with=NAME,NAME,NAME...
$B%$%s%9%H!<%k$9$k%Q%C%1!<%8(B
- --without=NAME,NAME,NAME...
$B%$%s%9%H!<%k$7$J$$%Q%C%1!<%8(B
$B$5$i$K!"!V(B--$B!W!J%^%$%J%9Fs$D!K$KB3$1$F%*%W%7%g%s$r;XDj$9$k$3$H$G(B
extconf.rb $B$K0z?t$rEO$9$3$H$,$G$-$^$9!#(B
ruby setup.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
install $B$N%?%9%/%*%W%7%g%s(B
- --no-harm
$B5sF0$rI=<($9$k$@$1$G
- --prefix=PATH
config $B$G7hDj$7$?%Q%9$N@hF,$K$5$i$K(B PATH $B$rIU2C$7$^$9!#(B
config --prefix $B$,%W%m%0%i%`$,
setup-3.4.1/doc.ja/devel.html 0000644 0001750 0001750 00000024331 10340062165 016510 0 ustar aamine aamine 0000000 0000000
setup.rb $B$r;H$C$?%Q%C%1!<%8$r:n$k(B
setup.rb $B$r;H$C$?%Q%C%1!<%8$r:n$k(B
$B%7%s%0%k%Q%C%1!<%8%"!<%+%$%V$r:n$k(B
$B!V%7%s%0%k%Q%C%1!<%8%"!<%+%$%V!W$H$O!"0J2<$N%U%!%$%k$,(B
$B0lAH$@$1F~$C$?%W%m%0%i%`%Q%C%1!<%8$N$3$H$G$9!#(B
- $B%3%^%s%I(B
- Ruby $B%i%$%V%i%j(B
- Ruby $B3HD%%i%$%V%i%j(B
- $B$=$NB>$N%G!<%?(B
$B$D$^$jIaDL$N%W%m%0%i%`%Q%C%1!<%8$N$3$H$G$9!#(B
$B%7%s%0%k%Q%C%1!<%8%"!<%+%$%V$r:n$k$K$O!"%"!<%+%$%V$r(B
$B0J2<$N%k!<%k$K=>$C$F%l%$%"%&%H$7$F$/$@$5$$!#(B
$B%"!<%+%$%V$N%H%C%W(B/
setup.rb
bin/
$B%3%^%s%IN`(B
lib/
Ruby $B%i%$%V%i%j(B
ext/
$B3HD%%b%8%e!<%k(B
data/
$B$=$NB>$N%G!<%?(B
conf/
$B@_Dj%U%!%$%k(B
man/
man $B%Z!<%8(B
test/
$B%F%9%H(B
bin/, lib/, ext/, data/, conf/, man/ $B$N2<$K$O3F!9%$%s%9%H!<%k$5$l$k%$%a!<%8$r(B
$B$=$N$^$^$K%U%!%$%k$rG[CV$7$^$9!#Nc$($P(B lib/tmail/header.rb $B$H$$$&%U%!%$%k$r(B
$BCV$/$H(B RUBYLIB/tmail/header.rb $B$H$7$F%$%s%9%H!<%k$5$l$^$9!#$J$*!"$3$l$i$N(B
$B%G%#%l%/%H%j$OCf?H$,6u$N$H$-$K$O>JN,$G$-$^$9!#(B
ext/ $B$OG[CV%k!<%k$,>/$7FCl=j$K%G%#%l%/%H%j$r:n$j!"$=$NCf$K(B
$BI,MW$J%U%!%$%k$rF~$l$^$9!#Nc$($P(B RUBYLIB/ARCH/tmail/parser.so $B$,I,MW$J$i$P!"(B
$B%G%#%l%/%H%j(B ext/tmail/parser/ $B$r:n$C$F$=$NCf$K(B parser.c $B$d(B extconf.rb,
depend, MANIFEST $B$J$I$rCV$-$^$9!#(B
[$BCm0U(B] setup.rb $B$O(B extconf.rb $B$^$?$O(B MANIFEST $B$,$"$k%G%#%l%/%H%j$@$1$r(B
$B%3%s%Q%$%kBP>]$K$7$^$9!#(B
$B:G8e$K!"(Btest/ $B$K$O%F%9%H%3!<%I$rCV$-$^$9!#(Bsetup.rb $B$O(B test/unit $B$G(B
$B=q$+$l$?%F%9%H$7$+
$B%^%k%A%Q%C%1!<%8%"!<%+%$%V$r:n$k(B
setup.rb $B$OJ#?t$N%Q%C%1!<%8$r0l$D$N%"!<%+%$%V$K$^$H$a$F!"$=$l$r(B
$BF1;~$K07$&$3$H$,$G$-$^$9!#Nc$($P0MB84X78$N$"$k%Q%C%1!<%8$rA4It(B
$B$^$H$a$FG[I[$7$?$j$9$k$N$K;H$($^$9!#(B
$B%^%k%A%Q%C%1!<%8%"!<%+%$%V$r:n$k$K$O!"$^$:%H%C%W$K(B setup.rb $B$H(B
$B%G%#%l%/%H%j(B packages/ $B$r:n$j!"$=$N2<$K%Q%C%1!<%8L>$N%G%#%l%/%H%j(B
$B$r:n$j$^$9!#$=$7$F$=$NCf$K%7%s%0%k%Q%C%1!<%8%"!<%+%$%V$HF1$8(B
$B%G%#%l%/%H%j%D%j!<$rG[CV$7$^$9!#$D$^$jA4BNA|$O0J2<$N$h$&$K$J$j$^$9!#(B
$B%"!<%+%$%V$N%H%C%W(B/
setup.rb
packages/
tmail/ # tmail $B%Q%C%1!<%8(B
bin/
lib/
ext/
data/
conf/
man/
test/
raccrt/ # raccrt $B%Q%C%1!<%8(B
bin/
lib/
ext/
data/
conf/
man/
test/
strscan/ # strscan $B%Q%C%1!<%8(B
bin/
lib/
ext/
data/
conf/
man/
test/
amstd/ # amstd $B%Q%C%1!<%8(B
bin/
lib/
ext/
data/
conf/
man/
test/
packages/ $B$N2<$K$"$k%G%#%l%/%H%jL>$,%Q%C%1!<%8L>$G$9!#(B
$B$3$N%Q%C%1!<%8L>$O(B setup.rb $B$N%X%k%W%a%C%;!<%8$KI=<($5$l!"(B
$B%$%s%9%H!<%k$9$k%Q%C%1!<%8$r(B --with $B$d(B --without $B$G%f!<%6$,(B
$BA*Br$9$k$H$-$K;H$o$l$^$9!#(B
$B$^$?%G%U%)%k%H$@$H%Q%C%1!<%8$O%=!<%H=g$K%$%s%9%H!<%k$5$l$^$9!#(B
$B=gHV$rJQ99$7$?$$$H$-$O(B metaconfig API $B$N(B declare_packages $B$r(B
$B;H$C$F$/$@$5$$!#(B
setup.rb $B$NF/$-(B
$B%U%!%$%k$r>e5-$N$H$*$jG[CV$7$F$*$1$P$"$H$O(B setup.rb $B$,<+F0E*$K(B
$B$=$l$J$j$NF0:n$r$7$F$/$l$^$9!#6qBNE*$K$O!"(Bsetup $B$N$H$-$K0J2<$N(B
$B$3$H$r
- bin/ $B0J2<$K$"$k%U%!%$%k$,(B #! $B$G;O$^$C$F$$$F$+$D(B
$BJ8;zNs(B ruby $B$r4^$`>l9g$O(B #! $B9T$r(B --ruby-path $B$KCV$-49$($k(B
- ext/ $B0J2<$N3HD%%b%8%e!<%k$r%3%s%Q%$%k$9$k(B
install $B$G$O0J2<$N$3$H$r
- bin/ $B0J2<$N%U%!%$%k$r(B --bindir $B$K%$%s%9%H!<%k(B
- lib/ $B0J2<$N(B *.rb $B$r(B --rbdir $B$K%$%s%9%H!<%k(B
- ext/ $B0J2<$N(B *.so $B$r(B --sodir $B$K%$%s%9%H!<%k(B
- data/ $B0J2<$N%U%!%$%k$r(B --datadir $B$K%$%s%9%H!<%k(B
- conf/ $B0J2<$N%U%!%$%k$r(B --localstatedir $B$K%$%s%9%H!<%k(B
- man/ $B0J2<$N%U%!%$%k$r(B --mandir $B$K%$%s%9%H!<%k(B
$B%U%C%/%U%!%$%k(B
$B%G%U%)%k%H$NF0:n$G$b$?$$$F$$$N>l9g$K$ODLMQ$7$^$9!#$7$+$7>l9g$K$h$C$F$O(B
$B%$%s%9%H!<%k;~$K$J$K$+FCJL$J:n6H$r$7$?$$$3$H$b$"$k$G$7$g$&!#$=$N(B
$B>l9g$OFCJL$J%U%!%$%k$rCV$/$3$H$GF0:n$rDI2C$9$k$3$H$,$G$-$^$9!#(B
$B$?$H$($P(B setup $B$N%?%$%_%s%0$K(B lib/tmail/ $B$G$J$K$+$r$7$?$$$H$7$?$i!"(B
lib/tmail/pre-setup.rb $B$r:n$C$F$=$NCf$K$d$j$?$$$3$H$r=q$-$^$9!#(B
# pre-setup.rb
# racc $B$NJ8K!%U%!%$%k$r$=$N>l$G%3%s%Q%$%k(B ($BIaDL!"$d$i$J$$(B)
system "racc #{srcdir_root + '/src/mp.y'} -o mailp.rb"
# require 'tmail' $B$G(B tmail/ $B$NCf?H$rA4It(B require $B$G$-$k$h$&$K$9$k(B
list = Dir.glob(curr_srcdir + '/*.rb').collect {|n| File.basename(n) }
File.open( '_loadlib.rb', 'w' ) {|f|
f.puts list.collect {|n| "require 'tmail/" + n + "'" }
}
File.open( '../tmail.rb', 'w' ) {|f|
f.puts "require 'tmail/_loadlib'"
}
$B0lHL$K$O!"%G%#%l%/%H%j$KF~$C$?D>8e$K(B pre-TASK.rb $B$r!"(B
$B%G%#%l%/%H%j$r=P$kD>A0$K(B post-TASK.rb $B$r
$B$^$?%U%C%/%9%/%j%W%H$Nl9g$O%$%s%9%H!<%i(B
$BA4BN$,B(:B$K<:GT$7$^$9!#5U$K8@$&$H!"=hM}<:GT$N;~$ONc30$rEj$2$l$P(B
$B$h$$$H$$$&$3$H$G$9!#(Bexit $B$O$7$J$$$G$/$@$5$$!#(B
$B$^$?%U%C%/%U%!%$%k$NNc$G(B srcdir_root $B$d(B curr_srcdir $B$H$$$&(B
$B%a%=%C%I$r;H$C$F$$$k$3$H$KCm0U$7$F$/$@$5$$!#(Bsetup.rb $B$K$O!"(B
$B:n$C$?%U%!%$%k$@$1$rJL$N%G%#%l%/%H%j$KCV$/;EAH$_$,$"$k(B
$B!J(Bsrcdir $B$H(B objdir $B$,6hJL$5$l$F$$$k!K$N$G!"%+%l%s%H%G%#%l%/%H%j$+$i(B
$BFI$a$P$h$$$H$O8B$j$^$;$s!#%U%C%/%U%!%$%kCf$G$O0J2<$N%k!<%k$K=>$C$F(B
$B$/$@$5$$!#(B
- $BFI$_$3$_$O>o$K8=:_$N(B srcdir (curr_srcdir) $B$+$i9T$&!#(B
- $B=q$-$3$_$O>o$K%+%l%s%H%G%#%l%/%H%j$KBP$7$F9T$&!#(B
srcdir/objdir $B$N;EAH$_(B
archive_top/ srcdir $B$OJQ99$7$J$$$G(B
ext/tmail/scanmail/
MANIFEST
depend
extconf.rb
scanmail.c
OBJ/ $BBP1~$9$k(B objdir $B$K:n$C$?$b$N$rCV$/(B
ext/tmail/scanmail/
Makefile
scanmail.o
scanmail.so
$B$3$N>l9g(B archive_top/ $B$r!V(Bsrcdir $B$N%k!<%H!W!"(B
OBJ/ $B$r!V(Bobjdir $B$N%k!<%H!W$H8@$$$^$9!#(B
$B$^$?(B archive_top/ext/tmail/scanmail/ $B$r!V%+%l%s%H(B srcdir$B!W!"(B
OBJ/ext/tmail/scanmail/ $B$r!V%+%l%s%H(B objdir$B!W$H8F$S$^$9!#(B
$B$3$&$7$F$*$/$H!"(Bsrcdir $B$KBP$7$F$OFI$_=P$7$7$+9T$o$l$J$$$N$G!"(B
clean $B$J$I$7$J$/$F$b>o$K(B srcdir $B$r:G>.8B$N%U%!%$%k$N$-$l$$$J(B
$B>uBV$KJ]$F$^$9!#$^$?%^%K%"%C%/$J$H$3$m$G$OJ#?t$N%/%m%9%3%s%Q%$%k$r(B
$BF1;~$K9T$C$?$j$b$G$-$k$h$&$K$J$j$^$9!#$=$3$^$G$$$+$J$/$H$b!"(B
$B%3%s%Q%$%k%*%W%7%g%s$@$1$rJQ$($F$$$/$D$b$N%P!<%8%g%s$r:n$C$?$j$9$k(B
$B$3$H$O$"$k$G$7$g$&!#$3$N;EAH$_$O$=$N$h$&$J>l9g$KJXMx$J$N$G$9!#(B
srcdir/objdir $BBP1~$O@dBPI,MW$H$$$&$o$1$G$O$"$j$^$;$s$,!"BP1~$7$F(B
$B$*$$$FB;$O$"$j$^$;$s!#(B
$B$^$?(B curr_srcdir $B$d(B srcdir_root $B$J$I(B
$B%U%C%/%U%!%$%kCf$G;H$($k(B API $B$K$D$$$F$OJL%Z!<%8$N(B
<a href="hookapi.html">$B%U%C%/(B API $B%j%U%!%l%s%9(B</a>
$B$r;2>H$7$F$/$@$5$$!#(B
$B%a%?%3%s%U%#%0(B
setup.rb $B$G$O!"(Bconfig $B$N%?%9%/%*%W%7%g%s$rA}$d$9$3$H$,$G$-$^$9!#(B
$B$3$N$?$a$K;H$&$N$,(B metaconfig $B%U%!%$%k$G$9!#(B
$BNc$($P!"(Blibc $B$N%Q%9$r;XDj$9$k$?$a$N(B config $B%*%W%7%g%s(B --libc $B$H!"(B
win32 $B%5%]!<%H$N%*%s%*%U$r;XDj$9$k$?$a$N%*%W%7%g%s(B --win32 $B$r(B
$BDI2C$7$F$_$^$7$g$&!#(Bsetup.rb $B$rCV$/$N$HF1$8%G%#%l%/%H%j$K(B metaconfig
$B$H$$$&%U%!%$%k$r:n$j!"$3$NCf$K0J2<$N$h$&$J(B Ruby $B%9%/%j%W%H$r=q$-$^$9!#(B
add_path_config 'libc', '/lib/libc.so', 'path to the C standard library'
add_bool_config 'win32', false, 'compile with Win32 support'
$B$3$l$G!"%Q%9$r;XDj$9$k%*%W%7%g%s(B --libc $B$H!"??56CM$r
ruby setup.rb config --libc=/lib/libc-devel.so --win32
$B$^$?(B setup.rb $B$N%X%k%W%a%C%;!<%8$K$b<+F0E*$KI=<($5$l$^$9!#(B
metaconfig $B$G;H$($k(B API $B$K$D$$$F$O(B
<a href="metaconfapi.html">metaconfig API $B%j%U%!%l%s%9%^%K%e%"%k(B</a>
$B$r;2>H$7$F$/$@$5$$!#(B
$B0JA0$N%P!<%8%g%s$H$N8_49@-(B
$B%$%s%9%H!<%i$H$$$&$b$N$NFC
- $B%G%#%l%/%H%j9=B$$,40A4$K0c$&(B
- PATHCONV $B$,$J$$(B
- share/ $B"*(B data/
- $B%U%C%/$N7A<0$,0c$&(B
- dryrun $B%3%^%s%I$,$J$$(B $B"*(B --prefix $B;H$C$F%$%s%9%H!<%k$7$F$/$@$5$$!#(B
$B%i%$%;%s%9$K$D$$$F(B
setup.rb $B<+BN$O(B GNU LGPL (Lesser General Public License) version 2.1
$B$K=>$C$FG[I[$7$^$9!#>\:Y$O%U%!%$%k(B COPYING $B$r8+$F$/$@$5$$!#$^$?!"(B
setup.rb $B$r;H$C$F%$%s%9%H!<%k$9$k%W%m%0%i%`$,(B LGPL $B$G$"$kI,MW$O(B
$B$"$j$^$;$s!#(B
$B%$%s%9%H!<%k%^%K%e%"%k(B
$B$3$N%"!<%+%$%V$K4^$^$l$F$$$k(B Usage_*.txt $B$O<+M3$K%3%T!C$7$F$b(B
$B9=$$$^$;$s!#(B
setup-3.4.1/doc.ja/news.html 0000644 0001750 0001750 00000014033 10340062165 016363 0 ustar aamine aamine 0000000 0000000 NEWS
3.4.1 (2005-11-20)
- [CHANGE] lib/ 以下からインストールするファイルを *.rb に限定しないことにした。
- [CHANGE] #!/usr/bin/env ruby もデフォルトでアップデートする
- [fix] --shebang オプションが動いていなかった
- [fix] --without-ext オプションが動いていなかった
- [fix] --rubypath のデフォルト値に拡張子をつけた (Thanks U.Nakamura)
- [fix] タスク show, setup, test, clean, distclean に引数を渡すと正しく終了しなかった
3.4.0 (2005-09-25)
- [fix] Windows で shebang を修正する途中にエラーになる問題を修正
- [new] 新しいタスク test を追加
- [new] conf/ 以下からコンフィグファイルをインストールするようになった
- [new] man/ 以下から man ページをインストールするようになった
- [new] 新しい config オプション --installdirs
- [new] 新しい config オプション --shebang
- [new] 新しい config オプション --sysconfdir
- [new] 新しい config オプション --mandir
- [new] 新しい config オプション --libruby
- [new] 新しい config オプション --localstatedir
3.3.1 (2004-10-02)
- [fix] #!を合わせるコードにバグがあった
- [fix] configで相対パスを設定すると無限ループになる
3.3.0 (2004-09-21)
- [new] 引数がないときは自動的に config setup install を実行する
- [new] config setup install を一気に実行する新しいタスク「all」
3.2.4 (2004-02-12)
- [new] --make-prog のデフォルト値を CONFIG['configure_args'] から取る [ruby-list:39186]
- [fix] ファイルを開くときは常にバイナリモードにする (その2) [ruby-list:39184]
- [fix] InstalledFiles に書き込まれるパスが間違っていた
3.2.3 (2004-02-12)
- [fix] ファイルを開くときは常にバイナリモードにする [ruby-list:39158]
3.2.2 (2003-12-16)
- [fix] metaconfigを使うとread_fileでエラーになっていた (thanks Guillaume Marcais)
- [fix] pre-configで設定した値が保存されていなかった (thanks Alex Fenton)
- [fix] data/からは*.elcや*.soもインストールすべき (thanks Rubikitch)
3.2.1 (2003-09-01)
3.2.0 (2003-08-27)
- [CHANGE] install.rb を setup.rb にマージした。
- [fix] clean/distclean が config 前に呼べなかったのを修正。
3.1.5 (2003-08-21)
- [CHANGE] lib/ からは *.rb のみインストールすることにした
- [CHANGE] 早くも MANIFEST 廃止
3.1.4 (2003-02-25)
- [new] CVS が無視するファイル (CVS/ *~ *.bak #* .* など) を無視する
- [new] MANIFEST というファイルでインストールするファイルを明示的に指定するようにした
- [new] 新しいタスク distclean
- install.rb/setup.rb だけでなく、構築時に使うファイルも配布するようにした
3.1.3 (2002-12-06)
3.1.2 (2002-05-07)
- [fix] config --without が動かなかった
- [fix] InstalledFiles の中身がおかしかった
3.1.1 (2002-01-11)
- [CHANGE] config --install-prefix を install --prefix に移動
- [new] コンフィグ --site-ruby-common を追加
- [new] metaconfig インターフェイス set_config_default(n,v) を追加
3.1.0 (2002-01-08)
- [new] コンフィグ --without-ext を追加
- [new] コンフィグ --install-prefix を追加 [rubyist:0984]
- [new] フックインターフェイス get_config(k), set_config(k,v) を追加
- [new] config オプションのコンフィグファイル metaconfig [ruby-list:33139]
- [fix] setup.rb と同じディレクトリにあるフックを実行していなかった
(ただし package/ 直下のファイルは実行しません。仕様です。)
3.0.2 (2001-10-01)
- Ruby 1.4.4 〜 1.6.3 で動かなかったバグを修正
(rbconfig['rubylidir'] がない)
3.0.1 (2001-09-07)
- 新しいオプション -q, --quiet, --verbose
- 文字列埋めこみの 'setup.rb' をパラメタライズ
3.0.0 (2001-08-28)
- 単体パッケージ向けインストーラ install.rb
- install.rb をベースに setup.rb を再構築
- 実際にインストールしたファイルのリストを InstalledFiles に出力
- --with/--without はパッケージ名のみ受けつける
- config - --with-foo=bar で extconf に引数を指定
- site_ruby が変更される可能性に対処 (thanks Akira Yamada)
2.2.1 (2001-08-01)
- --with, --without で落ちるバグを修正 (reported by Knu)
2.2.0 (2001-06-30)
- PATHCONV から setup/*.rb へ移行
2.1.0 (2001-06-30)
- ネストしたコンフィグ設定 (--prefix など) に対応
- タスクをフックできるようにした (thanks rubikitch)
- srcdir 対応
2.0.4 (2001-04-07)
2.0.3 (2001-03-26)
- clean で Makefile がなくても無視 (変えた)
- Windows の stat() のバグに対応
2.0.2 (2001-02-13)
- clean で Makefile がなくても無視 (thanks rubikitch)
- DOS のドライブレターに対応
2.0.1 (2001-02-09)
- 拡張モジュールをコンパイルする時、毎回 clean するようにした
- extconf.rb を実行するとき新しい Ruby を起動しないようにした
- config --rbconfig=file
2.0.0 (2000-12-19)
- amstd 依存をなくした
- setup.rb 用 README のテンプレートをつけた
- install --no-harm
1.0.7 (2000-11-18)
- --without=ext/* とできるようにした
1.0.6 (2000-08-27)
- 新オプション --make-prog (patched by Katsuyuki Komatsu)
1.0.5 (2000-08-27)
- 常に Makefile を作りなおす (reported by Dave Thomas)
1.0.4 (2000-07-13)
- --with、--without にディレクトリを指定できるようにした
1.0.3 (2000-06-08)
- 新コマンド dryrun (patched by rubikitch)
1.0.2 (2000-06-03)
1.0.1 (2000-06-01)
- いきなりバグがあった (patched by rubikitch)
- 新コマンド clean (patched by rubikitch)
1.0.0 (2000-05-30)
setup-3.4.1/doc.ja/metaconfapi.html 0000644 0001750 0001750 00000005016 10340062165 017676 0 ustar aamine aamine 0000000 0000000
metaconfig API
metaconfig API
- add_path_config(confname, default, description)
- confname
- String
- default
- String
- description
- String
$B%Q%9$rCM$Kconfname $B$rDj5A$7$^$9!#(B
$BJ8;zNs(B default $B$O%*%W%7%g%s$N%G%U%)%k%HCM!"(B
description $B$O%X%k%W%a%C%;!<%8$KI=<($9$k$?$a$N(B
$BC;$$@bL@$G$9!#(B
- add_bool_config(confname, default, description)
- confname
- String
- default
- String
- description
- String
$B??56CM$r$H$k%3%s%U%#%0%*%W%7%g%s(B confname $B$rDj5A$7$^$9!#(B
default $B$O%*%W%7%g%s$N%G%U%)%k%HCM!J(Btrue/false$B!K!"(B
description $B$O%X%k%W%a%C%;!<%8$KI=<($9$k$?$a$N(B
$BC;$$@bL@$G$9!#(B
- set_config_default(confname, val)
- confname
- String
- val
- String | bool
$B%3%s%U%#%0%*%W%7%g%s(B confname $B$N%G%U%)%k%H$r(B val $B$K(B
$B$7$^$9!#(Bconfname $B$,??56CM$r$H$k%3%s%U%#%0$N>l9g(B val
$B$K$O(B true/false $B$r!"$=$l0J30$J$i$PJ8;zNs$rEO$5$J$1$l$P(B
$B$$$1$^$;$s!#(B
- remove_config(confname)
- confname
- String
$B%3%s%U%#%0(B confname $B$r;HMQIT2DG=$K$7$^$9!#(B
$B0MB84X78$OA4$/9MN8$7$^$;$s$N$G!"$?$H$($P(B --prefix $B$r(B
$B:o=|$9$k$H%$%s%9%H!<%k$G%(%i!<$K$J$j$^$9!#<+8J@UG$$G(B
$B;H$C$F$/$@$5$$!#(B
- packages $B"*(B [String]
$B%^%k%A%Q%C%1!<%8%"!<%+%$%VFb$KB8:_$9$k%Q%C%1!<%8$N%j%9%H$rJV$7$^$9!#(B
$B$3$N%a%=%C%I$O%^%k%A%Q%C%1!<%8%"!<%+%$%V$G$7$+;H$($^$;$s!#(B
- declare_packages(list)
- list
- [String]
$B%$%s%9%H!<%k$9$k%Q%C%1!<%8L>$N%j%9%H$r@k8@$7$^$9!#(Bsetup.rb $B$O(B
$B$3$3$G@k8@$5$l$?%Q%C%1!<%8$N$_$rBP>]$K!"F1$8=gHV$G=hM}$7$^$9!#(B
$B$3$N%a%=%C%I$O%^%k%A%Q%C%1!<%8%"!<%+%$%V$G$7$+;H$($^$;$s!#(B
setup-3.4.1/Template.README.en 0000644 0001750 0001750 00000001006 10123707255 016417 0 ustar aamine aamine 0000000 0000000 %name README
============
%name is an application ...
Requirements
------------
* Ruby 1.8
(* C compiler)
Install
-------
De-compress archive and enter its top directory.
Then type:
($ su)
# ruby setup.rb
These simple step installs this program under the default
location of Ruby libraries. You can also install files into
your favorite directory by supplying setup.rb some options.
Try "ruby setup.rb --help".
Usage
-----
.....
License
-------
%license
%author %mailaddr
setup-3.4.1/Template.README.ja 0000644 0001750 0001750 00000001234 10123707255 016412 0 ustar aamine aamine 0000000 0000000 %name README
============
%name は…をするための…です。
必要環境
--------
* Ruby 1.8
(* C コンパイラ)
インストール方法
----------------
コマンドラインで以下のようにうちこんでください。
UNIX 系 OS ではおそらく root 権限が必要になります。
($ su)
# ruby setup.rb
インストール先を変更したりすることもできます。
その場合は ruby setup.rb --help を実行してみてください。
#以下は必要なければ消す
また config の時に
$ ruby setup.rb config --without-ext
とすることで拡張ライブラリなしでインストールできます。
簡単な使い方とか
----------------
書き加えるか、消す
ライセンス
----------
…に従って配布します。
%author
setup-3.4.1/Usage_en.txt 0000644 0001750 0001750 00000010561 10340062165 015654 0 ustar aamine aamine 0000000 0000000 Installing Programs with setup.rb
=================================
Quick Start
-----------
Type this (You might needs super user previledge):
($ su)
# ruby setup.rb
If you want to install a program in to your home directory
($HOME), use following instead:
$ ruby setup.rb all --prefix=$HOME
Detailed Installtion Process
----------------------------
setup.rb invokes installation by three steps. There are
"config", "setup" and "install". You can invoke each steps
separately as following:
$ ruby setup.rb config
$ ruby setup.rb setup
# ruby setup.rb install
You can controll installation process by giving detailed
options for each tasks. For example, --bin-dir=$HOME/bin
let setup.rb install commands in $HOME/bin.
For details, see "Task Options".
Global Options
--------------
"Global Option" is a command line option which you can use
for all tasks. You must give a global option before any task
name.
-q,--quiet
suppress message outputs
--verbose
output messages verbosely (default)
-h,--help
prints help and quit
-v,--version
prints version and quit
--copyright
prints copyright and quit
Tasks
-----
These are acceptable tasks:
all
Invokes `config', `setup', then `install'.
Task options for all is same with config.
config
Checks and saves configurations.
show
Prints current configurations.
setup
Compiles ruby extentions.
install
Installs files.
test
Invokes tests.
clean
Removes created files.
distclean
Removes all created files.
Task Options for CONFIG/ALL
---------------------------
You can pass following long options for CONFIG task
and ALL task.
All options accept parameterized value, like
--rbdir=$siterubyver or --sodir=$siterubyverarch.
On UNIX shells, you should escape "$" character,
so use --rbdir=\$siterubyver or --sodir=$siterubyverach.
--installdirs=(std|site|home)
A handy option to set common install target.
std: install files under $libruby.
site: install files under $siteruby.
home: install files under home directory ($HOME).
--prefix=PATH
The path prefix of target directory pathes like $bindir, $libdir...
--bindir=PATH
The directory for commands.
--rbdir=PATH
The directory for ruby scripts.
--sodir=PATH
The directory for ruby extentions.
--datadir=PATH
The directory for shared data.
--sysconfdir=PATH
The directory for configuration files.
--mandir=PATH
The directory for manual pages.
--libruby=PATH
The directory for ruby libraries.
--librubyver=PATH
The directory for standard ruby libraries.
--librubyverarch=PATH
The directory for standard ruby extensions.
--siteruby=PATH
The directory for version-independent non-standard
ruby libraries
--siterubyver=PATH
The directory for non-standard ruby libraries.
--siterubyverarch=PATH
The directory for non-standard ruby extensions.
--rubypath=PATH
The path to set to #! line.
--shebang=(all|ruby|never)
Shenbang line (#!) rewriting mode.
all: replace all shebang lines.
ruby: replace shebang lines which invokes ruby.
never: never rewrite shebang.
--rubyprog=PATH
The ruby program using for installation.
--makeprog=NAME
The make program to compile ruby extentions.
--without-ext
Forces to setup.rb never to compile/install
ruby extentions.
--rbconfig=PATH
Your rbconfig.rb to load.
If there's the directory named "packages",
You can also use these options:
--with=NAME,NAME,NAME...
Package names which you want to install.
--without=NAME,NAME,NAME...
Package names which you do not want to install.
[NOTE] You can pass options to extconf.rb like this:
ruby setup.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
Task Options for INSTALL
------------------------
--no-harm
prints what to do and done nothing really.
--prefix=PATH
The prefix of the installing directory path.
This option may help binary package maintainers.
A default value is an empty string.
setup-3.4.1/sample/ 0000755 0001750 0001750 00000000000 10340062165 014643 5 ustar aamine aamine 0000000 0000000 setup-3.4.1/sample/add-task.rb 0000644 0001750 0001750 00000000530 07722774532 016700 0 ustar aamine aamine 0000000 0000000 #
# add original task using hook file
#
ToplevelInstaller::TASKS.push ['test', 'run test.']
ToplevelInstaller.module_eval {
def exec_test
raise "test.rb not given; cannot test this package."\
unless File.file?("#{srcdir_root()}/test.rb")
old = Dir.pwd
Dir.chdir srcdir_root()
load 'test.rb'
Dir.chdir old
end
}
setup-3.4.1/Usage_ja.txt 0000644 0001750 0001750 00000013353 10340062165 015646 0 ustar aamine aamine 0000000 0000000 setup.rb を使ったプログラムのインストール
=========================================
この文書ではエンドユーザが setup.rb を使って
パッケージをインストールする方法を説明します。
最も単純な方法
--------------
通常は次のように打つだけで十分です。
(UNIX 系 OS ではおそらくスーパーユーザ権限が必要です)
($ su)
# ruby setup.rb
自分のホームディレクトリ以下にインストールしたいときは
次のようにしてください。
$ ruby setup.rb all --prefix=$HOME
インストールの詳細
------------------
以下、もう少し詳細に説明します。
setup.rb ではインストールのプロセスが「config」「setup」「install」
の三つの段階に分かれています。setup.rb を引数なしで実行すると
config setup install を一気に実行してしまうのですが、次のように
すると三つに分けて実行できます。
$ ruby setup.rb config
$ ruby setup.rb setup
# ruby setup.rb install
そして各段階にオプションを付けるとインストール先などを細かく制御
することができます。例えば config に「--bin-dir=$HOME/bin」オプ
ションを付けるとコマンドが $HOME/bin にインストールされます。
詳しくは「タスクオプション」の節を見てください。
グローバルオプション
--------------------
グローバルオプションとは、タスク (config や setup) に関らず
指定できるオプションのことです。必ずタスクの前に指定してください。
-q,--quiet
メッセージ出力を最小限にする
--verbose
実行中の状況を詳細に表示する (デフォルトはオン)
-h,--help
setup.rb の使いかたなどを表示
-v,--version
setup.rb のバージョンを表示
--copyright
setup.rb の著作権を表示
タスク
------
タスクは以下の七つです。
all
config, setup, install を一気に行う。
タスクオプションは config と共通。
config
設定をチェックしたうえで保存する
show
現在の設定を表示する
setup
コンパイルなど、ファイル内容の変更を行うもの
install
インストールを行う。
test
テストを実行する。
clean
setup で作成したものを消す
distclean
setup で作成したものを消す (より強力)
config/all のタスクオプション
-----------------------------
config タスクで使えるオプションを説明します。
値を取るオプションはすべて --opt=value の形で指定します。
「=」のまわりに空白を入れてはいけません。各オプションの
デフォルト値は ruby setup.rb --help で見られます。
すべてのオプションで、値に別の変数を使うことができます。
例えば Ruby ライブラリを site_ruby にインストール
したければ、--rbdir=$siterubyver と指定できます。
UNIX シェルでは「$」をエスケープして --rbdir=\$siterubyver
としてください。
--installdirs=(std|site|home)
よく使われるインストール先ディレクトリを
まとめてセットするオプション。
std: $libruby 以下にインストールする。
site: $siteruby 以下にインストールする。
home: ホームディレクトリ下にインストールする。
--prefix=PATH
$bindir, $libdir などの共通部分
--bindir=PATH
実行可能ファイル(コマンド)をインストールするディレクトリ。
--rbdir=PATH
Ruby ライブラリをインストールするディレクトリ。
--sodir=PATH
Ruby の拡張モジュールをインストールするディレクトリ。
--datadir=PATH
その他のデータファイルをインストールするディレクトリ。
--sysconfdir=PATH
設定ファイルをインストールするディレクトリ。
--mandir=PATH
man ページをインストールするディレクトリ。
--libruby=PATH
Ruby ライブラリをインストールするディレクトリ
--librubyver=PATH
Ruby の標準添付ライブラリがインストールされるディレクトリ
--librubyverarch=PATH
Ruby の標準添付拡張ライブラリがインストールされるディレクトリ
--siteruby=PATH
Ruby のバージョンに依存しない、非標準の Ruby ライブラリが
インストールされるディレクトリ (site_ruby)
--siterubyver=PATH
Ruby のバージョンに依存する、非標準の Ruby ライブラリが
インストールされるディレクトリ (バージョンつき site_ruby)。
--siterubyverarch=PATH
非標準の Ruby 拡張ライブラリがインストールされるディレクトリ
(バージョン・アーキテクチャ名つき site_ruby)。
--rubypath=PATH
shebang 行 (#!) にセットする Ruby インタプリタのパス。
つまり、インストールしたプログラムを実行するときに
この ruby が使われます。
--shebang=(all|ruby|never)
shebang 行 (#!) の書き換えモードです。
all: すべてのファイルの shenbang 行を書き換えもしくは追加する。
ruby: ruby を起動していると思われる shebang 行だけを書き換える。
never: いっさい shebang 行を書き換えない。
--rubyprog=PATH
インストール時に使う ruby プログラムへのパス。
--makeprog=NAME
拡張ライブラリのコンパイルに使用する make プログラム。
--without-ext
拡張モジュールのコンパイル・インストールを無条件に
スキップする。ただし当然ながら、インストールされる
プログラム自体が拡張モジュールなしで動くようになって
いなければ意味がありません。
--rbconfig=PATH
デフォルト値の設定に使う rbconfig.rb
またマルチパッケージアーカイブではこれに加えて以下のオプションも使えます。
--with=NAME,NAME,NAME...
インストールするパッケージ
--without=NAME,NAME,NAME...
インストールしないパッケージ
さらに、「--」(マイナス二つ)に続けてオプションを指定することで
extconf.rb に引数を渡すことができます。
ruby setup.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
install のタスクオプション
--------------------------
--no-harm
挙動を表示するだけで実行しません。
--prefix=PATH
config で決定したパスの先頭にさらに PATH を付加します。
config --prefix がプログラムが実行されるときのパスであるのに
対し、install --prefix はプログラムファイルをコピーするパスを
指定します。主に RPM などのバイナリパッケージ作成用です。
デフォルトは空文字列です。
setup-3.4.1/setup.rb 0000644 0001750 0001750 00000106502 10340061763 015056 0 ustar aamine aamine 0000000 0000000 #
# setup.rb
#
# Copyright (c) 2000-2005 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
#
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
module Enumerable
alias map collect
end
end
unless File.respond_to?(:read) # Ruby 1.6
def File.read(fname)
open(fname) {|f|
return f.read
}
end
end
unless Errno.const_defined?(:ENOTEMPTY) # Windows?
module Errno
class ENOTEMPTY
# We do not raise this exception, implementation is not needed.
end
end
end
def File.binread(fname)
open(fname, 'rb') {|f|
return f.read
}
end
# for corrupted Windows' stat(2)
def File.dir?(path)
File.directory?((path[-1,1] == '/') ? path : path + '/')
end
class ConfigTable
include Enumerable
def initialize(rbconfig)
@rbconfig = rbconfig
@items = []
@table = {}
# options
@install_prefix = nil
@config_opt = nil
@verbose = true
@no_harm = false
end
attr_accessor :install_prefix
attr_accessor :config_opt
attr_writer :verbose
def verbose?
@verbose
end
attr_writer :no_harm
def no_harm?
@no_harm
end
def [](key)
lookup(key).resolve(self)
end
def []=(key, val)
lookup(key).set val
end
def names
@items.map {|i| i.name }
end
def each(&block)
@items.each(&block)
end
def key?(name)
@table.key?(name)
end
def lookup(name)
@table[name] or setup_rb_error "no such config item: #{name}"
end
def add(item)
@items.push item
@table[item.name] = item
end
def remove(name)
item = lookup(name)
@items.delete_if {|i| i.name == name }
@table.delete_if {|name, i| i.name == name }
item
end
def load_script(path, inst = nil)
if File.file?(path)
MetaConfigEnvironment.new(self, inst).instance_eval File.read(path), path
end
end
def savefile
'.config'
end
def load_savefile
begin
File.foreach(savefile()) do |line|
k, v = *line.split(/=/, 2)
self[k] = v.strip
end
rescue Errno::ENOENT
setup_rb_error $!.message + "\n#{File.basename($0)} config first"
end
end
def save
@items.each {|i| i.value }
File.open(savefile(), 'w') {|f|
@items.each do |i|
f.printf "%s=%s\n", i.name, i.value if i.value? and i.value
end
}
end
def load_standard_entries
standard_entries(@rbconfig).each do |ent|
add ent
end
end
def standard_entries(rbconfig)
c = rbconfig
rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT'])
major = c['MAJOR'].to_i
minor = c['MINOR'].to_i
teeny = c['TEENY'].to_i
version = "#{major}.#{minor}"
# ruby ver. >= 1.4.4?
newpath_p = ((major >= 2) or
((major == 1) and
((minor >= 5) or
((minor == 4) and (teeny >= 4)))))
if c['rubylibdir']
# V > 1.6.3
libruby = "#{c['prefix']}/lib/ruby"
librubyver = c['rubylibdir']
librubyverarch = c['archdir']
siteruby = c['sitedir']
siterubyver = c['sitelibdir']
siterubyverarch = c['sitearchdir']
elsif newpath_p
# 1.4.4 <= V <= 1.6.3
libruby = "#{c['prefix']}/lib/ruby"
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
siteruby = c['sitedir']
siterubyver = "$siteruby/#{version}"
siterubyverarch = "$siterubyver/#{c['arch']}"
else
# V < 1.4.4
libruby = "#{c['prefix']}/lib/ruby"
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
siterubyver = siteruby
siterubyverarch = "$siterubyver/#{c['arch']}"
end
parameterize = lambda {|path|
path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
}
if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
else
makeprog = 'make'
end
[
ExecItem.new('installdirs', 'std/site/home',
'std: install under libruby; site: install under site_ruby; home: install under $HOME')\
{|val, table|
case val
when 'std'
table['rbdir'] = '$librubyver'
table['sodir'] = '$librubyverarch'
when 'site'
table['rbdir'] = '$siterubyver'
table['sodir'] = '$siterubyverarch'
when 'home'
setup_rb_error '$HOME was not set' unless ENV['HOME']
table['prefix'] = ENV['HOME']
table['rbdir'] = '$libdir/ruby'
table['sodir'] = '$libdir/ruby'
end
},
PathItem.new('prefix', 'path', c['prefix'],
'path prefix of target environment'),
PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
'the directory for commands'),
PathItem.new('libdir', 'path', parameterize.call(c['libdir']),
'the directory for libraries'),
PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
'the directory for shared data'),
PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
'the directory for man pages'),
PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
'the directory for system configuration files'),
PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
'the directory for local state data'),
PathItem.new('libruby', 'path', libruby,
'the directory for ruby libraries'),
PathItem.new('librubyver', 'path', librubyver,
'the directory for standard ruby libraries'),
PathItem.new('librubyverarch', 'path', librubyverarch,
'the directory for standard ruby extensions'),
PathItem.new('siteruby', 'path', siteruby,
'the directory for version-independent aux ruby libraries'),
PathItem.new('siterubyver', 'path', siterubyver,
'the directory for aux ruby libraries'),
PathItem.new('siterubyverarch', 'path', siterubyverarch,
'the directory for aux ruby binaries'),
PathItem.new('rbdir', 'path', '$siterubyver',
'the directory for ruby scripts'),
PathItem.new('sodir', 'path', '$siterubyverarch',
'the directory for ruby extentions'),
PathItem.new('rubypath', 'path', rubypath,
'the path to set to #! line'),
ProgramItem.new('rubyprog', 'name', rubypath,
'the ruby program using for installation'),
ProgramItem.new('makeprog', 'name', makeprog,
'the make program to compile ruby extentions'),
SelectItem.new('shebang', 'all/ruby/never', 'ruby',
'shebang line (#!) editing mode'),
BoolItem.new('without-ext', 'yes/no', 'no',
'does not compile/install ruby extentions')
]
end
private :standard_entries
def load_multipackage_entries
multipackage_entries().each do |ent|
add ent
end
end
def multipackage_entries
[
PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
'package names that you want to install'),
PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
'package names that you do not want to install')
]
end
private :multipackage_entries
ALIASES = {
'std-ruby' => 'librubyver',
'stdruby' => 'librubyver',
'rubylibdir' => 'librubyver',
'archdir' => 'librubyverarch',
'site-ruby-common' => 'siteruby', # For backward compatibility
'site-ruby' => 'siterubyver', # For backward compatibility
'bin-dir' => 'bindir',
'bin-dir' => 'bindir',
'rb-dir' => 'rbdir',
'so-dir' => 'sodir',
'data-dir' => 'datadir',
'ruby-path' => 'rubypath',
'ruby-prog' => 'rubyprog',
'ruby' => 'rubyprog',
'make-prog' => 'makeprog',
'make' => 'makeprog'
}
def fixup
ALIASES.each do |ali, name|
@table[ali] = @table[name]
end
@items.freeze
@table.freeze
@options_re = /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/
end
def parse_opt(opt)
m = @options_re.match(opt) or setup_rb_error "config: unknown option #{opt}"
m.to_a[1,2]
end
def dllext
@rbconfig['DLEXT']
end
def value_config?(name)
lookup(name).value?
end
class Item
def initialize(name, template, default, desc)
@name = name.freeze
@template = template
@value = default
@default = default
@description = desc
end
attr_reader :name
attr_reader :description
attr_accessor :default
alias help_default default
def help_opt
"--#{@name}=#{@template}"
end
def value?
true
end
def value
@value
end
def resolve(table)
@value.gsub(%r<\$([^/]+)>) { table[$1] }
end
def set(val)
@value = check(val)
end
private
def check(val)
setup_rb_error "config: --#{name} requires argument" unless val
val
end
end
class BoolItem < Item
def config_type
'bool'
end
def help_opt
"--#{@name}"
end
private
def check(val)
return 'yes' unless val
case val
when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes'
when /\An(o)?\z/i, /\Af(alse)\z/i then 'no'
else
setup_rb_error "config: --#{@name} accepts only yes/no for argument"
end
end
end
class PathItem < Item
def config_type
'path'
end
private
def check(path)
setup_rb_error "config: --#{@name} requires argument" unless path
path[0,1] == '$' ? path : File.expand_path(path)
end
end
class ProgramItem < Item
def config_type
'program'
end
end
class SelectItem < Item
def initialize(name, selection, default, desc)
super
@ok = selection.split('/')
end
def config_type
'select'
end
private
def check(val)
unless @ok.include?(val.strip)
setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
end
val.strip
end
end
class ExecItem < Item
def initialize(name, selection, desc, &block)
super name, selection, nil, desc
@ok = selection.split('/')
@action = block
end
def config_type
'exec'
end
def value?
false
end
def resolve(table)
setup_rb_error "$#{name()} wrongly used as option value"
end
undef set
def evaluate(val, table)
v = val.strip.downcase
unless @ok.include?(v)
setup_rb_error "invalid option --#{@name}=#{val} (use #{@template})"
end
@action.call v, table
end
end
class PackageSelectionItem < Item
def initialize(name, template, default, help_default, desc)
super name, template, default, desc
@help_default = help_default
end
attr_reader :help_default
def config_type
'package'
end
private
def check(val)
unless File.dir?("packages/#{val}")
setup_rb_error "config: no such package: #{val}"
end
val
end
end
class MetaConfigEnvironment
def initialize(config, installer)
@config = config
@installer = installer
end
def config_names
@config.names
end
def config?(name)
@config.key?(name)
end
def bool_config?(name)
@config.lookup(name).config_type == 'bool'
end
def path_config?(name)
@config.lookup(name).config_type == 'path'
end
def value_config?(name)
@config.lookup(name).config_type != 'exec'
end
def add_config(item)
@config.add item
end
def add_bool_config(name, default, desc)
@config.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc)
end
def add_path_config(name, default, desc)
@config.add PathItem.new(name, 'path', default, desc)
end
def set_config_default(name, default)
@config.lookup(name).default = default
end
def remove_config(name)
@config.remove(name)
end
# For only multipackage
def packages
raise '[setup.rb fatal] multi-package metaconfig API packages() called for single-package; contact application package vendor' unless @installer
@installer.packages
end
# For only multipackage
def declare_packages(list)
raise '[setup.rb fatal] multi-package metaconfig API declare_packages() called for single-package; contact application package vendor' unless @installer
@installer.packages = list
end
end
end # class ConfigTable
# This module requires: #verbose?, #no_harm?
module FileOperations
def mkdir_p(dirname, prefix = nil)
dirname = prefix + File.expand_path(dirname) if prefix
$stderr.puts "mkdir -p #{dirname}" if verbose?
return if no_harm?
# Does not check '/', it's too abnormal.
dirs = File.expand_path(dirname).split(%r<(?=/)>)
if /\A[a-z]:\z/i =~ dirs[0]
disk = dirs.shift
dirs[0] = disk + dirs[0]
end
dirs.each_index do |idx|
path = dirs[0..idx].join('')
Dir.mkdir path unless File.dir?(path)
end
end
def rm_f(path)
$stderr.puts "rm -f #{path}" if verbose?
return if no_harm?
force_remove_file path
end
def rm_rf(path)
$stderr.puts "rm -rf #{path}" if verbose?
return if no_harm?
remove_tree path
end
def remove_tree(path)
if File.symlink?(path)
remove_file path
elsif File.dir?(path)
remove_tree0 path
else
force_remove_file path
end
end
def remove_tree0(path)
Dir.foreach(path) do |ent|
next if ent == '.'
next if ent == '..'
entpath = "#{path}/#{ent}"
if File.symlink?(entpath)
remove_file entpath
elsif File.dir?(entpath)
remove_tree0 entpath
else
force_remove_file entpath
end
end
begin
Dir.rmdir path
rescue Errno::ENOTEMPTY
# directory may not be empty
end
end
def move_file(src, dest)
force_remove_file dest
begin
File.rename src, dest
rescue
File.open(dest, 'wb') {|f|
f.write File.binread(src)
}
File.chmod File.stat(src).mode, dest
File.unlink src
end
end
def force_remove_file(path)
begin
remove_file path
rescue
end
end
def remove_file(path)
File.chmod 0777, path
File.unlink path
end
def install(from, dest, mode, prefix = nil)
$stderr.puts "install #{from} #{dest}" if verbose?
return if no_harm?
realdest = prefix ? prefix + File.expand_path(dest) : dest
realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
str = File.binread(from)
if diff?(str, realdest)
verbose_off {
rm_f realdest if File.exist?(realdest)
}
File.open(realdest, 'wb') {|f|
f.write str
}
File.chmod mode, realdest
File.open("#{objdir_root()}/InstalledFiles", 'a') {|f|
if prefix
f.puts realdest.sub(prefix, '')
else
f.puts realdest
end
}
end
end
def diff?(new_content, path)
return true unless File.exist?(path)
new_content != File.binread(path)
end
def command(*args)
$stderr.puts args.join(' ') if verbose?
system(*args) or raise RuntimeError,
"system(#{args.map{|a| a.inspect }.join(' ')}) failed"
end
def ruby(*args)
command config('rubyprog'), *args
end
def make(task = nil)
command(*[config('makeprog'), task].compact)
end
def extdir?(dir)
File.exist?("#{dir}/MANIFEST") or File.exist?("#{dir}/extconf.rb")
end
def files_of(dir)
Dir.open(dir) {|d|
return d.select {|ent| File.file?("#{dir}/#{ent}") }
}
end
DIR_REJECT = %w( . .. CVS SCCS RCS CVS.adm .svn )
def directories_of(dir)
Dir.open(dir) {|d|
return d.select {|ent| File.dir?("#{dir}/#{ent}") } - DIR_REJECT
}
end
end
# This module requires: #srcdir_root, #objdir_root, #relpath
module HookScriptAPI
def get_config(key)
@config[key]
end
alias config get_config
# obsolete: use metaconfig to change configuration
def set_config(key, val)
@config[key] = val
end
#
# srcdir/objdir (works only in the package directory)
#
def curr_srcdir
"#{srcdir_root()}/#{relpath()}"
end
def curr_objdir
"#{objdir_root()}/#{relpath()}"
end
def srcfile(path)
"#{curr_srcdir()}/#{path}"
end
def srcexist?(path)
File.exist?(srcfile(path))
end
def srcdirectory?(path)
File.dir?(srcfile(path))
end
def srcfile?(path)
File.file?(srcfile(path))
end
def srcentries(path = '.')
Dir.open("#{curr_srcdir()}/#{path}") {|d|
return d.to_a - %w(. ..)
}
end
def srcfiles(path = '.')
srcentries(path).select {|fname|
File.file?(File.join(curr_srcdir(), path, fname))
}
end
def srcdirectories(path = '.')
srcentries(path).select {|fname|
File.dir?(File.join(curr_srcdir(), path, fname))
}
end
end
class ToplevelInstaller
Version = '3.4.1'
Copyright = 'Copyright (c) 2000-2005 Minero Aoki'
TASKS = [
[ 'all', 'do config, setup, then install' ],
[ 'config', 'saves your configurations' ],
[ 'show', 'shows current configuration' ],
[ 'setup', 'compiles ruby extentions and others' ],
[ 'install', 'installs files' ],
[ 'test', 'run all tests in test/' ],
[ 'clean', "does `make clean' for each extention" ],
[ 'distclean',"does `make distclean' for each extention" ]
]
def ToplevelInstaller.invoke
config = ConfigTable.new(load_rbconfig())
config.load_standard_entries
config.load_multipackage_entries if multipackage?
config.fixup
klass = (multipackage?() ? ToplevelInstallerMulti : ToplevelInstaller)
klass.new(File.dirname($0), config).invoke
end
def ToplevelInstaller.multipackage?
File.dir?(File.dirname($0) + '/packages')
end
def ToplevelInstaller.load_rbconfig
if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
ARGV.delete(arg)
load File.expand_path(arg.split(/=/, 2)[1])
$".push 'rbconfig.rb'
else
require 'rbconfig'
end
::Config::CONFIG
end
def initialize(ardir_root, config)
@ardir = File.expand_path(ardir_root)
@config = config
# cache
@valid_task_re = nil
end
def config(key)
@config[key]
end
def inspect
"#<#{self.class} #{__id__()}>"
end
def invoke
run_metaconfigs
case task = parsearg_global()
when nil, 'all'
parsearg_config
init_installers
exec_config
exec_setup
exec_install
else
case task
when 'config', 'test'
;
when 'clean', 'distclean'
@config.load_savefile if File.exist?(@config.savefile)
else
@config.load_savefile
end
__send__ "parsearg_#{task}"
init_installers
__send__ "exec_#{task}"
end
end
def run_metaconfigs
@config.load_script "#{@ardir}/metaconfig"
end
def init_installers
@installer = Installer.new(@config, @ardir, File.expand_path('.'))
end
#
# Hook Script API bases
#
def srcdir_root
@ardir
end
def objdir_root
'.'
end
def relpath
'.'
end
#
# Option Parsing
#
def parsearg_global
while arg = ARGV.shift
case arg
when /\A\w+\z/
setup_rb_error "invalid task: #{arg}" unless valid_task?(arg)
return arg
when '-q', '--quiet'
@config.verbose = false
when '--verbose'
@config.verbose = true
when '--help'
print_usage $stdout
exit 0
when '--version'
puts "#{File.basename($0)} version #{Version}"
exit 0
when '--copyright'
puts Copyright
exit 0
else
setup_rb_error "unknown global option '#{arg}'"
end
end
nil
end
def valid_task?(t)
valid_task_re() =~ t
end
def valid_task_re
@valid_task_re ||= /\A(?:#{TASKS.map {|task,desc| task }.join('|')})\z/
end
def parsearg_no_options
unless ARGV.empty?
task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1)
setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}"
end
end
alias parsearg_show parsearg_no_options
alias parsearg_setup parsearg_no_options
alias parsearg_test parsearg_no_options
alias parsearg_clean parsearg_no_options
alias parsearg_distclean parsearg_no_options
def parsearg_config
evalopt = []
set = []
@config.config_opt = []
while i = ARGV.shift
if /\A--?\z/ =~ i
@config.config_opt = ARGV.dup
break
end
name, value = *@config.parse_opt(i)
if @config.value_config?(name)
@config[name] = value
else
evalopt.push [name, value]
end
set.push name
end
evalopt.each do |name, value|
@config.lookup(name).evaluate value, @config
end
# Check if configuration is valid
set.each do |n|
@config[n] if @config.value_config?(n)
end
end
def parsearg_install
@config.no_harm = false
@config.install_prefix = ''
while a = ARGV.shift
case a
when '--no-harm'
@config.no_harm = true
when /\A--prefix=/
path = a.split(/=/, 2)[1]
path = File.expand_path(path) unless path[0,1] == '/'
@config.install_prefix = path
else
setup_rb_error "install: unknown option #{a}"
end
end
end
def print_usage(out)
out.puts 'Typical Installation Procedure:'
out.puts " $ ruby #{File.basename $0} config"
out.puts " $ ruby #{File.basename $0} setup"
out.puts " # ruby #{File.basename $0} install (may require root privilege)"
out.puts
out.puts 'Detailed Usage:'
out.puts " ruby #{File.basename $0} "
out.puts " ruby #{File.basename $0} [] []"
fmt = " %-24s %s\n"
out.puts
out.puts 'Global options:'
out.printf fmt, '-q,--quiet', 'suppress message outputs'
out.printf fmt, ' --verbose', 'output messages verbosely'
out.printf fmt, ' --help', 'print this message'
out.printf fmt, ' --version', 'print version and quit'
out.printf fmt, ' --copyright', 'print copyright and quit'
out.puts
out.puts 'Tasks:'
TASKS.each do |name, desc|
out.printf fmt, name, desc
end
fmt = " %-24s %s [%s]\n"
out.puts
out.puts 'Options for CONFIG or ALL:'
@config.each do |item|
out.printf fmt, item.help_opt, item.description, item.help_default
end
out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's"
out.puts
out.puts 'Options for INSTALL:'
out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
out.printf fmt, '--prefix=path', 'install path prefix', ''
out.puts
end
#
# Task Handlers
#
def exec_config
@installer.exec_config
@config.save # must be final
end
def exec_setup
@installer.exec_setup
end
def exec_install
@installer.exec_install
end
def exec_test
@installer.exec_test
end
def exec_show
@config.each do |i|
printf "%-20s %s\n", i.name, i.value if i.value?
end
end
def exec_clean
@installer.exec_clean
end
def exec_distclean
@installer.exec_distclean
end
end # class ToplevelInstaller
class ToplevelInstallerMulti < ToplevelInstaller
include FileOperations
def initialize(ardir_root, config)
super
@packages = directories_of("#{@ardir}/packages")
raise 'no package exists' if @packages.empty?
@root_installer = Installer.new(@config, @ardir, File.expand_path('.'))
end
def run_metaconfigs
@config.load_script "#{@ardir}/metaconfig", self
@packages.each do |name|
@config.load_script "#{@ardir}/packages/#{name}/metaconfig"
end
end
attr_reader :packages
def packages=(list)
raise 'package list is empty' if list.empty?
list.each do |name|
raise "directory packages/#{name} does not exist"\
unless File.dir?("#{@ardir}/packages/#{name}")
end
@packages = list
end
def init_installers
@installers = {}
@packages.each do |pack|
@installers[pack] = Installer.new(@config,
"#{@ardir}/packages/#{pack}",
"packages/#{pack}")
end
with = extract_selection(config('with'))
without = extract_selection(config('without'))
@selected = @installers.keys.select {|name|
(with.empty? or with.include?(name)) \
and not without.include?(name)
}
end
def extract_selection(list)
a = list.split(/,/)
a.each do |name|
setup_rb_error "no such package: #{name}" unless @installers.key?(name)
end
a
end
def print_usage(f)
super
f.puts 'Inluded packages:'
f.puts ' ' + @packages.sort.join(' ')
f.puts
end
#
# Task Handlers
#
def exec_config
run_hook 'pre-config'
each_selected_installers {|inst| inst.exec_config }
run_hook 'post-config'
@config.save # must be final
end
def exec_setup
run_hook 'pre-setup'
each_selected_installers {|inst| inst.exec_setup }
run_hook 'post-setup'
end
def exec_install
run_hook 'pre-install'
each_selected_installers {|inst| inst.exec_install }
run_hook 'post-install'
end
def exec_test
run_hook 'pre-test'
each_selected_installers {|inst| inst.exec_test }
run_hook 'post-test'
end
def exec_clean
rm_f @config.savefile
run_hook 'pre-clean'
each_selected_installers {|inst| inst.exec_clean }
run_hook 'post-clean'
end
def exec_distclean
rm_f @config.savefile
run_hook 'pre-distclean'
each_selected_installers {|inst| inst.exec_distclean }
run_hook 'post-distclean'
end
#
# lib
#
def each_selected_installers
Dir.mkdir 'packages' unless File.dir?('packages')
@selected.each do |pack|
$stderr.puts "Processing the package `#{pack}' ..." if verbose?
Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}")
Dir.chdir "packages/#{pack}"
yield @installers[pack]
Dir.chdir '../..'
end
end
def run_hook(id)
@root_installer.run_hook id
end
# module FileOperations requires this
def verbose?
@config.verbose?
end
# module FileOperations requires this
def no_harm?
@config.no_harm?
end
end # class ToplevelInstallerMulti
class Installer
FILETYPES = %w( bin lib ext data conf man )
include FileOperations
include HookScriptAPI
def initialize(config, srcroot, objroot)
@config = config
@srcdir = File.expand_path(srcroot)
@objdir = File.expand_path(objroot)
@currdir = '.'
end
def inspect
"#<#{self.class} #{File.basename(@srcdir)}>"
end
def noop(rel)
end
#
# Hook Script API base methods
#
def srcdir_root
@srcdir
end
def objdir_root
@objdir
end
def relpath
@currdir
end
#
# Config Access
#
# module FileOperations requires this
def verbose?
@config.verbose?
end
# module FileOperations requires this
def no_harm?
@config.no_harm?
end
def verbose_off
begin
save, @config.verbose = @config.verbose?, false
yield
ensure
@config.verbose = save
end
end
#
# TASK config
#
def exec_config
exec_task_traverse 'config'
end
alias config_dir_bin noop
alias config_dir_lib noop
def config_dir_ext(rel)
extconf if extdir?(curr_srcdir())
end
alias config_dir_data noop
alias config_dir_conf noop
alias config_dir_man noop
def extconf
ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt
end
#
# TASK setup
#
def exec_setup
exec_task_traverse 'setup'
end
def setup_dir_bin(rel)
files_of(curr_srcdir()).each do |fname|
update_shebang_line "#{curr_srcdir()}/#{fname}"
end
end
alias setup_dir_lib noop
def setup_dir_ext(rel)
make if extdir?(curr_srcdir())
end
alias setup_dir_data noop
alias setup_dir_conf noop
alias setup_dir_man noop
def update_shebang_line(path)
return if no_harm?
return if config('shebang') == 'never'
old = Shebang.load(path)
if old
$stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1
new = new_shebang(old)
return if new.to_s == old.to_s
else
return unless config('shebang') == 'all'
new = Shebang.new(config('rubypath'))
end
$stderr.puts "updating shebang: #{File.basename(path)}" if verbose?
open_atomic_writer(path) {|output|
File.open(path, 'rb') {|f|
f.gets if old # discard
output.puts new.to_s
output.print f.read
}
}
end
def new_shebang(old)
if /\Aruby/ =~ File.basename(old.cmd)
Shebang.new(config('rubypath'), old.args)
elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby'
Shebang.new(config('rubypath'), old.args[1..-1])
else
return old unless config('shebang') == 'all'
Shebang.new(config('rubypath'))
end
end
def open_atomic_writer(path, &block)
tmpfile = File.basename(path) + '.tmp'
begin
File.open(tmpfile, 'wb', &block)
File.rename tmpfile, File.basename(path)
ensure
File.unlink tmpfile if File.exist?(tmpfile)
end
end
class Shebang
def Shebang.load(path)
line = nil
File.open(path) {|f|
line = f.gets
}
return nil unless /\A#!/ =~ line
parse(line)
end
def Shebang.parse(line)
cmd, *args = *line.strip.sub(/\A\#!/, '').split(' ')
new(cmd, args)
end
def initialize(cmd, args = [])
@cmd = cmd
@args = args
end
attr_reader :cmd
attr_reader :args
def to_s
"#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}")
end
end
#
# TASK install
#
def exec_install
rm_f 'InstalledFiles'
exec_task_traverse 'install'
end
def install_dir_bin(rel)
install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755
end
def install_dir_lib(rel)
install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644
end
def install_dir_ext(rel)
return unless extdir?(curr_srcdir())
install_files rubyextentions('.'),
"#{config('sodir')}/#{File.dirname(rel)}",
0555
end
def install_dir_data(rel)
install_files targetfiles(), "#{config('datadir')}/#{rel}", 0644
end
def install_dir_conf(rel)
# FIXME: should not remove current config files
# (rename previous file to .old/.org)
install_files targetfiles(), "#{config('sysconfdir')}/#{rel}", 0644
end
def install_dir_man(rel)
install_files targetfiles(), "#{config('mandir')}/#{rel}", 0644
end
def install_files(list, dest, mode)
mkdir_p dest, @config.install_prefix
list.each do |fname|
install fname, dest, mode, @config.install_prefix
end
end
def libfiles
glob_reject(%w(*.y *.output), targetfiles())
end
def rubyextentions(dir)
ents = glob_select("*.#{@config.dllext}", targetfiles())
if ents.empty?
setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first"
end
ents
end
def targetfiles
mapdir(existfiles() - hookfiles())
end
def mapdir(ents)
ents.map {|ent|
if File.exist?(ent)
then ent # objdir
else "#{curr_srcdir()}/#{ent}" # srcdir
end
}
end
# picked up many entries from cvs-1.11.1/src/ignore.c
JUNK_FILES = %w(
core RCSLOG tags TAGS .make.state
.nse_depinfo #* .#* cvslog.* ,* .del-* *.olb
*~ *.old *.bak *.BAK *.orig *.rej _$* *$
*.org *.in .*
)
def existfiles
glob_reject(JUNK_FILES, (files_of(curr_srcdir()) | files_of('.')))
end
def hookfiles
%w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt|
%w( config setup install clean ).map {|t| sprintf(fmt, t) }
}.flatten
end
def glob_select(pat, ents)
re = globs2re([pat])
ents.select {|ent| re =~ ent }
end
def glob_reject(pats, ents)
re = globs2re(pats)
ents.reject {|ent| re =~ ent }
end
GLOB2REGEX = {
'.' => '\.',
'$' => '\$',
'#' => '\#',
'*' => '.*'
}
def globs2re(pats)
/\A(?:#{
pats.map {|pat| pat.gsub(/[\.\$\#\*]/) {|ch| GLOB2REGEX[ch] } }.join('|')
})\z/
end
#
# TASK test
#
TESTDIR = 'test'
def exec_test
unless File.directory?('test')
$stderr.puts 'no test in this package' if verbose?
return
end
$stderr.puts 'Running tests...' if verbose?
begin
require 'test/unit'
rescue LoadError
setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.'
end
runner = Test::Unit::AutoRunner.new(true)
runner.to_run << TESTDIR
runner.run
end
#
# TASK clean
#
def exec_clean
exec_task_traverse 'clean'
rm_f @config.savefile
rm_f 'InstalledFiles'
end
alias clean_dir_bin noop
alias clean_dir_lib noop
alias clean_dir_data noop
alias clean_dir_conf noop
alias clean_dir_man noop
def clean_dir_ext(rel)
return unless extdir?(curr_srcdir())
make 'clean' if File.file?('Makefile')
end
#
# TASK distclean
#
def exec_distclean
exec_task_traverse 'distclean'
rm_f @config.savefile
rm_f 'InstalledFiles'
end
alias distclean_dir_bin noop
alias distclean_dir_lib noop
def distclean_dir_ext(rel)
return unless extdir?(curr_srcdir())
make 'distclean' if File.file?('Makefile')
end
alias distclean_dir_data noop
alias distclean_dir_conf noop
alias distclean_dir_man noop
#
# Traversing
#
def exec_task_traverse(task)
run_hook "pre-#{task}"
FILETYPES.each do |type|
if type == 'ext' and config('without-ext') == 'yes'
$stderr.puts 'skipping ext/* by user option' if verbose?
next
end
traverse task, type, "#{task}_dir_#{type}"
end
run_hook "post-#{task}"
end
def traverse(task, rel, mid)
dive_into(rel) {
run_hook "pre-#{task}"
__send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '')
directories_of(curr_srcdir()).each do |d|
traverse task, "#{rel}/#{d}", mid
end
run_hook "post-#{task}"
}
end
def dive_into(rel)
return unless File.dir?("#{@srcdir}/#{rel}")
dir = File.basename(rel)
Dir.mkdir dir unless File.dir?(dir)
prevdir = Dir.pwd
Dir.chdir dir
$stderr.puts '---> ' + rel if verbose?
@currdir = rel
yield
Dir.chdir prevdir
$stderr.puts '<--- ' + rel if verbose?
@currdir = File.dirname(rel)
end
def run_hook(id)
path = [ "#{curr_srcdir()}/#{id}",
"#{curr_srcdir()}/#{id}.rb" ].detect {|cand| File.file?(cand) }
return unless path
begin
instance_eval File.read(path), path, 1
rescue
raise if $DEBUG
setup_rb_error "hook #{path} failed:\n" + $!.message
end
end
end # class Installer
class SetupError < StandardError; end
def setup_rb_error(msg)
raise SetupError, msg
end
if $0 == __FILE__
begin
ToplevelInstaller.invoke
rescue SetupError
raise if $DEBUG
$stderr.puts $!.message
$stderr.puts "Try 'ruby #{$0} --help' for detailed usage."
exit 1
end
end
setup-3.4.1/.cvsignore 0000644 0001750 0001750 00000000011 07723025112 015354 0 ustar aamine aamine 0000000 0000000 setup.rb
setup-3.4.1/ChangeLog 0000644 0001750 0001750 00000043014 10340062040 015126 0 ustar aamine aamine 0000000 0000000 Sun Nov 20 20:55:02 2005 Minero Aoki
* version 3.4.1 released.
Sun Nov 20 20:54:46 2005 Minero Aoki
* test/test_installer.rb: new file.
Sun Nov 20 20:54:03 2005 Minero Aoki
* setup.rb (update_shebang_line): revert verbose message.
Sun Nov 20 20:24:56 2005 Minero Aoki
* setup.rb (parsearg_no_options): caused error when ARGV is empty.
* setup.rb (adjust_shebang): --shebang option did not work.
* setup.rb (adjust_shebang): replace "#!/usr/bin/env ruby" when
--shebang=ruby.
* setup.rb (adjust_shebang): when original file does not begin
with "#!", shebang line should be added, not be replaced.
* setup.rb (adjust_shebang): refactoring.
#adjust_shebang -> #update_shebang_line.
Sun Nov 20 19:13:28 2005 Minero Aoki
* test/testmain.rb: removed.
* test/testconfig.rb: removed.
Sun Nov 20 16:49:14 2005 Minero Aoki
* setup.rb (standard_entries): $rubypath should include file
extension. This patch is contributed by U.Nakamura.
Fri Nov 4 19:39:45 2005 Minero Aoki
* setup.rb: --without-ext did not work.
Thu Oct 13 04:25:35 2005 Minero Aoki
* setup.rb (MetaConfigEnvironment): fix typo.
Thu Sep 29 03:12:01 2005 Minero Aoki
* setup.rb (install_dir_lib): do not install *.y and *.output
(Racc files). [FEATURE CHANGE]
Thu Sep 29 02:05:01 2005 Minero Aoki
* setup.rb (rubyscripts): accept all non-junk files.
[FEATURE CHANGE]
Sun Sep 25 02:22:15 2005 Minero Aoki
* version 3.4.0 released.
Sun Sep 25 02:22:01 2005 Minero Aoki
* setup.rb (exec_test): check if test/unit was loaded.
Sun Sep 25 02:17:54 2005 Minero Aoki
* Makefile: fix varname.
Sun Sep 25 02:15:10 2005 Minero Aoki
* Makefile: use .makeparams mechanism.
Sat Sep 24 23:22:42 2005 Minero Aoki
* NEWS.m: wrote about --shebang, --installdirs.
* doc/usage.rd.m: ditto.
Sat Sep 24 23:21:56 2005 Minero Aoki
* setup.rb: --installdirs did not work.
Sat Sep 24 22:54:11 2005 Minero Aoki
* NEWS.m: add release note for 3.4.0.
* doc/{devel,metaconfapi,usage}.rd.m: wrote about conf/, man/,
test/.
Sat Sep 24 22:52:33 2005 Minero Aoki
* setup.rb: multipackage archive did not work.
Sat Sep 24 22:15:15 2005 Minero Aoki
* Makefile: update version (3.4.0).
* setup.rb: ditto.
Sat Sep 24 22:05:34 2005 Minero Aoki
* setup.rb: new task `test'. This function is fetched from
bioruby's install.rb.
Sat Sep 24 21:59:12 2005 Minero Aoki
* README.{ja,en}: Lesser GPL is version 2.1, not 2.0.
* doc/devel.rd.m: ditto.
Sat Sep 24 21:52:37 2005 Minero Aoki
* Makefile: update version (3.3.2).
* setup.rb: ditto.
Sat Sep 24 21:50:24 2005 Minero Aoki
* COPYING: new file.
* doc/devel.rd.m: update copyright related description.
Fri Aug 19 09:57:44 2005 Minero Aoki
* setup.rb: new file type `man'. This patch is contributed by
Tommy Midttveit.
Sat Aug 6 02:28:21 2005 Minero Aoki
* setup.rb: new option --installdirs.
* setup.rb: parameterize only $prefix.
Wed May 4 00:23:20 2005 Minero Aoki
* setup.rb: new config option --localstatedir.
* setup.rb: install conf/**/*.
(These 2 patches are contributed by Paul van Tilburg)
* setup.rb: site_ruby points fixed path (is not affected by
--prefix change).
* setup.rb: new config option --libruby.
* setup.rb: refactoring ConfigTable_class and ConfigTable.
Sun Dec 5 02:07:11 2004 Minero Aoki
* setup.rb (command): use multiple-argument #system, to support a
path which includes space.
* setup.rb (extdir?): check extconf.rb, too.
Thu Oct 28 00:12:39 2004 Minero Aoki
* setup.rb (adjust_shebang): $rubypath may not end with "ruby".
I forget why I added this line.
Mon Oct 25 06:15:06 2004 Minero Aoki
* setup.rb (adjust_shebang): rename(2) cannot overwrite opening
file on Windows. [ruby-ext:02239]
Mon Oct 25 06:04:18 2004 Minero Aoki
* setup.rb: new method remove_tree.
* setup.rb: new method remove_file.
* setup.rb: new method force_remove_file.
* setup.rb (rm_rf): use remove_tree.
* setup.rb (rm_f): use force_remove_file.
Sat Oct 2 20:06:19 2004 Minero Aoki
* version 3.3.1 released.
Sat Oct 2 20:06:04 2004 Minero Aoki
* setup.rb: tested in Ruby 1.4.6.
Sat Oct 2 19:54:45 2004 Minero Aoki
* setup.rb: do not use "rescue XXX => err", Ruby 1.4 does not
support it.
Sat Oct 2 19:52:51 2004 Minero Aoki
* setup.rb: provide more config items. (datadir, mandir,
sysconfdir, ...)
* setup.rb: more strong parameterization. ($siteruby,
$siterubyver, ...)
* setup.rb: $siteruby points .../lib/ruby/site_ruby.
* setup.rb: $siterubyver points .../lib/ruby/site_ruby/X.X.
* setup.rb: $site-ruby-common points .../lib/ruby/site_ruby for
backward compatibility.
* setup.rb: $site-ruby points .../lib/ruby/site_ruby/X.X for
backward compatibility.
* setup.rb: objectify config items.
* setup.rb: remove ConfigTable class methods.
* setup.rb: remove useless compat methods.
Sat Oct 2 15:11:21 2004 Minero Aoki
* setup.rb (ConfigTable#[]=): does not expand path value when it
begins with '$'.
Sat Oct 2 14:32:12 2004 Minero Aoki
* setup.rb (ConfigTable#[]=): support relational path in
configration.
Sat Oct 2 14:16:39 2004 Minero Aoki
* setup.rb (adjust_shebang): missing SHEBANG_RE. (thanks: Thomas
Link)
Tue Sep 28 15:40:46 2004 Minero Aoki
* setup.rb: --bin-dir -> --bindir, etc. Old options are kept as
aliases. [ruby-talk:113880]
Tue Sep 21 12:05:56 2004 Minero Aoki
* version 3.3.0 released.
Tue Sep 21 12:01:47 2004 Minero Aoki
* setup.rb: new task `all', it invokes config, setup, and install.
Tue Sep 21 11:25:27 2004 Minero Aoki
* setup.rb (install): fix bug.
Tue Sep 21 10:56:39 2004 Minero Aoki
* setup.rb: invoke config-setup-install if there is no global
option.
* setup.rb: modify shebang only when original shebang contains
`ruby'.
Sun Jun 13 03:44:12 2004 Minero Aoki
* setup.rb: ignore .svn/. (thanks: Aredridel)
Mon Feb 16 18:02:50 2004 Minero Aoki
* version 3.2.4.
Mon Feb 16 17:55:35 2004 Minero Aoki
* setup.rb: get make-prog default value from
CONFIG['configure_args']. [ruby-list:39186]
* setup.rb (FileOp#install): wrong path was written in
InstalledFiles.
Mon Feb 16 17:14:00 2004 Minero Aoki
* Makefile: remove task `asm'.
* Makefile: default task is `update'.
* Makefile (update): update version in setup.rb.
Mon Feb 16 17:06:07 2004 Minero Aoki
* setup.rb: created by concatenating all files.
* asm.rb: removed.
* base.rb: removed.
* compat.rb: removed.
* config.rb: removed.
* fileop.rb: removed.
* setup.rb.in: removed.
* toplevel.rb: removed.
Mon Feb 16 17:03:39 2004 Minero Aoki
* setup.rb.in: update copyright year.
Mon Feb 16 17:03:10 2004 Minero Aoki
* config.rb: Array#index(re) does not work, use detect.
[ruby-list:39187]
* compat.rb: define Enumerable#detect.
Mon Feb 16 16:30:14 2004 Minero Aoki
* compat.rb (File.read): original File.read does not open file in
binary mode.
* compat.rb: new method File.binread.
* fileop.rb: use File.binread for binary files. [ruby-list:39184]
Thu Feb 12 23:37:45 2004 Minero Aoki
* version 3.2.3.
Thu Feb 12 23:37:45 2004 Minero Aoki
* base.rb: open files in binary mode.
* compat.rb: ditto.
Tue Dec 16 18:35:36 2003 Minero Aoki
* Makefile: version 3.2.2.
* toplevel.rb: ditto.
Tue Dec 16 18:06:41 2003 Minero Aoki
* asm.rb: Regexp#=== -> =~
* base.rb: ditto.
* fileop.rb: ditto.
* toplevel.rb: ditto.
* base.rb (REJECT_PATTERNS): escape '#'.
* setup.rb.in: unindent copyright.
Tue Dec 16 18:03:15 2003 Minero Aoki
* base.rb (REJECT_PATTERNS): remove *.elc, *.so, etc.
Tue Dec 2 22:08:05 2003 Minero Aoki
* config.rb (ConfigTable#[]=): does not expand path.
Tue Dec 2 22:07:40 2003 Minero Aoki
* toplevel.rb (exec_config): must save configuration after running
all hooks.
Fri Oct 17 22:57:46 2003 Minero Aoki
* fileop.rb (install): should write `dest' to InstallFiles, not
`realdest'.
Mon Sep 8 09:09:47 2003 Minero Aoki
* base.rb: FileOperations#dir? -> File.dir?
* fileop.rb: ditto.
* toplevel.rb: ditto.
* base.rb: FileTest -> File
* config.rb: ditto.
* fileop.rb: ditto.
Mon Sep 8 09:03:44 2003 Minero Aoki
* Now MetaConfigAPI does not need #read_file.
(reported by Guillaume Marcais)
* compat.rb: define File.read again (replaces
FileOperations#read_file).
* base.rb: read_file -> File.read
* config.rb: ditto.
* fileop.rb: ditto.
Mon Sep 1 00:09:22 2003 Minero Aoki
* version 3.2.1.
Mon Sep 1 00:09:11 2003 Minero Aoki
* NEWS.m: update for version 3.2.1.
Mon Sep 1 00:03:52 2003 Minero Aoki
* Makefile: version up.
* toplevel.rb: ditto.
* web/setup.ja.html: ditto.
* web/setup.en.html: ditto.
Mon Sep 1 00:01:35 2003 Minero Aoki
* toplevel.rb: does not work. (thanks Tadayoshi Funaba)
Thu Aug 28 19:11:52 2003 Minero Aoki
* README.en: small modify.
* README.setup: wrote a not about each packages.
* README.setup: remove my address.
Wed Aug 27 13:10:46 2003 Minero Aoki
* web/setup.html: removed.
* web/setup.ja.html: new file.
* web/setup.en.html: new file.
* Makefile (site): install web/*.html.
Wed Aug 27 13:01:29 2003 Minero Aoki
* version 3.2.0.
Wed Aug 27 13:00:32 2003 Minero Aoki
* README.en: add description.
Wed Aug 27 12:58:36 2003 Minero Aoki
* README.ja: new file.
Wed Aug 27 12:53:06 2003 Minero Aoki
* doc/hookapi.rrd.m: update type description.
Wed Aug 27 12:49:23 2003 Minero Aoki
* .cvsignore: remove install.rb.
* README.en: ditto.
* TODO: ditto.
Wed Aug 27 12:42:35 2003 Minero Aoki
* toplevel.rb (load_config): need argument `task'.
* toplevel.rb (exec_*clean): remove config.save.
* toplevel.rb: new method verbose? and no_harm? to allow rm_f.
Wed Aug 27 12:18:16 2003 Minero Aoki
* Makefile: version 3.2.0.
* toplevel.rb: ditto.
* web/setup.rb: ditto.
Wed Aug 27 12:16:25 2003 Minero Aoki
* web/setup.rb: new file.
* Makefile (dist): remove web/ in distribution archive.
Wed Aug 27 12:05:35 2003 Minero Aoki
* doc/devel.rd.m: remove description about install.rb.
* doc/index.rhtml.m: ditto.
* doc/usage.rd.m: ditto.
Wed Aug 27 12:04:56 2003 Minero Aoki
* NEWS.m: updated.
Wed Aug 27 11:14:12 2003 Minero Aoki
* base.rb: require rbconfig.rb.
* base.rb: new module HookUtils (methods moved from Installer).
* base.rb: new module HookScriptAPI (methods moved from
Installer).
* base.rb (srcentries): does not exclude hook files.
* base.rb (adjust_shebang): simplify log message.
* base.rb (collect_filenames_auto): debug.
* base.rb (existfiles): does not use #curr_objdir, which is moved
to HookScriptAPI.
* config.rb: now #multipackage_install? is defined globaly.
* fileop.rb (move_file): code enhancement.
* fileop.rb (move_file): simplify log message.
* fileop.rb (install): does not use #objdir, which is removed.
* setup.rb.in: now #multipackage_install? is defined globaly.
* toplevel.rb: remove .create_instance (merged in to .instance).
Use singleton pattern.
* toplevel.rb: new method #load_config.
* toplevel.rb (load_config): On *clean, load config only the file
exists.
* toplevel.rb (try): removed, to reduce useless log message.
* toplevel.rb (exec_config): save config before traversing.
Wed Aug 27 09:20:38 2003 Minero Aoki
* sample/add-task.rb: new file.
Wed Aug 27 09:08:07 2003 Minero Aoki
* install.rb.in: removed (merged into setup.rb).
* package.rb: removed (merged into toplevel.rb).
* Makefile: now install.rb is removed.
* base.rb: move Version, Copyright to toplevel.rb.
* base.rb (Installer.declare_toplevel_installer): removed.
* base.rb (Installer.toplevel_installer): removed. use
ToplevelInstaller.instance.
* base.rb (try_run_hook): eval hook files on installer itself.
* base.rb: reformat.
* compat.rb: reformat.
* config.rb: multi-package descripter moved from package.rb.
* fileop.rb: #mv -> #move_file.
* setup.rb.in: merge install.rb.in.
* toplevel.rb: now ToplevelInstall does not inherit Installer.
* toplevel.rb: new constant ToplevelInstaller::Version.
* toplevel.rb: new constant ToplevelInstaller::Copyright.
* toplevel.rb: new method .multipackage_install?
* toplevel.rb: new method .create_instance
* toplevel.rb: new method .instance
* toplevel.rb: merge package.rb (ToplevelInstallerMulti).
* asm.rb: does not print file names.
Wed Aug 27 07:33:37 2003 Minero Aoki
* base.rb: small refactoring.
* base.rb: move #make and #extdir? to fileop.rb.
* compat.rb: remove File.write.
* compat.rb: move File.read_all to fileop.rb (#read_file).
* config.rb: restruct .new and .load.
* fileop.rb: add #make, #extdir?, #read_file from other files.
* toplevel.rb (parsearg_TASK): refactoring: reduce #respond_to?.
Tue Aug 26 03:22:59 2003 Minero Aoki
* base.rb (REJECT_PATTERNS): missing parens.
Tue Aug 26 03:09:57 2003 Minero Aoki
* base.rb: update coding style.
* config.rb: ditto.
* fileop.rb: ditto.
* package.rb: ditto.
* toplevel.rb: ditto.
Thu Aug 21 15:17:32 2003 Minero Aoki
* Makefile: new task `site'.
Thu Aug 21 15:17:09 2003 Minero Aoki
* doc/index.rhtml.m: add hyper link to note.html.
Thu Aug 21 15:16:32 2003 Minero Aoki
* doc/devel.rd.m: wrote about precise behavior.
Thu Aug 21 14:32:06 2003 Minero Aoki
* version 3.1.5
Thu Aug 21 14:31:00 2003 Minero Aoki
* doc/devel.rd.m: wrote about backward compatibility policy.
Thu Aug 21 14:20:04 2003 Minero Aoki
* Makefile (asm): in.* -> *.in
* Makefile (text): create NEWS.*
* Makefile (text): usage-*.txt -> Usage_*.txt
Thu Aug 21 14:19:09 2003 Minero Aoki
* NEWS.m: wrote version 3.1.5 news.
Thu Aug 21 14:18:33 2003 Minero Aoki
* doc/usage.rd.m: update.
Thu Aug 21 14:10:11 2003 Minero Aoki
* in.install.rb -> install.rb.in
* in.setup.rb -> setup.rb.in
Thu Aug 21 13:57:26 2003 Minero Aoki
* 0ChangeLog -> NEWS.m
Thu Aug 21 13:41:05 2003 Minero Aoki
* Makefile (dist): does not create src/.
Thu Aug 14 17:11:32 2003 Minero Aoki
* compat.rb: avoid 1.8 warning.
Mon May 19 06:29:54 2003 Minero Aoki
* base.rb (clean_dir_ext, dist_dir_ext): should not execute make
unless it is an extdir. [ruby-list:37687]
Mon May 19 06:28:01 2003 Minero Aoki
* Makefile: new task `update'.
Sun May 18 01:55:30 2003 Minero Aoki
* Makefile (install.rb, setup.rb): use $@ for target file name.
Sun May 18 01:54:06 2003 Minero Aoki
* Makefile: typo: public -> publish
Sun May 18 01:53:34 2003 Minero Aoki
* Makefile: add variable $ardir.
* Makefile: new task `publish'.
* Makefile: move Makefile and asm.rb into src/ in distribution
packages.
* Remake: removed.
Sun May 18 01:46:17 2003 Minero Aoki
* Makefile: new task `doc'.
* Makefile: new task `text'.
* Makefile: new task `dist'.
* Makefile: wrote .PHONY.
Sun May 18 01:16:35 2003 Minero Aoki
* base.rb (install_dir_lib): install lib/**/*.rb. Does not use
MANIFEST.
* base.rb (install_dir_bin): MANIFEST support is removed.
* base.rb (install_dir_data): ditto.
Sun May 18 01:12:16 2003 Minero Aoki
* base.rb (srcentries): typo: hookfilenames -> hookfiles (thanks:
Tim Hunter)
Sun May 18 01:09:59 2003 Minero Aoki
* doc/devel.rd -> doc/devel.rd.m
* doc/hookapi.rrd -> doc/hookapi.rrd.m
* doc/index.html -> doc/index.rhtml.m
* doc/metaconfapi.rrd -> doc/metaconfapi.rrd.m
* doc/usage.rd -> doc/usage.rd.m
Sun May 18 01:09:39 2003 Minero Aoki
* ChangeLog -> 0ChangeLog
* ChangeLog: renewed.
setup-3.4.1/COPYING 0000644 0001750 0001750 00000063644 10315245750 014437 0 ustar aamine aamine 0000000 0000000
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
^L
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
^L
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
^L
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
^L
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
^L
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
^L
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
^L
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
^L
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper
mail.
You should also get your employer (if you work as a programmer) or
your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!