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

**URL:** <https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586>\
**Category:** ruby-talk\
**Created:** [12 December 2002 18:06 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586 "2002-12-12T18:06:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ptkwt1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Ptkwt1](https://rubytalk.org/u/Ptkwt1)\
**Post date:** [12 December 2002 18:06 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/1 "2002-12-12T18:06:42Z")

</div>

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](http://theregister.co.uk) of engaging in ‘tabloid journalism’)  
> Senior VP, Communications  
> Recording Industry Association of America

---

<div class="post-metadata">

**Author:** ![Ptkwt1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Ptkwt1](https://rubytalk.org/u/Ptkwt1)\
**Post date:** [12 December 2002 20:47 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/2 "2002-12-12T20:47:13Z")

</div>

In article [atagr002v9o@enews3.newsguy.com](mailto: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  
🙂

Comments? Suggestions?

Phil

> **···**
>
> ## Phil Tomson [ptkwt@shell1.aracnet.com](mailto:ptkwt@shell1.aracnet.com) wrote:
> 
> “Or perhaps the truth is less interesting than the facts?”  
> Amy Weiss (accusing [theregister.co.uk](http://theregister.co.uk) of engaging in ‘tabloid journalism’)  
> Senior VP, Communications  
> Recording Industry Association of America

---

<div class="post-metadata">

**Author:** ![Matt\_Armstrong](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Matt\_Armstrong](https://rubytalk.org/u/Matt_Armstrong)\
**Post date:** [12 December 2002 20:56 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/3 "2002-12-12T20:56:15Z")

</div>

[ptkwt@shell1.aracnet.com](mailto: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.

---

<div class="post-metadata">

**Author:** ![Tom\_Sawyer](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tom\_Sawyer](https://rubytalk.org/u/Tom_Sawyer)\
**Post date:** [12 December 2002 20:59 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/4 "2002-12-12T20:59:39Z")

</div>

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](mailto:atagr002v9o@enews3.newsguy.com),
> > 
> > Phil Tomson [ptkwt@shell1.aracnet.com](mailto: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
> > 
> > 🙂
> > 
> > Comments? Suggestions?
> > 
> > Phil

---

<div class="post-metadata">

**Author:** ![Jim\_Freeze2](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@Jim\_Freeze2](https://rubytalk.org/u/Jim_Freeze2)\
**Post date:** [12 December 2002 21:06 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/5 "2002-12-12T21:06:22Z")

</div>

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](mailto: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.

---

<div class="post-metadata">

**Author:** ![Tom\_Sawyer](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tom\_Sawyer](https://rubytalk.org/u/Tom_Sawyer)\
**Post date:** [12 December 2002 21:08 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/6 "2002-12-12T21:08:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ptkwt1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Ptkwt1](https://rubytalk.org/u/Ptkwt1)\
**Post date:** [12 December 2002 22:27 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/7 "2002-12-12T22:27:33Z")

</div>

In article [87lm2v0xen.fsf@squeaker.lickey.com](mailto:87lm2v0xen.fsf@squeaker.lickey.com),

> [ptkwt@shell1.aracnet.com](mailto: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](mailto:matt@lickey.com) wrote:
> 
> –  
> “Or perhaps the truth is less interesting than the facts?”  
> Amy Weiss (accusing [theregister.co.uk](http://theregister.co.uk) of engaging in ‘tabloid journalism’)  
> Senior VP, Communications  
> Recording Industry Association of America

---

<div class="post-metadata">

**Author:** ![Ptkwt1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Ptkwt1](https://rubytalk.org/u/Ptkwt1)\
**Post date:** [12 December 2002 22:27 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/8 "2002-12-12T22:27:38Z")

</div>

In article [200212121419.27643.transami@transami.net](mailto: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 😉

> 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](mailto:transami@transami.net) wrote:
> 
> “Or perhaps the truth is less interesting than the facts?”  
> Amy Weiss (accusing [theregister.co.uk](http://theregister.co.uk) of engaging in ‘tabloid journalism’)  
> Senior VP, Communications  
> Recording Industry Association of America

---

<div class="post-metadata">

**Author:** ![Ptkwt1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Ptkwt1](https://rubytalk.org/u/Ptkwt1)\
**Post date:** [12 December 2002 22:27 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/9 "2002-12-12T22:27:47Z")

</div>

In article [200212121428.46026.transami@transami.net](mailto:200212121428.46026.transami@transami.net),

> **···**
>
> Tom Sawyer [transami@transami.net](mailto: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 😉 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](http://theregister.co.uk) of engaging in ‘tabloid journalism’)  
> Senior VP, Communications  
> Recording Industry Association of America

---

<div class="post-metadata">

**Author:** ![Martin\_DeMello1](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@Martin\_DeMello1](https://rubytalk.org/u/Martin_DeMello1)\
**Post date:** [13 December 2002 00:08 UTC](https://rubytalk.org/t/rcr-replace-setup-rb-install-rb-with-builtin-module/3586/10 "2002-12-13T00:08:01Z")

</div>

AOL!

martin

> **···**
>
> Tom Sawyer [transami@transami.net](mailto: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.
