= Packaging with rpa-base bla bla why do so, the old idea of letting upstream developers hack their sw. while we work on the packages, etc... = Overall process When installing a port, rpa-base performs the following: * download the port sources (.rps) and unpack on a temp dir * run their install.rb: * run a number of tasks, specified in terms of "helpers" in the install.rb; there a default lists of tasks to be done for different sort of packages (pure Ruby lib, application, etc). * In the process, files are installed to a temporary dir; then a binary package (.rpa) is generated by packing those files together with the associated metadata (description, requirements, digests, file lists, etc) ==> at this point, there's a .rpa package for the port we want to install * unpack the .rpa package. This is done atomically, by taking a snapshot of the previous package state (i.e. we repackage the corresponding files in our FS) and rolling back if something goes wrong. Conflicts with unmanaged files are detected and handled gracefully. = Overview of a rpafied install.rb Let's look at the install.rb for types: require 'rpa/install' class Install_types < RPA::Install::PureRubyLibrary name "types" version "0.1.80-1" classification Library.Development description < [, "dest subdir name"] for instance installdocs "htmldocs", "html" would copy the docs under "htmldocs" to share/doc/rpax.y/doc/portname/html The following is very common: installdocs %[README ChangeLog] this will copy the files given in the array to the default docdir. The installwhatever helpers have different default source and dest. dirs. Some examples: installexamples examples/ ==> examples/ under docdir installdocs doc/ ==> doc dir installtests test/ ==> lib/ruby/rpa0.0/tests/portname installextensions .so's in ext/* ==> appropriate place ;) installmodules lib/ ==> lib/ruby/site_ruby and RPA's private area in lib/ruby/rpax.y installexecutables bin/ ==> bin/ installdata data/ ==> share/data/portname/ == Replacing default tasks The first time you do use a helper, it will override the default one if it was already in the list. == Ordering of the tasks The default list of tasks defines also a default ordering. For instance, in FullInstaller buildextensions will always be run before installextensions (anything else would make no sense). If the task you're adding wasn't originally in the default list, it will be placed at the end of the current phase (be careful). == Arbitrary tasks There's a generic task helper. You pass it a block which will be run. Those tasks will be added at the end of the phase they're defined in. Example from ri-rpa's install.rb build do task do dest = File.join("rpa", @dest, "share", "ri-rpa") @fileops.mkdir_p dest, :mode => 0755 @fileops.cp_r "data", dest Find.find(dest) do |d| @fileops.rm_rf d if d =~ /.svn/ end end end note that this wouldn't be needed now, cause there's a installdata helper, so just installdata would do the trick.