Cheers for the reply,
I don't seem to have access to the 'path_to' function in the constructor
of the task ( undefined method `_' for
#<Buildr::PackageRPMTask:0x3717ee94> )
I see in your code you've done:
root = File.join("target", "_#{File.basename(name)}")
If you have subprojects will using "target" directly like that work ?
I thought that was the idea of the path_to function,
Thanks again,
Danny.
Antoine Toulme wrote:
You mean you want to use the target directory of the project.
How about _(:target, :rpm)
and then:
_(:target, :rpm, :top_dir)
_(:target, :rpm, :build_root)
See also:
http://github.com/intalio/package_as_deb/blob/master/lib/buildrdeb/package.rb
which implements a different strategy, using the name of the task so that
you can have more than one deb packaging per project:
root = File.join("target", "_#{File.basename(name)}")
mkpath File.join(root, "DEBIAN")
Thanks,
Antoine
On Wed, Jan 27, 2010 at 03:31, Danny O'Connor <[email protected]>wrote:
Hi There,
I'm doing an rpm packaging extension,
I'm running into a problem defining the 'top dir' and 'build dir' for the
rpm, at the moment I have:
module Buildr
class PackageRPMTask < ArchiveTask
def initialize(root, path)
@temp_working_dir = File.join(Dir.tmpdir(), "buildr.#{$$}")
@rpm_top_dir = "#...@temp_working_dir}/buildr/rpm_top_dir"
@rpm_build_root = "#...@temp_working_dir}/buildr/rpm_build_root"
@target = "noarch"
super
end
Instead of using a temporary directory though, it might be nicer to use a
folder in the 'bin' directory of the local build workspace.
Does anybody know the best way to get access to it in the task definition ?
I've attached the source of what I have so far, it works at the moment, you
can use it like any other archive packaging format:
package(:rpm).with(:spec => RPM_SPEC_STRING)
package(:rpm).include("etc/myserviceinitd", :as =>
"/etc/init.d/myservicectl") .. etc.
Thanks,
Danny.