Call for standardised package installation procedure

I’m helping maintain Ruby and Ruby packages in Gentoo Linux.

Currently, different packages have different installation procedures.
For example, some use the extconf mechanism, some use Minero Aoki’s
setup.rb, and others roll their own.

It would make my job a lot easier if just one were chosen, and perhaps
made part of the standard Ruby distribution. A standard installation
procedure would make it much quicker for me to add packages, and
reduce everyone’s reading of READMEs.

Personally, I vote for Minero Aoki’s setup.rb:
http://i.loveruby.net/en/setup.html

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

Comments? Flames?

Tom

My only RAA submission is 8 times smaller than the zipped installer and
is in early alpha version. I don’t want people to install it, but rather
unpack and play a bit with it.

But I want it to be in the RAA.

If an installer is a required item to enter the RAA, what am i gonna do
?

Apart from that, i also think that the ruby “installer” should support
an uninstall option (not sute Minero’s setup.rb does that) even if this
option is probably quite difficult to implement.

Oct.

···

On Sun, Apr 06, 2003, Tom Payne wrote:

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

Comments? Flames?


Pierre Baillet
Il faut pomper pour vivre et donc vivre pour pomper.
Devise Shadok

It would make my job a lot easier if just one were chosen, and perhaps
made part of the standard Ruby distribution. A standard installation
procedure would make it much quicker for me to add packages, and
reduce everyone’s reading of READMEs.

Personally, I vote for Minero Aoki’s setup.rb:
setup.rb

Is it that all packages need to use the same installation code, or that they
all implement an installer that follows a known interface? I would be
happy if every package had a script named install.rb that had a known
and consistent behavior. Many apps already have such a script, but they don’t all
do the same thing. For some, running it without args will install the code.
In other cases, it spits back a terse message that that you call it with some
cryptic args.

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

It would be nice if even basic scripts included a scripted way to do installation,
but I’m leery of requirements for inclusion. Still, as others have mentioned, some
machine-readable bit that indicates the presence of a standard install method
would be a nice feature in the RAA.

I’d be interested to hear from folks as to:
a) Why they do not include an installation script

and, more generally,

b) Why they do not list their code in the RAA at all (but do make it available
from, say, SourceForge or a personal home page)

James

Well I’ve gone through the whole thread and put some points together
(plus my own ideas).
Here’s what I would do:

An application that simplifies installation procedures would consist
primarily of two parts. Let’s call them the creator and installator scripts.

The creator script is run by the developer/maintainer who wants to
publish something.
As a general guideline it should do the following:

  • Detect requirements
    (one way is to scan for require statements)
  • Define version and/or platform independency/dependency
    (default behaviour would be to force the version and platform of the
    machine that creates the bundle)
  • Create the creator script
  • Bundle the application

