From: Damphyr Date: 2003-04-09T06:03:24+09:00 Subject: Re: Call for standardised package installation procedure This is a multi-part message in MIME format. --------------040708040006080204010004 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by funfun.nagaokaut.ac.jp id h38L3hH26595 I admit I haven't the last four emails in this thread but I can't help=20 myself, I must butt in :) If I remember correctly the whole thread started with a request for a=20 common way to install ruby programs/libraries. As I mentioned before, having to little experience with C extensions I=20 will leave them out for the moment. I will start first with the pure=20 ruby libs that go into the site directory. My impression is that high in the wish list (and helpful to most=20 newbies) would be a package that offers a unified and easy (if error=20 free or less error prone) way to put the ruby libraries where they belong. That means put them in CONFIG["sitedir"] or CONFIG["sitelibdir"] or CONFIG["sitearchdir"] (taken from rbconfig.rb) and make sure all require statements are fullfiled. For starters let the=20 user find and install the packages that are required. Going one step further, it would be nice to have some tool that can=20 create such an install script for the developer. That would be step one. Step two can build on such a tool by making it "ruby repository" aware.=20 That, for me, means that such an autogenerated script looks for=20 repository support in the ruby installation and adds an entry (and such=20 a repository has a tool to query for already installed packages) Having a clearly defined interface for these two would help OS package=20 maintainers to get the information they need to maintain ruby-package=20 distributions. I personally use Gentoo, Tom you can scream if I'm=20 talking rubish, and I don't think adapting an ebuild to pass data from a=20 ruby script to Portage is such a big deal - provided there is a unified=20 way to keep such information :). But, again, this would come as a third=20 step in my list. Since the thread started I played around with a few ideas and put=20 together some code yesterday. Unfortunately I have not had the time to=20 complete the functionality, nor have I any way to host this ultra alpha=20 version so that you could look at it. So I'll simply attach it to this email and whoever is interested can=20 take a look at it. First let me say that I would like to take the time and check Minero=20 Aoki's setup.rb. Second, let's just say I'm too new with Ruby to be able=20 to write really effective code. Third, here's the central idea for this: It consists of two parts: Part one is the creator: Given a structure like the following: /----src/ |--doc/ |--foo/ running the createinstall script with a package name parameter in / will=20 create a directory called distro that contains the above structure, so=20 we have /---src/ |-doc/ |-foo/ |-distro/package |----src/ |----doc/ |----bla/ Now, the ruby files are in src/ and the creator script has generated a=20 script called distro/rbinstall.rb This rbinstall.rb has some command line parameters and essentially does=20 the following: Checks in all files in /src for require statements and then traverses=20 the rubylib, archdir, sitearchdir, sitelibdir and sitedir directories=20 for .rb files that match the require parameters. If everything found is matched then it copies the contents of src/ under one of the sitearchdir, sitelibdir and sitedir directories depending on=20 what was specified in createinstall (dependencies for architecture=20 and/or version). The way the rbinstall.rb script is generated is actually a hack: The actual class, the script and the required module are put together=20 from files in the creatorinstall library (putting the module in the file=20 instead of require'ing it ensures it will be there, and it will be the=20 version the script expects it to be). The createinstall.rb just fills in=20 a "header" for the generated file with constants whose values are used=20 by the script file. I have coded (more or less) the following: (This is in no way complete - it's a day's coding with three weeks=20 experience in Ruby - feel free to deride/curse/roll eyes. This also=20 means that the code is in a look-but-don't-run state. I promise,=20 *really*, that I'll have a runable version by the end of the week,=20 unless I get booed by everyone in this list) creator.rb: This is the class that creates the distro directory and the installer=20 script. It is clever enough to look for it's own files (rbinstall.rb,=20 script.rb and requirements.rb) in the libraries or under the current=20 directory. requirements.rb This is a module that adds a method for finding the contents of require=20 statements in all files under a directory and a method for matching that=20 list from all files in the ruby libraries. Uses rbconfig.rb to find the=20 directories. rbinstall.rb This defines a class that does the basic install sequence (actually=20 copies the files :) ). I need to test it - didn't have enough time to=20 finish it yesterday. script.rb This is the part of the installer script that executes. Here are the=20 command line parameters defined and handled, the RBINSTALL class=20 instantiated etc. This needs a bit more work. It should use rbconfig.rb=20 to check architecture and/or ruby version requirements What's missing: createinstaller.rb where the command line parameters are passed to the=20 creator class and everything is put together. Nothing is tested, there is no documentation and I'm not even sure this=20 is proper ruby. I am pretty confident that I can make this "self-hosting" from day one=20 (ok day three, days one and two are already gone :) ). This means that=20 this package can distribute and install itself. What can be done: Wow, after reading most of the thread I can imagine a lot of things, but=20 I will contain myself to the following: *Extend the functionality to handle C extensions. *Add support for a ruby repository (as a library withing this=20 package). This can be easily made optional. When such functionality=20 is there, then we can also talk about a scheme for versioning packages. *For missing requirements go to RAA and suggest packages for download. Like I said, easy does it. For me the number one priority is to built a=20 tool that simplifies deployment within Ruby and then buildng on that to=20 add ways to be used by external tools. Phew, that was a long email :P V.- -- http://www.freemail.gr - =E4=F9=F1=E5=DC=ED =F5=F0=E7=F1=E5=F3=DF=E1 =E7=EB= =E5=EA=F4=F1=EF=ED=E9=EA=EF=FD =F4=E1=F7=F5=E4=F1=EF=EC=E5=DF=EF=F5. --------------040708040006080204010004 Content-Type: application/x-zip-compressed; name="rbinstall.zip" Content-Disposition: inline; filename="rbinstall.zip" Content-Transfer-Encoding: base64 UEsDBBQAAAAIAOWyhy5m9HM0CgYAAMISAAAUAAAAcmJpbnN0YWxsL2NyZWF0b3IucmKVV1tv 2zYUfnaA/AdWAmqnTd1h2FNQo3Fdtw2aJYWTbCi6zqAl2uYiiy5JNc0S77fvHF4kypYT9yVQ yHP5zu07tGTfCi4ZaWdi9pts7+9JfyAnicinfBaeTbUQmYKTOBDjudI0y166owXLNYrs7yUZ VYqc2GsmB5JRLeT+Xmv05uTs4rJ/ejr+Yzi6ODk/Iz3yS/dXuOF5khUpIwPjOjg4RXjwf+wP RoG3DzRPwQFekwS9MEIJBDTDM0LI8bH9B9ycmo9uzm4C6C8SC61dk+6KQi8LrZlUoHju/+kq ncINOCsFM/adZSDzdvjm6j2iWNwSpYvpFL5dpMMR3AceNVO6KydtEqdsSotMk5wuGJkKSfSc ESdGVCL5En2BFBxyzWnG/2WdJU2u6YwdwE3rOOXSKIODlCstRbs0ClcsgchurXktCARhPBhJ Pik0FzmZ8owpY8sZBlvuC05ZnjoE1vzY5hjlJ2zGc/xoxWXiK58J1j11WkbqLZfdxTVIdDzq A1Lk4FyRd4Chy36ArHpd3dZsI24PsPRiJDSVM6ZdFrzyczR5dHQx/NQf9S/PR8+Pq5hCKJVy M5jg3sERy1sD5mYuMgY6KZPZLc9nQewQcpHoQlpncD5GrU672z5csyeZSgorVnYUkxI6IbrK 6SQzZXMZqOzHdz7MV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