From: "Mauricio Fernández" Date: 2004-01-20T23:01:25+09:00 Subject: Re: Installing a program Unix-like On Tue, Jan 20, 2004 at 09:05:00PM +0900, Malte Milatz wrote: > I wrote: > > I don't want to be forced to imagine that every Ruby programmer writes > > his own script, in which he moves the appropriate files into > > /usr/local/bin, -share, -lib, -man etc. > > It's time that I thank everybody who replied to my question; I think > setup.rb is the thing I need. Maybe together with some other things that > are based on it, or which install the doc's. Quick hack, just to show you how easy it is (note that this is for an older version; you had better modify the sources of setup.rb instead of the generated file itself). batsman@tux-chan:~/src/rdocsite$ diff -u install.rb.old install.rb --- install.rb.old 2004-01-20 14:44:47.000000000 +0100 +++ install.rb 2004-01-20 14:50:49.000000000 +0100 @@ -139,6 +139,9 @@ [ 'data-dir', [ '$prefix/share', 'path', 'the directory for shared data' ] ], + [ 'doc-dir', [ '$prefix/share/doc', + 'path', + 'the directory for documentation' ] ], [ 'ruby-path', [ rubypath, 'path', 'path to set to #! line' ] ], @@ -472,7 +475,7 @@ end - FILETYPES = %w( bin lib ext data ) + FILETYPES = %w( bin lib ext data doc ) include FileOperations @@ -610,6 +613,9 @@ def config_dir_data( rel ) end + def config_dir_doc( rel ) + end + # # TASK setup # @@ -656,6 +662,9 @@ def setup_dir_data( relpath ) end + def setup_dir_doc( relpath ) + end + # # TASK install # @@ -684,6 +693,11 @@ install_files target_filenames(), config('data-dir') + '/' + rel, 0644 end + def install_dir_doc( rel ) + install_files target_filenames(), config('doc-dir') + '/' + rel, 0644 + end + + def install_files( list, dest, mode ) mkdir_p dest, @options['install-prefix'] list.each do |fname| @@ -776,6 +790,9 @@ def clean_dir_data( rel ) end + def clean_dir_doc( rel ) + end + # # TASK distclean # @@ -799,6 +816,9 @@ def distclean_dir_data( rel ) end + def distclean_dir_doc( rel ) + end + # # lib # -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Dijkstra probably hates me. -- Linus Torvalds, in kernel/sched.c