Now the user that gets the bundle has the app and the installator script
which:

  • by default installs in lib/ruby/site_ruby// unless
    specified by creator otherwise
  • Does ‘fake’ installs e.g. in a user defined directory
  • For applications does ‘targeted’ installs (application goes to a
    directory, libs go to /lib/ruby/site_ruby//
  • detects missing requirements (and lists them)
  • run with no arguments it just prints a helpful message
    (like “Hi, I am your friendly installer. I carry application
    so-and-so version 0.12 for Linux and Ruby 1.6. Unfortunately you have
    Ruby 1.8 - Goodbye”)

Now, since I haven’t mixed myself in C extensions, what I outline above
is an app that would automate installation and distribution of pure Ruby
applications (and perhaps binaries).
Anyone care to expand/comment?
V.-

···


http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.

I’d like to echo the sentiment that even the simplest thing needs an
install command. Take “iconv” from the RAA:

  • it has an extconf.rb, but doesn’t respond to --help (I had to read the
    Pickaxes’s chapter on mkmf, and figured out how to map dir_config()'s
    argument to a command line argument…)

    Suggestion: mkmf’s create_makefile() should implement a --help option!

  • It lacks an install script, so I am about to start doing some more
    reading to see where it goes.

    Observation: it’s not enormously obvious where to install single files
    for beginners.

Cheers,
Sam

Quoteing google@tompayne.org, on Sun, Apr 06, 2003 at 07:05:27PM +0900:

···

I’m helping maintain Ruby and Ruby packages in Gentoo Linux.

Currently, different packages have different installation procedures.
For example, some use the extconf mechanism, some use Minero Aoki’s
setup.rb, and others roll their own.

It would make my job a lot easier if just one were chosen, and perhaps
made part of the standard Ruby distribution. A standard installation
procedure would make it much quicker for me to add packages, and
reduce everyone’s reading of READMEs.

Personally, I vote for Minero Aoki’s setup.rb:
setup.rb

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

Comments? Flames?

Tom

I 100% agree, and I am using install.rb for RMagick, but I don’t think
it’s quite full-featured enough for the needs of C extensions in
general. I’ve had to add an autoconf-generated configure script step
to handle configuration details that install.rb doesn’t handle (or
that I am insufficiently clever to make install.rb handle :-),
including pre-processing extconf.rb and metaconfig. This configure
script gives me no end of trouble and I’d love to ditch it for a
Ruby-based solution. Of course, from autoconf I get the benefit of a
bazillion person-years of experience in building portable
applications.

Also, as another follow-up has mentioned, install.rb needs to generate
an ‘uninstall’ target.

···

On 6 Apr 2003 01:56:23 -0800, google@tompayne.org (Tom Payne) wrote:

I’m helping maintain Ruby and Ruby packages in Gentoo Linux.

Currently, different packages have different installation procedures.
For example, some use the extconf mechanism, some use Minero Aoki’s
setup.rb, and others roll their own.

It would make my job a lot easier if just one were chosen, and perhaps
made part of the standard Ruby distribution. A standard installation
procedure would make it much quicker for me to add packages, and
reduce everyone’s reading of READMEs.

Personally, I vote for Minero Aoki’s setup.rb:
setup.rb

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

Comments? Flames?

Tom

possibly we could just add a flag like “setup.rb-instalable” . It seem
to me there was a related topic sometime ago about a raa-install’able
flag…

···

il Sun, 6 Apr 2003 19:18:12 +0900, Pierre Baillet oct@zoy.org ha scritto::

On Sun, Apr 06, 2003, Tom Payne wrote:

Ideally I would like it to be a requirement for all packages in the
RAA to support the standard installation procedure (whatever that
turns out to be).

Comments? Flames?

My only RAA submission is 8 times smaller than the zipped installer and
is in early alpha version. I don’t want people to install it, but rather
unpack and play a bit with it.

But I want it to be in the RAA.

If an installer is a required item to enter the RAA, what am i gonna do
?

It would make my job a lot easier if just one were chosen, and perhaps
made part of the standard Ruby distribution. A standard installation
procedure would make it much quicker for me to add packages, and
reduce everyone’s reading of READMEs.

Personally, I vote for Minero Aoki’s setup.rb:
http://i.loveruby.net/en/setup.html

ruby -rcran -e shell

install foofoo
Retrieving foofoo…
foofoo requires bitbang
foofoo requires barbar
barbar requires snickdorfer
foofoo requires quantos 1.2.3 currently you have 1.2.2, updating
blantic 2.0.4 is not compatible with quantos 1.2.3, updating to 2.1.3
installing…
finished

Ahh, to dream…

Regards,
JJ

I’ll address these issues just from
my own point of view.

I’d be interested to hear from folks as to:
a) Why they do not include an installation script

First, I don’t see the need for an install
script if it’s just a single file foo.rb
which you do a require() on.

Second, some things in the RAA are simple
documentation and arguably might not need
an install.

Third, I’m not sure that there is truly
one single standard to follow. I haven’t
researched it, but this is my impression.

and, more generally,

b) Why they do not list their code in the RAA at all (but do make it
available
from, say, SourceForge or a personal home page)

For my part, I have a few items on my page
that aren’t in the RAA.

This is because they are 1) too trivial or
2) too old or that kind of thing.

But basically, I personally don’t want to
put anything in the RAA until it is in
fairly good shape. (No flames intended
toward those who think otherwise.) I don’t
like to see an interesting new item in
the RAA and then see “Version 0.001 -
pre-pre-alpha - Unstable - No real features -
Very buggy” and so on.

Hal

···

----- Original Message -----
From: “James Britt” james@jamesbritt.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, April 06, 2003 12:02 PM
Subject: Re: Call for standardised package installation procedure

b) Why they do not list their code in the RAA at all (but do make it
available
from, say, SourceForge or a personal home page)

