 ;
    for local src-path in $(src-files-actual)
    {
        local dst-file = $(dst-files-queue[1]) ;
        dst-files-queue = $(dst-files-queue[2-]) ;
        DEPENDS $(dst-file) : $(src-path) $(dst-file:D) ;
        .mkdir $(dst-file:D) ;

        [COPY] $(dst-file) : $(src-path) ;
        .clean $(dst-file) ;
    }

    [PACK] $(pack) : $(dst-files) ;
    .clean $(pack) ;
}

# RPM distro file.
rpm-tool = [ GLOB $(PATH) : "rpmbuild" ] ;
rpm-tool ?= [ GLOB $(PATH) : "rpm" ] ;
rpm-tool = $(rpm-tool[1]) ;
rule .rpm ( name : source )
{
    local rpm-arch ;
    switch $(OSPLAT)
    {
        case X86       : rpm-arch ?= i386 ;
        case PPC       : rpm-arch ?= ppc ;
        case AXP       : rpm-arch ?= alpha ;
        # no guaranty for these:
        case IA64      : rpm-arch ?= ia64 ;
        case ARM       : rpm-arch ?= arm ;
        case SPARC     : rpm-arch ?= sparc ;
        case *         : rpm-arch ?= other ;
    }
    local target = $(name)-rpm ;
    NOTFILE $(target) ;
    DEPENDS dist : $(target) ;
    DEPENDS $(target) : $(name).$(rpm-arch).rpm $(name).src.rpm ;
    DEPENDS $(name).$(rpm-arch).rpm : $(source) ;
    DEPENDS $(name).src.rpm : $(name).$(rpm-arch).rpm ;
    docs on $(target) = $(dist.docs:J=" ") ;
    arch on $(target) = $(rpm-arch) ;
    if $(rpm-arch) = ppc { target-opt on $(target) = --target= ; }
    else { target-opt on $(target) = "--target " ; }
    [RPM] $(target) : $(source) ;
    .clean $(name).$(rpm-arch).rpm $(name).src.rpm ;
}
actions [RPM] {
    set -e
    export BOOST_JAM_TOOLSET="$(toolset)"
    $(rpm-tool) -ta $(target-opt)$(arch) $(>) | tee rpm.out
    cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` .
    rm -f rpm.out
}

# The distribution targets. Do not bother with them unless this is a
# distribution build.
if dist in $(ARGV)
{
    #~ .binary bjam ;
    .package $(NAME)-$(VERSION) : $(dist.source) ;
    .package $(NAME)-$(VERSION)-$(RELEASE)-$(platform) : $(dist.bin) ;
    if $(rpm-tool)
    {
        #~ .rpm $(NAME)-$(VERSION)-$(RELEASE) : $(NAME)-$(VERSION).t