Class FPM::Package::Dir
In: lib/fpm/package/dir.rb
lib/fpm/package/dir.rb
Parent: FPM::Package

A directory package.

This class supports both input and output. As a note, ‘output’ will only emit the files, not any metadata. This is an effective way to extract another package type.

Methods

input   input   output   output  

Public Instance methods

Add a new path to this package.

A special handling of the path occurs if it includes a ’=’ symbol. You can say "source=destination" and it will copy files from that source to the given destination in the package.

This lets you take a local directory and map it to the desired location at packaging time. Such as: "./src/redis-server=/usr/local/bin" will make the local file ./src/redis-server appear as /usr/local/bin/redis-server in your package.

If the path is a directory, it is copied recursively. The behavior of the copying is modified by the :chdir and :prefix attributes.

If :prefix is set, the destination path is prefixed with that value. If :chdir is set, the current directory is changed to that value during the copy.

Example: Copy /etc/X11 into this package as /opt/xorg/X11:

    package.attributes[:prefix] = "/opt/xorg"
    package.attributes[:chdir] = "/etc"
    package.input("X11")

Add a new path to this package.

A special handling of the path occurs if it includes a ’=’ symbol. You can say "source=destination" and it will copy files from that source to the given destination in the package.

This lets you take a local directory and map it to the desired location at packaging time. Such as: "./src/redis-server=/usr/local/bin" will make the local file ./src/redis-server appear as /usr/local/bin/redis-server in your package.

If the path is a directory, it is copied recursively. The behavior of the copying is modified by the :chdir and :prefix attributes.

If :prefix is set, the destination path is prefixed with that value. If :chdir is set, the current directory is changed to that value during the copy.

Example: Copy /etc/X11 into this package as /opt/xorg/X11:

    package.attributes[:prefix] = "/opt/xorg"
    package.attributes[:chdir] = "/etc"
    package.input("X11")

Output this package to the given directory.

Output this package to the given directory.

[Validate]