… because RAA is just “One More Thing” to do to release, and I’ve already
got little free time to do any of this. I can include updates to my website
in a build process, but maintaining the RAA entry is still a manual process
(AFAIK), so for small items I just skip it (plus, I don’t think anyone will
be missing these contributions :slight_smile:

Chris
http://clabs.org

“James Britt” james@jamesbritt.com wrote in message news:NGEDJNFKAGDNDOIPFPBDGECLDNAA.james@jamesbritt.com

Is it that all packages need to use the same installation code, or that they
all implement an installer that follows a known interface? I would be
happy if every package had a script named install.rb that had a known
and consistent behavior. Many apps already have such a script, but they don’t all
do the same thing. For some, running it without args will install the code.
In other cases, it spits back a terse message that that you call it with some
cryptic args.

This is all very Ruby-oriented. The best thing, for users, is that
they install Ruby modules the same way they install any other
software. apt-get, emerge, rpm -Uvh, whatever. That said, we don’t
have much control over that, per se. The set of available Ruby
packages will always be larger than the set of available Ruby packages
for a distribution.

I agree that it is therefore nice to have a single, common interface
to installing (and uninstalling) Ruby packages outside of any
platforms package maintenance software. This really helps people not
using OS package management systems. When I unpack C-based software
on Linux and see “configure”, I get decidedly happier.

I don’t know much about other package management systems; I remember
hating RPM, but beyond that, my experience has been limited. I
certainly don’t think that having a uniform installer for Ruby is as
important for ebuilders; Portage is does a superlative job of making
ebuild generation and maintenance as easy as possible. In fact, for
projects with a low delta in their build/install mechanism, the amount
of work required to create a new ebuild for a new version of the
package is the cost of renaming a single file. It helps the original
ebuilder if the install mechanism supports the equivalent of “make
DESTDIR=”, but it isn’t absolutely necessary. I don’t believe that
Portage even takes advantage of any software’s “uninstall” mode – it
merely remembers what files it installed, and deletes them (if they
haven’t changed in the meantime).

It would be nice if even basic scripts included a scripted way to do installation,
but I’m leery of requirements for inclusion. Still, as others have mentioned, some
machine-readable bit that indicates the presence of a standard install method
would be a nice feature in the RAA.

Hm. Or, maybe an “Install” metadata, with possible values such as
“make”, “ant”, “setup.rb”, “bashing-your-head-between-two-bricks”, or
whatnot.

I’d be interested to hear from folks as to:
a) Why they do not include an installation script

For most people, probably overhead, or lack of need.

b) Why they do not list their code in the RAA at all (but do make it available
from, say, SourceForge or a personal home page)

This issue gets on my nerves, one way or another. I list REXML in RAA
and Freshmeat, and there are a couple of other popular places I could
probably usefully list it. Maintaining an entry in one list is fine.
Maintaining it in two is a pain in the ass, and maintaining it in
three… well, I won’t do it. It already takes me a few hours to
write a release notice, post it to RAA and Freshmeat, make an
announcement in C.L.R. and the REXML mailing list, submit an ebuild to
Gentoo, and test links in the various places to make sure they’re OK
– and that’s with a mostly automated distribution mechanism for
building the main REXML web page.

Now, if a software catalog supported some sort of XML-RPC mechanism
for posting updates, I’d be happy to add them to the list of places I
maintain entries. To my knowledge, neither RAA nor Freshmeat does
this; it is a fully interactive process to post updates, and, to be
honest, I’d rather be writing software.

This is where somebody embarasses me by pointing out that RAA or
Freshmeat does provide a web service interface to updating entries
– please … go ahead. I’d gladly eat that particular crow.

— SER

Don’t dream too hard. I presume you are alluding to the CPAN command-line
utility; I could never get the #$%! thing to work. On two occasions I’ve
wasted an hour trying to get it to do anything useful, and given up in
disgust. So I always end up installing Perl packages by hand anyway.

At least they have a consistent interface for manual installation:
perl Makefile.PL
make
sudo make install

Just a convention like that would be very useful in its own right.

Regards,

Brian.

···

On Mon, Apr 07, 2003 at 03:52:28AM +0900, John Johnson wrote:

ruby -rcran -e shell

install foofoo
Retrieving foofoo…
foofoo requires bitbang
foofoo requires barbar
barbar requires snickdorfer
foofoo requires quantos 1.2.3 currently you have 1.2.2, updating
blantic 2.0.4 is not compatible with quantos 1.2.3, updating to 2.1.3
installing…
finished

