Installation
Install/uninstall script functions.Subcategories
- KDE - Functions for installing KDE-specific files.
- GNOME - Functions for installing GNOME-specific files.
Functions in this category
Name | Parameters |
---|---|
copyFile | [--silent] [--nobackup] [--nolog] <FILENAME-FROM> <FILENAME-TO> |
copyFiles | [--silent] [--nobackup] [--nolog] <SOURCE> [<SOURCE> ...] <DIRECTORY> |
createBootstrapScript | <BINARY> <FILENAME> [ADDITIONAL-COMMANDS] |
getIconDirs | |
getPackagePrefix | <SHORTNAME> |
installConfig | <FILENAMES> |
installData | <DIRECTORIES> |
installDesktop | |
installMimeDesktop | --no-adjust-path <DESKTOP-FILES...> |
installExe | <FILENAMES> |
installGConfSchema | <FILENAMES> |
installIcon | <SOURCES> |
installInfo | <FILENAMES> |
installLib | <LIBRARIES> |
installLocale | <DIRECTORY> |
installMan | <SECTION> <FILENAMES> |
installMenuItem | [--no-path-adjust] <CATEGORY> <FILENAMES> |
installMime | <FILENAMES> |
installPkgConfig | <FILENAMES> |
linkFile | [--silent] [--nobackup] [--nolog] <TARGET> <LINK_NAME> |
logCommand | --session <MESSAGE> |
logDir | <DIRECTORY> |
logFile | <FILENAME> |
removeGConfSchema | <FILENAME> |
removeOwningPackage | FILENAME |
setVariables | <KEY> <VALUE> ... |
updateEnv | [--append] [--check] <VARIABLE> <PATH> |
Details
copyFile | ||||||||||||||||
Syntax: copyFile [--silent] [--nobackup] [--nolog] <FILENAME-FROM> <FILENAME-TO> | ||||||||||||||||
| ||||||||||||||||
The copyFile function allows you to copy a single file to a given destination filename. It can be used when you want to rename a file while also copying it. This function creates a backup file if the destination already exists. This function can make a backup if the destination directory contains the FILENAME-TO file name. The original file will be moved to the BACKUP environment variable location. If the --silent flag is passed, no UI output will be generated. This option is primarily meant for internal usage from the other APIs. If the --nobackup flag is passed, function will not create backups. This option is primarily meant for internal usage from the other APIs. If the --nolog flag is passed, no logging output will be generated. This option is primarily meant for internal usage from the other APIs. | ||||||||||||||||
Example:
copyFile share/welcome-en.png "$PREFIX/share/welcome.png" |
copyFiles | ||||||||||||||||
Syntax: copyFiles [--silent] [--nobackup] [--nolog] <SOURCE> [<SOURCE> ...] <DIRECTORY> | ||||||||||||||||
| ||||||||||||||||
Copy one or more files to destination DIRECTORY. The filenames are logged and will be automatically removed at uninstallation. Wildcards can be used when function is called with file or directory arguments - exactly like a ls call. This function can make a backup if the destination DIRECTORY contains the SOURCE file name. The original file will be moved to the BACKUP environment variable location. If the --silent flag is passed, no UI output will be generated. This option is primarily meant for internal usage from the other APIs. If the --nobackup flag is passed, function will not create backups. This option is primarily meant for internal usage from the other APIs. If the --nolog flag is passed, no logging output will be generated. This option is primarily meant for internal usage from the other APIs. | ||||||||||||||||
Example:
copyFiles hello.txt world.txt "$PREFIX/doc" copy files to destination --> "$PREFIX/doc" copyFiles libexec/bin/*.exe "$PREFIX/libexec" copy *.exe files in directory to destination --> "$PREFIX/libexec" copyFiles libexec/bin/* "$PREFIX/libexec" copy files in directory to destination --> "$PREFIX/libexec" copyFiles libexec/bin "$PREFIX/libexec" recursive copy of directory bin to destination --> "$PREFIX/libexec/bin" |
createBootstrapScript | ||||||||||
Syntax: createBootstrapScript <BINARY> <FILENAME> [ADDITIONAL-COMMANDS] | ||||||||||
| ||||||||||
Create a bootstrap script for BINARY. A bootstrap script is a script which sets up various environment variables (such as $PATH, $LD_LIBRARY_PATH, etc.), then run BINARY. That way it ensures BINARY can actually be run. If ADDITIONAL-COMMANDS is given, it will be included in the bootstrap script. The commands in this option will be run just before BINARY is started. FILENAME will be added to the uninstall log. |
getIconDirs | ||||||
Syntax: getIconDirs | ||||||
| ||||||
Get the paths in which icons are installed to. See also: installIcon() |
getPackagePrefix | ||||||||
Syntax: getPackagePrefix <SHORTNAME> | ||||||||
| ||||||||
Returns the prefix of a previously installed package or executable.
It returns the prefix from these scenarios: Function is useful when trying to install something relative to another package or executable like plugins. |
installConfig | ||||||
Syntax: installConfig <FILENAMES> | ||||||
| ||||||
Install configuration files into appropriate directory. Do not use this function! It's severely broken in it's current state and I'm ashmed of the fact that it even exists like this. :( This function will be either removed or improved in autopackage 1.4, but for now, do not use it. |
installData | ||||||||
Syntax: installData <DIRECTORIES> | ||||||||
| ||||||||
Copy DIRECTORIES to the standard data directory ($PREFIX/share), while displaying a nice localized "Installing data files..." message while copying. | ||||||||
Example:
# The folder foobar contains: # hello.c blabla.png installData foobar # Copies 'foobar' to '$prefix/share/foobar'. # # Creates: # $prefix/share/foobar/hello.c # $prefix/share/foobar/blabla.png |
installDesktop | ||||
Syntax: installDesktop | ||||
| ||||
See also: installMenuItem() |
installMimeDesktop | ||||||||
Syntax: installMimeDesktop --no-adjust-path <DESKTOP-FILES...> | ||||||||
| ||||||||
Sometimes you want to associate a program with a particular file type, but you don't want that program to appear in the menus. This function installs a MIME type association .desktop file such that it won't appear in the menus but will still be used for file assocations. Remember to use installMime to register your MIME type.
By default, this function will change the paths in the TryExec, Exec
fields to absolute filenames by prepending "$PREFIX/bin".
For instance, "Exec=gimp" will be changed to "Exec=/home/myuser/.local/bin/gimp". If you do not want installMimeDesktop to change the paths, pass the --no-path-adjust argument. |
installExe | ||||||
Syntax: installExe <FILENAMES> | ||||||
| ||||||
Installs an executable file to $PREFIX/bin. $PATH will be automatically updated if $PREFIX/bin is not currently in it. The file will be given execution permissions. If there is already an executable with the same name in the PATH, then this function will build a bootstrap script so the program is guaranteed that when it does execute, PATH, LD_LIBRARY_PATH and MANPATH will be set correctly for that PREFIX. This function operates in terms of copyFiles(), so the notes for that function apply here also. |
installGConfSchema | ||||||
Syntax: installGConfSchema <FILENAMES> | ||||||
| ||||||
Installs given schema FILENAMES to the GConf database. | ||||||
Example:
installGConfSchema "foobar.schemas" |
installIcon | ||||||||
Syntax: installIcon <SOURCES> | ||||||||
| ||||||||
Installs an icon to appropriate directories, so that your desktop is guaranteed to be able to locate these icons for display in menus items. This function can be used in combination with installMenuItem(). You should ship and install at least a 48x48 icon in PNG format. See also: getIconDirs(), freedesktop.org Base Directory Specification and freedesktop.org Icon Theme Specification.
The directory structure of the directory passed as an argument to
installIcon() should follow the structure specified by the FreeDesktop.org Icon Specification.
The structure is | ||||||||
Example:
share/icons/hicolor `_ 48x48/apps/yourapp.png `- 16x16/apps/yourapp.png `- scaleable/apps/yourapp.svg `- 48x48/mimetypes/yourdoc.png Example: The application FooBar installs foobar.desktop, which contains this line for the icon: Icon=foobar.png The application ships share/icons/hicolor/48x48/apps/foobar.png and wants it to be used as a default icon for foobar.desktop, except if the current icon theme provides it's own icon for foobar. The following two commands will take care of everything: installIcon share/icons/hicolor installMenuItem CATEGORY foobar.desktop |
installInfo | ||||||
Syntax: installInfo <FILENAMES> | ||||||
| ||||||
Install GNU TeXinfo files. The info dirfile will be updated as necessary. |
installLib | ||||||
Syntax: installLib <LIBRARIES> | ||||||
| ||||||
Install shared libraries (.so files) to $PREFIX/lib. If the path to install to is not in the linker configuration, then it will be updated. If installing as root, /etc/ld.so.conf will be altered and ldconfig rerun. If installing as user, updateEnv will be called to ensure that the destination appears in LD_LIBRARY_PATH. If your project uses libtool, then you probably have the following files:
| ||||||
Example:
installLib lib/*.so.* |
installLocale | ||||||||
Syntax: installLocale <DIRECTORY> | ||||||||
| ||||||||
Install locale directory into standard locale directory location. | ||||||||
Example:
|
installMan | ||||||||
Syntax: installMan <SECTION> <FILENAMES> | ||||||||
| ||||||||
Install Unix manual pages. | ||||||||
Example:
|
installMenuItem | ||||||||||
Syntax: installMenuItem [--no-path-adjust] <CATEGORY> <FILENAMES> | ||||||||||
| ||||||||||
Install a menu entry (.desktop file). This function will automatically
detect GNOME and KDE and will copy the desktop entires to the proper
locations.
By default, this function will change the paths in the TryExec, Exec
fields to absolute filenames by prepending "$PREFIX/bin".
For instance, "Exec=gimp" will be changed to "Exec=/home/myuser/.local/bin/gimp". If you do not want installMenuItem to change the paths, pass the --no-path-adjust argument. The CATEGORY parameter is used for non-vFolder/menu spec desktops such as KDE 3.1 and below, and possibly in future window managers like fluxbox/icewm as well. You should probably specify a string that would fit with the pre-KDE 3.2 menus here, such as "Graphics/Vector Graphics" | ||||||||||
Example:
installMenuItem "Network/Instant Messaging" gaim.desktop |
installMime | ||||||
Syntax: installMime <FILENAMES> | ||||||
| ||||||
Install mime-info xml files into appropriate directory and runs update-mime-database. This will automatically install any KDE .desktop files that were automatically generated. Implementation is for the XDG Shared MIME Database Specification http://freedesktop.org/wiki/Standards_2fshared_2dmime_2dinfo_2dspec | ||||||
Example:
installMime share/mime/packages/foobar.xml |
installPkgConfig | ||||||||
Syntax: installPkgConfig <FILENAMES> | ||||||||
| ||||||||
Install pkgconfig files, updates prefix in file, and adds path to PKG_CONFIG_PATH if necessary | ||||||||
Example:
|
linkFile | ||||||||||||||||
Syntax: linkFile [--silent] [--nobackup] [--nolog] <TARGET> <LINK_NAME> | ||||||||||||||||
| ||||||||||||||||
Create the symbolic link LINK_NAME which points to TARGET. This link will be recorded in the uninstall log. This function is exactly like 'ln -s', except that it also adds a record to the uninstall log. If the --silent flag is passed, no UI output will be generated. This option is primarily meant for internal usage from the other APIs. If the --nobackup flag is passed, function will not create backups. This option is primarily meant for internal usage from the other APIs. If the --nolog flag is passed, no logging output will be generated. This option is primarily meant for internal usage from the other APIs. |
logCommand | ||||||||
Syntax: logCommand --session <MESSAGE> | ||||||||
| ||||||||
Add MESSAGE to the log. MESSAGE will be executed during uninstallation. |
logDir | ||||||
Syntax: logDir <DIRECTORY> | ||||||
| ||||||
Add DIRECTORY to the uninstall directory log. This directory will be automatically removed during uninstallation, if it's empty. |
logFile | ||||||
Syntax: logFile <FILENAME> | ||||||
| ||||||
Add FILENAME to the uninstall file log. This file will be automatically removed during uninstallation. |
removeGConfSchema | ||||||
Syntax: removeGConfSchema <FILENAME> | ||||||
| ||||||
Removes given schema FILENAME from the GConf database. | ||||||
Example:
removeGConfSchema /home/user/.gconf/schemas/foobar.schema |
removeOwningPackage | ||||||
Syntax: removeOwningPackage FILENAME | ||||||
| ||||||
If FILENAME exists, this function will query the systems native package manager to find out what package owns it, and it will then attempt to uninstall the given package. This is useful in prepare scripts to ensure the autopackage does not conflict with a pre-existing installation (which will cause file backups). For some programs, you may need to call removeOwningPackage more than once. This is because some distributions (eg, Debian) love to split up programs into multiple packages. The dividing line can sometimes seem arbitrary: plugins, documentation, even extra artwork or game levels can be split out. You should only remove files that would directly conflict: in other words, that exist in the prefix you are installing to. As an alternative consider making your package parallel installable with the systems copy. If a frontend is connected, this function will show the uninstalling part of the user interface. Symlinks not owned by a package will be followed recursively. | ||||||
Example:
removeOwningPackage "$PREFIX/bin/foobar" removeOwningPackage "$PREFIX/lib/libwidgets.so.0" |
setVariables | ||||
Syntax: setVariables <KEY> <VALUE> ... | ||||
| ||||
Save package variables into the environment files which will make the variables available for prep, install, and uninstall functions. |
updateEnv | ||||||||||||
Syntax: updateEnv [--append] [--check] <VARIABLE> <PATH> | ||||||||||||
| ||||||||||||
Prepends a path to an environment variable and add a command in the logfile to remove it if needed at uninstall. It will only be removed on uninstall if the directory specified by the PATH parameter is empty. The modifications to the environment variables will be saved in various shell startup scripts. If the environment variable already contains the given path, nothing is done. | ||||||||||||
Example:
updateEnv --append PATH "/path/to/my/program/bin" |