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:
- no more copying install.rb over into your package dir.
- it encourages the package creator to list dependencies and versions
(though it might also be possible to figure these out automatically) - the install.rb takes care of installing dependencies (via
raa-install) which keeps raa-install simple and it’s purpose clear
(separation of responsibilities). - 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