Ahh, to dream…

From: Hal E. Fulton [mailto:hal9000@hypermetrics.com]
I’ll address these issues just from
my own point of view.

I’d be interested to hear from folks as to:
a) Why they do not include an installation script

First, I don’t see the need for an install
script if it’s just a single file foo.rb
which you do a require() on.

I’m not so sure that every Ruby newbie knows where
to put such files. Seems so simple to have a script
that locates your site_ruby dir for you and copies
it over, unless there is a name conflict.

Here’s code that writes an install.rb script if all
you need is to copy a file to the site_dir:

#------------------------ begin --------------
#!/usr/local/bin/ruby

src = %q<#!/usr/local/bin/ruby

require ‘rbconfig’
require ‘ftools’

include Config

class Installer
def self.copy_unless_exists( f)
version = CONFIG[“MAJOR”]+“.”+CONFIG[“MINOR”]
libdir = File.join(CONFIG[“libdir”], “ruby”, version)
sitedir = CONFIG[“sitedir”] || File.join($libdir, “site_ruby”)

put_to = "#{sitedir}/#{f}"
puts "Copying #{f} to #{put_to}"
if File.exist? put_to
  puts "Trouble! #{put_to} already exists!"
else
  begin
    File::install( f, File.join(sitedir, f), 0755, true)
    puts "All done.  Go be happy."
  rescue Exception
    puts  "There was a problem copying the file: #{$!}"
  end
end

end
end >

if ARGV[0]
File.open( “install.rb”, “w”){ |f|
f.print “#{src}\n\n”
f.print “Installer.copy_unless_exists ‘#{ARGV[0].to_s}’”
}
else
puts ‘You need to give the name of the source file.’
end

#------------------ end ---------------------

You can run it on itself if you want an installer for it :slight_smile:

b) Why they do not list their code in the RAA at all (but do make it
available
from, say, SourceForge or a personal home page)

But basically, I personally don’t want to
put anything in the RAA until it is in
fairly good shape. (No flames intended
toward those who think otherwise.) I don’t
like to see an interesting new item in
the RAA and then see “Version 0.001 -
pre-pre-alpha - Unstable - No real features -
Very buggy” and so on.

Makes me think of the numerous projects on SourceForge
that list no files, no docs, one developer.

Some people might be inclined to join an existing project
rather than start their own if they know alpha code exists.
I wonder if there should be some sort of alpha code half-life
feature in RAA, such that if an entry is listed as alpha
for longer than some period of time, it gets deleted and
the owner informed by E-mail.

James

···

Hal

John Johnson jj5412@earthlink.net wrote in message news:1049655145.1847.10.camel@hppav.home.net

ruby -rcran -e shell

install foofoo
Retrieving foofoo…
foofoo requires bitbang
foofoo requires barbar
barbar requires snickdorfer
foofoo requires quantos 1.2.3 currently you have 1.2.2, updating
blantic 2.0.4 is not compatible with quantos 1.2.3, updating to 2.1.3
installing…
finished

As I package maintainer I don’t want this (although I have no problem
with others using this facility). I want:

  1. consistent installation procedure
  2. ability to install to a ‘fake’ directory, e.g.
    make DESTDIR=/somewhere/random install
    this is so I can then build a package with the files that would be
    installed.

(1) stops me having to treat every package as a special case
(2) is more likely to exist (and work properly) if everyone uses the
same installation script.

Dependencies are [should be] handled by the package management system.
John, your wish has already come true on Gentoo and Debian systems :slight_smile:

Regards,

Tom

maintain entries. To my knowledge, neither RAA nor Freshmeat does
this; it is a fully interactive process to post updates, and, to be
honest, I'd rather be writing software.

Well, I hope that you know that RAA update is just a FORM with a CGI
script, perhaps possible to use ruby to send the data :-))

Guy Decoux

Now, if a software catalog [RAA] supported some sort of XML-RPC mechanism
for posting updates, I’d be happy to add them to the list of places I
maintain entries.

Lyle expressed a similar sentiment when I asked about this a month ago:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=3E6F4BF2.1000209%40u
sers.sourceforge.net

Chris
http://clabs.org

agree wholeheartly

in my system, nothing would be better than being able to do
apt-get install module
and having that take care of the dependencies.

require IMHO

Each system should use its own tools; we can allow this by having some
script generate all the packages (kinda like what Debian is doing now with
the autobuilders).

