replace setup.rb/install.rb with builtin module 
Author Message
 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  



Tue, 31 May 2005 01:25:52 GMT  
 replace setup.rb/install.rb with builtin module

Quote:

>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
--
"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  



Tue, 31 May 2005 04:06:58 GMT  
 replace setup.rb/install.rb with builtin module

Quote:

> 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.



Tue, 31 May 2005 04:56:15 GMT  
 replace setup.rb/install.rb with builtin module
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


Quote:


> >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



Tue, 31 May 2005 04:59:39 GMT  
 replace setup.rb/install.rb with builtin module

Quote:


> > 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.

 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.

--
Jim Freeze
----------
Hacking's just another word for nothing left to kludge.



Tue, 31 May 2005 05:06:22 GMT  
 replace setup.rb/install.rb with builtin module

Quote:
> 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?

-transami



Tue, 31 May 2005 05:08:53 GMT  
 replace setup.rb/install.rb with builtin module


Quote:

>> 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.

Quote:
>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

--
"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  



Tue, 31 May 2005 05:38:16 GMT  
 replace setup.rb/install.rb with builtin module


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

I hope to put it up there today or tomorrow.  

InstallPkg install theyself ;-)

Quote:

>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
--
"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  



Tue, 31 May 2005 05:40:03 GMT  
 replace setup.rb/install.rb with builtin module


Quote:

>> 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 of engaging in 'tabloid journalism')
Senior VP, Communications
Recording Industry Association of America  



Tue, 31 May 2005 05:45:28 GMT  
 replace setup.rb/install.rb with builtin module

Quote:

> 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.

AOL!

martin



Tue, 31 May 2005 07:52:44 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. install.rb/setup.rb question

2. testunit-0.1.5 install failure (may be setup.rb)

3. install.rb: avoiding file name collisions (raa-install too)

4. RB QuickStart Guider from RB

5. launching an RB app from another RB app - appleevents

6. RB Entwickler gesucht / RB Developers wanted

7. RB: row order by RB database

8. protocol.rb http.rb 1.1.24

9. Bugs corrected in DBD/ODBC/ODBC.rb and DBD/Proxy/Proxy.rb

10. Replacing the Finder by an RB Application

11. Replacing HC with RB ... Where to Start

12. install.rb

 

 
Powered by phpBB® Forum Software