[RCR] replace setup.rb/install.rb with builtin module

I proposed this idea last night on the tail-end of another thread and on
the RubyGarden wiki at QuickGuideToPackagingDiscussion as well as on
the raa-install list, but I thought it might make a good RCR:

Anyone else find the current intall.rb/setup.rb script a bit awkward? When
I create a package I’ve got to remember where I left
install.rb and copy it over into my package directory. Then I’ve got to
tar everything up and I’ve got a package… Like I said, seems a little
awkward. What if an InstallPkg module that had all of the functionality
of the install.rb/setup.rb scripts was included with Ruby. Then package
creators could create very simple install.rb scripts that would look like:

#install.rb
require 'install_pkg’
include InstallPkg
depends_on_hash=
{“rexml”=>‘0.5.0’,“rubyfoo”=>‘2.3.1’,‘jabber4r’=>'1.2.1 }
install_package(packageName, depends_on_hash, …other arguments?..)

Perhaps these install.rb scripts could even be automatically generated by
running some built-in package-gen script which would also create the
tar.gz package itself?

This would offer the following advantages:

  1. no more copying install.rb over into your package dir.
  2. it encourages the package creator to list dependencies and versions
    (though it might also be possible to figure these out automatically)
  3. the install.rb takes care of installing dependencies (via
    raa-install) which keeps raa-install simple and it’s purpose clear
    (separation of responsibilities).
  4. It seems better from a code reuse standpoint. I see that a lot of
    people write their own install.rb scripts or they cut and paste from the
    install.rb on the RAA - this seems very inefficient. A standard Install
    API would help a lot and people wouldn’t have to reinvent the wheel all
    the time.

Of course, we would need to get this InstallPkg module into the standard
Ruby distro for maximum impact. And I guess while we’re at it we should
have raa-install included in the standard distribution as well.

By proposing this as an RCR I am implying that package creation and
installation methods should be an integral part of Ruby, not a peripheral
issue.

Phil

···


"Or perhaps the truth is less interesting than the facts?"
Amy Weiss (accusing theregister.co.uk of engaging in ‘tabloid journalism’)
Senior VP, Communications
Recording Industry Association of America

In article atagr002v9o@enews3.newsguy.com,

I proposed this idea last night on the tail-end of another thread and on
the RubyGarden wiki at QuickGuideToPackagingDiscussion as well as on
the raa-install list, but I thought it might make a good RCR:

Anyone else find the current intall.rb/setup.rb script a bit awkward? When
I create a package I’ve got to remember where I left
install.rb and copy it over into my package directory. Then I’ve got to
tar everything up and I’ve got a package… Like I said, seems a little
awkward. What if an InstallPkg module that had all of the functionality
of the install.rb/setup.rb scripts was included with Ruby. Then package
creators could create very simple install.rb scripts that would look like:

#install.rb
require ‘install_pkg’
include InstallPkg
depends_on_hash=
{“rexml”=>‘0.5.0’,“rubyfoo”=>‘2.3.1’,‘jabber4r’=>'1.2.1 }
install_package(packageName, depends_on_hash, …other arguments?..)

Perhaps these install.rb scripts could even be automatically generated by
running some built-in package-gen script which would also create the
tar.gz package itself?

This would offer the following advantages:

  1. no more copying install.rb over into your package dir.
  2. it encourages the package creator to list dependencies and versions
    (though it might also be possible to figure these out automatically)
  3. the install.rb takes care of installing dependencies (via
    raa-install) which keeps raa-install simple and it’s purpose clear
    (separation of responsibilities).
  4. It seems better from a code reuse standpoint. I see that a lot of
    people write their own install.rb scripts or they cut and paste from the
    install.rb on the RAA - this seems very inefficient. A standard Install
    API would help a lot and people wouldn’t have to reinvent the wheel all
    the time.

FYI: I’ve got a working prototype for the propoed InstallPkg module.
It’s a quick kludge - I took Minero Aoki’s install.rb and wrapped the
classes he defined in there in a ‘module InstallPkg’ and added a few module
methods. The kludgy part is how I had to deal with the commandline options
he was using and turning them into arguments to methods (that part will
have to be rewritten).

So basically using this module you would create your own install.rb file
like:

#your install.rb would look something like this:
require ‘install-pkg’
depends_on = {‘webfetcher’=>‘0.0.0’, ‘scan_for_ruby’=>‘0.0.0’}
InstallPkg.install_pkg(‘thispkg’,depends_on)

and run it like so:

$ ruby install.rb

(it does the config, setup and install steps for you so you don’t have to
:slight_smile:

Comments? Suggestions?

Phil

···

Phil Tomson ptkwt@shell1.aracnet.com wrote:

“Or perhaps the truth is less interesting than the facts?”
Amy Weiss (accusing theregister.co.uk of engaging in ‘tabloid journalism’)
Senior VP, Communications
Recording Industry Association of America

ptkwt@shell1.aracnet.com (Phil Tomson) writes:

By proposing this as an RCR I am implying that package creation and
installation methods should be an integral part of Ruby, not a
peripheral issue.

I think it is pretty clear that any packaging system would be made
more convenient to use when bundled with the standard ruby
distribution.

There are a number of Ruby packaging systems being developed and
hopefully one will eventually “win.” When/if that happens I’d be
happy if it were made part of Ruby’s standard distribution. Until
then it seems premature. E.g. whatever comes standard with Ruby
should probably work seamlessly with RAA.succ, but that isn’t done
itself.

great work! is it on its way to the raa?

i’ve never bothered with install scripts before. but with this it sounds like
a piece of cake. so now i will. thanks.

-transami

···

On Thursday 12 December 2002 01:47 pm, Phil Tomson wrote:

In article atagr002v9o@enews3.newsguy.com,

Phil Tomson ptkwt@shell1.aracnet.com wrote:

I proposed this idea last night on the tail-end of another thread and on
the RubyGarden wiki at QuickGuideToPackagingDiscussion as well as on
the raa-install list, but I thought it might make a good RCR:

Anyone else find the current intall.rb/setup.rb script a bit awkward? When
I create a package I’ve got to remember where I left
install.rb and copy it over into my package directory. Then I’ve got to
tar everything up and I’ve got a package… Like I said, seems a little
awkward. What if an InstallPkg module that had all of the functionality
of the install.rb/setup.rb scripts was included with Ruby. Then package
creators could create very simple install.rb scripts that would look like:

#install.rb
require ‘install_pkg’
include InstallPkg
depends_on_hash=
{“rexml”=>‘0.5.0’,“rubyfoo”=>‘2.3.1’,‘jabber4r’=>'1.2.1 }
install_package(packageName, depends_on_hash, …other arguments?..)

Perhaps these install.rb scripts could even be automatically generated by
running some built-in package-gen script which would also create the
tar.gz package itself?

This would offer the following advantages:

  1. no more copying install.rb over into your package dir.
  2. it encourages the package creator to list dependencies and versions
    (though it might also be possible to figure these out automatically)
  3. the install.rb takes care of installing dependencies (via
    raa-install) which keeps raa-install simple and it’s purpose clear
    (separation of responsibilities).
  4. It seems better from a code reuse standpoint. I see that a lot of
    people write their own install.rb scripts or they cut and paste from the
    install.rb on the RAA - this seems very inefficient. A standard Install
    API would help a lot and people wouldn’t have to reinvent the wheel all
    the time.

FYI: I’ve got a working prototype for the propoed InstallPkg module.
It’s a quick kludge - I took Minero Aoki’s install.rb and wrapped the
classes he defined in there in a ‘module InstallPkg’ and added a few module
methods. The kludgy part is how I had to deal with the commandline options
he was using and turning them into arguments to methods (that part will
have to be rewritten).

So basically using this module you would create your own install.rb file
like:

#your install.rb would look something like this:
require ‘install-pkg’
depends_on = {‘webfetcher’=>‘0.0.0’, ‘scan_for_ruby’=>‘0.0.0’}
InstallPkg.install_pkg(‘thispkg’,depends_on)

and run it like so:

$ ruby install.rb

(it does the config, setup and install steps for you so you don’t have to

:slight_smile:

Comments? Suggestions?

Phil

True, but I think the install package can be used now.
It will not be a great effort to get the install to work
with RAA.succ (when it becomes available), but until then,
everyone who will ever install a package could benefit.
Besides, it may be some time before we see RAA.succ.

···

On Friday, 13 December 2002 at 5:56:15 +0900, Matt Armstrong wrote:

ptkwt@shell1.aracnet.com (Phil Tomson) writes:

By proposing this as an RCR I am implying that package creation and
installation methods should be an integral part of Ruby, not a
peripheral issue.

I think it is pretty clear that any packaging system would be made
more convenient to use when bundled with the standard ruby
distribution.

There are a number of Ruby packaging systems being developed and
hopefully one will eventually “win.” When/if that happens I’d be
happy if it were made part of Ruby’s standard distribution. Until
then it seems premature. E.g. whatever comes standard with Ruby
should probably work seamlessly with RAA.succ, but that isn’t done
itself.


Jim Freeze

Hacking’s just another word for nothing left to kludge.

actually i’m not clear about all the package systems in devleopment. the first
i can recall is rpkg, kind of an dpkg for ruby, whihc seemed really cool at
the time. then i heard of ipkg, but i don’t know what that one is about. then
i heard of raa-install which seemed amazing to me. with raa-install, all a
package needs is an install.rb script, tar.gz’d and put on the raa and its
ready for install. this install-pkg library complements that nicely. sounds
like a winning combination.

do i have this right?

-transami

···

On Thursday 12 December 2002 01:56 pm, Matt Armstrong wrote:

I think it is pretty clear that any packaging system would be made
more convenient to use when bundled with the standard ruby
distribution.

There are a number of Ruby packaging systems being developed and
hopefully one will eventually “win.” When/if that happens I’d be
happy if it were made part of Ruby’s standard distribution. Until
then it seems premature. E.g. whatever comes standard with Ruby
should probably work seamlessly with RAA.succ, but that isn’t done
itself.

In article 87lm2v0xen.fsf@squeaker.lickey.com,

ptkwt@shell1.aracnet.com (Phil Tomson) writes:

By proposing this as an RCR I am implying that package creation and
installation methods should be an integral part of Ruby, not a
peripheral issue.

I think it is pretty clear that any packaging system would be made
more convenient to use when bundled with the standard ruby
distribution.

There are a number of Ruby packaging systems being developed and
hopefully one will eventually “win.” When/if that happens I’d be
happy if it were made part of Ruby’s standard distribution. Until
then it seems premature.

I’m merely trying to speed up that ‘until then’. We really need to decide
this issue soon IMHO.

I mentioned raa-install because I’ve used it. Haven’t tried rpkg, though
I think it doesn’t work with the RAA (they have their own repository, am I
right?) so it seems like an advantage for raa-install.

Choice is a double-edged sword: usually the benefits outweigh the
negatives, however in this case I think it’s time to narrow our choices
so that we’re not as a community developing 3 or 4 different types of
incompatible packages. If we don’t decide then the community (which still
isn’t that large) becomes balkanized with multiple, incompatible packaging
formats and lots of brain cycles get wasted on trying to figure out which
packaging system to use when we package our projects.

The nice thing about raa-install is that it works with the current
infrastructure and should be easy to adapt to RAA.succ.

E.g. whatever comes standard with Ruby
should probably work seamlessly with RAA.succ, but that isn’t done
itself.

True.

The packaging system is sort of peripheral to the proposed RCR, though.
The idea of this RCR is that we need an InstallPkg module which
encapsulates the functionality of the Aoki-san’s current install.rb
script and it should be included with Ruby. Doing this offers several
advantages which have already been enumerated. We should probably make it
so we can plug in alternative packaging systems easily to InstallPkg -
however I do believe there should be a default and at this point I’d vote
for raa-install since it seems to be working.

Anyway, to summarize: anything we can do to make it easier to create
packages will help us get more packages and I think that this proposal
would really help. Also, anything we can do to make it easier for people
to get required packages from RAA or elsewhere on the web will go a long
ways toward greater adoption of Ruby.

Phil

···

Matt Armstrong matt@lickey.com wrote:


“Or perhaps the truth is less interesting than the facts?”
Amy Weiss (accusing theregister.co.uk of engaging in ‘tabloid journalism’)
Senior VP, Communications
Recording Industry Association of America

In article 200212121419.27643.transami@transami.net,

great work! is it on its way to the raa?

I hope to put it up there today or tomorrow.

InstallPkg install theyself :wink:

i’ve never bothered with install scripts before. but with this it sounds like
a piece of cake. so now i will. thanks.

good…

Phil

···

Tom Sawyer transami@transami.net wrote:

“Or perhaps the truth is less interesting than the facts?”
Amy Weiss (accusing theregister.co.uk of engaging in ‘tabloid journalism’)
Senior VP, Communications
Recording Industry Association of America

In article 200212121428.46026.transami@transami.net,

···

Tom Sawyer transami@transami.net wrote:

On Thursday 12 December 2002 01:56 pm, Matt Armstrong wrote:

I think it is pretty clear that any packaging system would be made
more convenient to use when bundled with the standard ruby
distribution.

There are a number of Ruby packaging systems being developed and
hopefully one will eventually “win.” When/if that happens I’d be
happy if it were made part of Ruby’s standard distribution. Until
then it seems premature. E.g. whatever comes standard with Ruby
should probably work seamlessly with RAA.succ, but that isn’t done
itself.

actually i’m not clear about all the package systems in devleopment. the first
i can recall is rpkg, kind of an dpkg for ruby, whihc seemed really cool at
the time. then i heard of ipkg, but i don’t know what that one is about. then
i heard of raa-install which seemed amazing to me. with raa-install, all a
package needs is an install.rb script, tar.gz’d and put on the raa and its
ready for install. this install-pkg library complements that nicely. sounds
like a winning combination.

do i have this right?

Seems that way to me :wink: But as I said in another post, I think we can
make InstallPkg so that the packaging system is pluggable.

Phil

“Or perhaps the truth is less interesting than the facts?”
Amy Weiss (accusing theregister.co.uk of engaging in ‘tabloid journalism’)
Senior VP, Communications
Recording Industry Association of America

AOL!

martin

···

Tom Sawyer transami@transami.net wrote:

great work! is it on its way to the raa?

i’ve never bothered with install scripts before. but with this it sounds like
a piece of cake. so now i will. thanks.