We will someday need the code, computational resources, etc, to make
that. What we need now is more METADATA.

I believe the first thing should be imposing standards on metadata. It
should specify (to begin with):

  • info currently available in RAA
  • dependencies (including version numbers and revisions of the
    packages)
  • templatized information on how to install, to be completed later

All this should be machine-parseable and extensible, yet as small
and convenient as possible.

This is essentially a .spec/ebuild(?)/debian control/etc builder.
A system generic enough to provide the information needed for all
possible platforms. Then some tool would process it and create the files
needed by the native packaging tools.
It would probably resemble an intelligent templating system.

Guess we need some brainstorming to define what is really needed in the
templates. Must be generic yet detailed enough.

···

On Tue, Apr 08, 2003 at 01:29:06AM +0900, Sean Russell wrote:

This is all very Ruby-oriented. The best thing, for users, is that
they install Ruby modules the same way they install any other
software. apt-get, emerge, rpm -Uvh, whatever.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

On the Internet, no one knows you’re using Windows NT
– Submitted by Ramiro Estrugo, restrugo@fateware.com

In article NGEDJNFKAGDNDOIPFPBDIEDIDNAA.james_b@neurogami.com,

From: Hal E. Fulton [mailto:hal9000@hypermetrics.com]
I’ll address these issues just from
my own point of view.

I’d be interested to hear from folks as to:
a) Why they do not include an installation script

First, I don’t see the need for an install
script if it’s just a single file foo.rb
which you do a require() on.

I’m not so sure that every Ruby newbie knows where
to put such files. Seems so simple to have a script
that locates your site_ruby dir for you and copies
it over, unless there is a name conflict.

Here’s code that writes an install.rb script if all
you need is to copy a file to the site_dir:

Why do we have to copy ‘setup.rb’ or ‘install.rb’ at all? Why isn’t there
a standard module that has methods that support installation.

My installpkg that I put on RAA back in December was intended to be
a step in that direction and a catalyst for discussion. Using installpkg
you write your own install.rb script which tends to be very simple and
looks like:

require ‘install-pkg’
include InstallPkg
InstallPkg.install_pkg(‘RHDL’)

That’s it for a package with no dependencies. If there are dependencies
you can declare them in your install.rb and installpkg uses raa-install to
go find the packages you need to install.

I basically just took Aoki-san’s install.rb and wrapped it in a module and
added a couple of module methods - so it is a bit of a kludge, but it
seems to work.

I’m using installpkg for my RHDL package and I’ve heard from a few others
that are using it as their package installer. Something like this should
be included in the standard library.

Phil

···

james_b@neurogami.com wrote:

Doesn’t help those of us who choose not to use Gentoo or Debian. (I
use SuSE when I use Linux; I also use Windows XP.) Frankly, I don’t
want the OS to manage my Ruby libraries; they’re typically much
more lightweight than C libraries.

-austin
– Austin Ziegler, austin@halostatue.ca on 2003.04.07 at 13:31:24

···

On Mon, 7 Apr 2003 16:47:20 +0900, Tom Payne wrote:

Dependencies are [should be] handled by the package management
system. John, your wish has already come true on Gentoo and Debian
systems :slight_smile:

John Johnson jj5412@earthlink.net wrote in message news:1049655145.1847.10.camel@hppav.home.net

ruby -rcran -e shell

install foofoo
Retrieving foofoo…
foofoo requires bitbang
foofoo requires barbar
barbar requires snickdorfer
foofoo requires quantos 1.2.3 currently you have 1.2.2, updating
blantic 2.0.4 is not compatible with quantos 1.2.3, updating to 2.1.3
installing…
finished

As I package maintainer I don’t want this (although I have no problem
with others using this facility). I want:

  1. consistent installation procedure
  2. ability to install to a ‘fake’ directory, e.g.
    make DESTDIR=/somewhere/random install
    this is so I can then build a package with the files that would be
    installed.

Well, since I’m dreaming, just add:
ruby -rcran -e shell

package mypackage 1.12.3
dependencies resolved, package is
mypackage-1.12.3.tar.gz
publish mypackage-1.12.3 at raa.ruby-lang.org
package published, docs published
ftp mypackage-1.12.3 to ftp.ruby-rocks.org
finished

Regards,
JJ

Be Kind, Be Careful, Be Yourself

···

On Mon, 2003-04-07 at 03:47, Tom Payne wrote: