Cygport Reference Manual

### TABLE OF CONTENTS

- Installing

- dodir
- keepdir
- dobin
- newbin
- docinto
- dodoc
- newdoc
- exeinto
- doexe
- newexe
- insinto
- doins
- newins
- doicon
- newicon
- includeinto
- doinclude
- dolib
- newlib
- doinfo
- doman
- newman
- domenu
- newmenu
- dopkgconfig
- dosbin
- newsbin
- dosym
- dotool
- doenv
- make_autostart_entry
- make_desktop_entry
- make_etc_defaults
- update_etc_shells
- cyginstall

- USE_DESTDIR

- src_install

## Installing

[ Top ] [ Chapter 10 ] [ Concepts ]

NOTE

In the context of cygport, "installing" always means into the DESTDIR $D. However, the syntax of the convenience functions is as if one were installing to the system.

## dodir

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dodir DIRECTORY [DIRECTORY] ...

DESCRIPTION

Creates the given directories under $D.

## keepdir

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      keepdir DIRECTORY [DIRECTORY] ...

DESCRIPTION

Preserves the given empty directories under $D from being removed during automatic postinstall steps.

SEE ALSO

KEEPDIRS

## dobin

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dobin FILE [FILE] ...

DESCRIPTION

Installs the given file(s) to the standard bindir and makes them executable.

## newbin

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newbin FILE NEW_NAME

DESCRIPTION

Installs the given file to the standard bindir with the given new name, and makes it executable.

## docinto

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      docinto [/]SUBDIRECTORY

DESCRIPTION

Sets the subdirectory into which dodoc and newdoc should install. If the subdirectory is prefixed by a slash, then dodoc and newdoc will use /usr/share/doc/SUBDIRECTORY/; if not, they will use /usr/share/doc/PN/SUBDIRECTORY/.

## dodoc

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dodoc FILE [FILE] ...

DESCRIPTION

Installs the given files or directories into $D/usr/share/doc/PN/, or a subdirectory thereof specified by the previous call to docinto.

## newdoc

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newdoc FILE NEW_NAME

DESCRIPTION

Installs the given file into $D/usr/share/doc/PN/, or a subdirectory thereof specified by the previous call to docinto, with the given new name.

## exeinto

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      exeinto DIRECTORY

DESCRIPTION

Specifies the directory under $D into which doexe and newexe will install.

## doexe

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doexe FILE [FILE] ...

DESCRIPTION

Installs the given file(s) into the directory under $D specified by the preceding call to exeinto and makes them executable.

## newexe

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newexe FILE NEW_NAME

DESCRIPTION

Installs the given file into the directory under $D specified by the preceding call to exeinto, renaming it as indicated, and makes it executable.

## insinto

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      insinto DIRECTORY

DESCRIPTION

Specifies the directory under $D into which doins and newins will install.

## doins

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doins FILE [FILE] ...

DESCRIPTION

Installs the given file(s) into the directory under $D specified by the preceding call to insinto. Files are made not executable.

## newins

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newins FILE NEW_NAME

DESCRIPTION

Installs the given file into the directory under $D specified by the preceding call to insinto, renaming it as indicated. Files are made not executable.

## doicon

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doicon FILE [FILE] ...

DESCRIPTION

Installs the given image file(s) into the legacy icon directory.

NOTES

- Supported icon formats are PNG, XPM, and SVG.
- This location is intended for packages shipping a single icon. If the same PNG icon is available in different sizes, with or without a corresponding SVG, then these icons should be installed into the Hicolor Icon Theme hierarchy.

## newicon

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newicon FILE NEW_NAME

DESCRIPTION

Installs the given image file into the legacy icon directory, renaming it as indicated.

NOTE

Supported icon formats are PNG, XPM, and SVG.

## includeinto

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      includeinto SUBDIRECTORY

DESCRIPTION

Sets the subdirectory of the standard includedir into which doinclude should install.

## doinclude

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doinclude HEADER [HEADER] ...

DESCRIPTION

Installs the given headers into the standard includedir, or the subdirectory thereof specified by a previous call to includeinto.

## dolib

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dolib LIBRARY [LIBRARY] ...

DESCRIPTION

Installs the given libtool, static, or import libraries into the standard libdir.

NOTES

- Library DLLs must be installed with dobin.
- Cross-compiled ELF Shared Objects must be installed with doelflib.

## newlib

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newlib LIBRARY NEW_NAME

DESCRIPTION

Installs the given static or import library into the standard libdir, renaming it as indicated.

NOTES

- Library DLLs must be installed with dobin.
- Libtool libraries must be installed with dolib.

## doinfo

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doinfo FILE [FILE] ...

DESCRIPTION

Installs the given Info documentation file(s) into the standard infodir.

## doman

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doman [[-l |--lang=]LANGUAGE] MANPAGE [MANPAGE] ...

DESCRIPTION

Installs the given manpage(s) into the appropriate subdirectory of the standard mandir. Localized manpages can be installed by specifing the --lang (-l) argument, otherwise manpages are assumed to be in English.

## newman

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newman [[-l |--lang=]LANGUAGE] MANPAGE NEW_NAME

DESCRIPTION

Installs the given manpage into the appropriate subdirectory of the standard mandir with the given new name. Localized manpages can be installed by specifing the --lang (-l) argument, otherwise manpages are assumed to be in English.

## domenu

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      domenu DESKTOP_MENU [DESKTOP_MENU] ...

DESCRIPTION

Installs the given desktop menu entries (.desktop).

## newmenu

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newmenu DESKTOP_MENU NEW_NAME

DESCRIPTION

Installs the given desktop menu entry (.desktop) with the given new name.

## dopkgconfig

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dopkgconfig PC_FILE [PC_FILE] ...

DESCRIPTION

Installs the given pkg-config metadata files.

## dosbin

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dosbin FILE [FILE] ...

DESCRIPTION

Installs the given file(s) to the standard sbindir and makes them executable.

## newsbin

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      newsbin FILE NEW_NAME

DESCRIPTION

Installs the given file to the standard sbindir with the given new name, and makes it executable.

## dosym

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dosym TARGET [TARGET] ... DESTINATION

DESCRIPTION

Creates symlinks from the given target(s) to the given destination. The destination must be a directory if more than one target is given. Both relative and absolute targets are supported; relative targets must be given in relation to the destination.

NOTE

The destination directory must exist under $D before dosym is called, therefore a preceding call to dodir may be necessary.

## dotool

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      dotool FILE [FILE] ...

DESCRIPTION

Installs the given compiler tool(s) into the target-specific bindir and a target-prefixed version into the native bindir.

## doenv

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      doenv VARIABLE VALUE

DESCRIPTION

Creates profile.d scripts which set the given environment variable.

NOTE

If VALUE includes a reference to a variable which is meant to be expanded at runtime, then be sure to escape the leading dollar-sign and, for portability, do not use braces; for example:

        doenv PATH \$PATH:/foo/bar

## make_autostart_entry

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      make_autostart_entry COMMAND NAME [ADDITIONAL_FIELDS]

DESCRIPTION

Creates an autostart entry for desktop applications as follows:

- COMMAND: the command line. May contain arguments, in which case the entire command must be quoted.
- NAME: the application name to be shown in autostart configuration menus.
- ADDITIONAL_FIELDS: (optional) additional menu entry fields per the Desktop Entry Specification and the Desktop Application Autostart Specification.

## make_desktop_entry

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      make_desktop_entry COMMAND NAME [ICON] [CATEGORIES] [COMMENT] [ADDITIONAL_FIELDS]

DESCRIPTION

Creates a desktop menu entry for GUI applications as follows:

- COMMAND: the command line. May contain arguments, in which case the entire command must be quoted.
- NAME: the application name to be shown in the menu.
- ICON: (optional) the icon name, excluding the file extension.
- CATEGORIES: (optional) a semicolon-separated list of categories and subcategories per the Desktop Menu Specification.
- COMMENT: (optional) description of the program
- ADDITIONAL_FIELDS: (optional) additional menu entry fields per the Desktop Entry Specification.

NOTES

- In order to skip an optional argument but provide a later one, an empty string ("") must be provided as a placeholder for the optional argument.
- In most cases, ICON and CATEGORIES should be provided.

## make_etc_defaults

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      make_etc_defaults FILE_PATH [FILE_PATH] ...

DESCRIPTION

Indicates that the given file(s) or directory/ies under $D contain templates for system-configurable files. make_etc_defaults moves these files/directories to a special location, creates a postinstall script to install each file to the correct location if it doesn't already exist, and a preremove script which removes the file if still unchanged.

## update_etc_shells

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      update_etc_shells PATH_TO_SHELL [PATH_TO_SHELL] ...

DESCRIPTION

Indicates that the given fully-qualified path(s) are shells which should be listed in /etc/shells. update_etc_shells creates a postinstall script to add this listing if it doesn't already exist, and a preremove script which removes it when uninstalling.

NOTES

- Only one of the /bin or /usr/bin paths should be specified for any given shell; the other will be added automatically.
- Generic aliases should be listed as well, e.g. tcsh would use update_etc_shells /bin/tcsh /bin/csh
- Shells which are part of the Base install (namely, bash/sh and dash/ash) should not use this function, as they are already included in the default /etc/shells.

## cyginstall

[ Top ] [ Installing ] [ Install Functions ]

SYNOPSIS

      cyginstall [OPTIONS]

DESCRIPTION

Runs 'make install' (or 'make install/fast' in CMake packages) with the necessary arguments to install into $D, based on the value of USE_DESTDIR.

## USE_DESTDIR

[ Top ] [ cyginstall ] [ Variables ]

DESCRIPTION

Set to 1 (the default) if 'make install' supports the DESTDIR variable, or 0 if not, in which case the value of prefix and the standard *dir variables will be overriden with $D-prefixed values.

## src_install

[ Top ] [ Installing ] [ Install Functions ]

DESCRIPTION

This function must be defined in the .cygport file, or in inherit()ed cygclasses, containing all steps necessary to install the package into $D and prepare it for packaging.

The default src_install function is shown below. Several cygclasses provide their own src_install overrides.

DEFINITION

    src_install() {
            cd ${B}
            cyginstall
    }