other countries. Other names may be trademarks of t heir respective owners.
The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse
engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Symantec
Corporation and its licensors, if any.
THE DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
DISCLAIMED, EXCEPT TO THE E XTENT THAT SUCH DISCLAIMERS ARE HELD T O BE LEGALLY INV ALID . SYMANTE C CORPORATION SHALL NOT
BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS
DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE.
The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to
restricted rights as defined in FAR Section 52.227-19 “Commercial Computer Software - Restricted Rights” and DFARS 227.7202, “Rights in
Commercial Computer Software or Commercial Computer Software Documentation”, as applicable, and any successor regulations. Any use,
modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government
shall be solely in accordance with the terms of this Agreement.
Symantec Corporation
350 Ellis Street
Mountain View, CA 94043
http://www.symantec.com
Linux Package Editor Reference2
Technical Support
Symantec Technical Support maintains support centers globally. Technical Support’s
primary role is to respond to specific queries about product features and functionality.
The Technical Support group also creates content for our online Knowledge Base. The
Technical Support group works collaboratively with the other functional areas within
Symantec to answer your questions in a timely fashion. For example, the Technical
Support group works with Product Engineering and Symantec Security Response to
provide alerting services and virus definition updates.
Symantec’s maintenance offerings include the following:
zA range of support options that give you the flexibility to select the right amount of
service for any size organization
zTelephone and Web-based support that provides rapid response and up-to-the-
minute information
zUpgrade assurance that delivers automatic software upgrade protection
zAdvanced features, including Account Management Services
For information about Symantec’s Maintenance Programs, you can visit our Web site at
the following URL:
www.symantec.com/techsupp/
Contacting Technical Support
Customers with a current maintenance agreement may access Technical Support
information at the following URL:
www.symantec.com/techsupp/
Before contacting Technical Support, make sure you have satisfied the system
requirements that are listed in your product documentation. Also, you should be at the
computer on which the problem occurred, in case it is necessary to replicate the
problem.
When you contact Technical Support, please have the following information available:
zProduct release level
zHardware information
zAvailable memory, disk space, and NIC information
zOperating system
zVersion and patch level
zNetwork topology
zRouter, gateway, and IP address informa tion
zProblem description:
Error messages and log files
Troubleshooting that was performed before contacting Symantec
Recent software configuration changes and network changes
Linux Package Editor Reference3
Licensing and registration
If your Symantec product requires registration or a license key, access our technical
support Web page at the following URL:
www.symantec.com/techsupp/
Customer service
Customer service information is available at the following URL:
www.symantec.com/techsupp/
Customer Service is available to assist with the following types of issues:
zQuestions regarding product licensing or serialization
zProduct registration updates, such as address or name changes
zGeneral product information (features, language availability, local dealers)
zLatest information about product updates and upgrades
zInformation about upgrade assurance and maintenance contracts
zInformation about the Symantec Buying Programs
zAdvice about Symantec’s technical support options
zNontechnical presales questions
zIssues that are related to CD-ROMs or manuals
Maintenance agreement resources
If you want to contact Symantec regarding an existing maintenance agreement, please
contact the maintenance agreement administration team for your region as follows:
Asia-Pacific and Japancustomercare_apac@symantec.com
Europe, Middle-East, and Africasemea@symantec.com
North America and Latin Americasupportsolutions@symantec.com
Additional enterprise services
Symantec offers a comprehensive set of services that allow you to maximize your
investment in Symantec products and to develop your knowledge, expertise, and global
insight, which enable you to manage your business risks proactively.
Enterprise services that are available include the following:
Symantec Early
Warning Solutions
Managed Security
Services
These solutions provide early warning of cyber attacks,
comprehensive threat analysis, and countermeasures to prevent
attacks before they occur.
These services remove the burden of managing and monitoring
security devices and events, ensuring rapid response to real
threats.
Linux Package Editor Reference4
Consulting
Services
Educational
Services
To access more information about Enterprise services, please visit our Web site at the
following URL:
www.symantec.com
Select your country or language from the site index.
Symantec Consulting Services provide on-site technical
expertise from Symantec and its trusted partners. Symantec
Consulting Services offer a variety of prepackaged and
customizable options that include assessment, design,
implementation, monitoring, and management capabilities. Each
is focused on establishing and maintaining the integrity and
availability of your IT resources.
Educational Services provide a full array of technical training,
security education, security certification, and awareness
communication programs.
zAbout Linux Package Editor on page 8
zStarting Linux Package Editor on page 10
zConventions for Naming Linux Shell Variables on page 10
zProduct Documentation on page 11
About Linux Package Editor
Many system administrators in a primarily Windows environment must also support
Linux computers, typically servers. Supporting installations on Linux computers pres ents
some of the same consistency, standardization, and customization challenges as on
Windows computers.
Linux Package Editor lets you use a Windows computer to create packages that install
software on Linux computers. Using an interface that is similar to that in other Wise
installation development products, you can easily create Linux packages without having
an in-depth knowledge of Linux commands.
With Linux Package Editor, you can either import an RPM file or Linux archive file, or
build an RPM from binary application files. Then you can edit the installation and add
scripts to provide additional functionality during the RPM installation.
About RPM
Linux Package Editor does not build or use a spec file or a source RPM, which typically
are used to create RPM packages. Instead, you specify source files and installation
actions in a Linux project file (.LPR). When you compi le the Linux project, Linux P ackage
Editor creates the RPM file and embeds it into a shell file (.SH), which acts as a
“wrapper” to the RPM and contains any additional scripts that you have written.
The functionality of Linux packages is provided by standard Linux commands. Many
resources for learning about Linux commands are available on the Internet.
Linux Package Editor is a tool in the Professional Edition of Wise Package Studio.
Linux Package Editor supports the following versions of Red Hat Linux:
zRed Hat Enterprise Linux 2.1
zRed Hat Enterprise Linux 3
zRed Hat Enterprise Linux 4
zRed Hat Linux 7.2, 7.3, 8.0, 9.0
Red Hat Package Manager (RPM) is a command line-driven package management
system capable of installing, uninstalling, verifying, querying, and updating computer
Linux Package Editor Reference8
software packages. A package consists of an archive of files along with information
about the package, including name, version, and description.
Information about all installed packages and the files that they create or change is
stored in the RPM database on the Linux computer. RPM contains a powerf ul set of query
capabilities to obtain information about packages, such as the files that make up a
package, what files are installed, and which files are configuration or documentation
files.
An RPM file is a package file that contains software that will be installed using RPM.
About the Shell File
The Linux project file (.LPR) compiles to a shell file (.SH), which acts as a “wrapper” to
the RPM and provides additional functionality.
Following is a representation of the compiled shell file.
Initialization section
Extracts the RPM file
Extracts the contents of $WISEFOLDER
Pre-RPM script
RPM command
Introduction to Linux Package Editor
rpm -U with additional command-line options that
are defined in the package
Results handling information for:
installation log (used for reporting)
Binary RPM file ...
This is visible in the shell file, but as indecipherable
binary code.
At run time, the RPM is extracted from the shell
file.
Warning
Only create the shell file by using the Build Installation Package command. Editing the
shell file manually will cause the installation to fail.
See also:
Building a Linux Installation Package on page 16
About the $WISEFOLDER Directory on page 26
Linux Package Editor Reference9
Starting Linux Package Editor
The first time you open Linux Package Editor, no project is open, so you cannot edit any
pages. Once you create one or more new projects, Linux Package Editor always opens
the last opened project at startup.
To start Linux Package Editor
1. In Wise Package Studio, do one of the following:
On the Projects tab, click the Run link to the right of the task or tool associated
with Linux Package Editor.
On the Tools tab, double-click Linux Package Editor.
The Enter the New Linux Project Name dialog box appears.
2. Enter a project name, following standard Windows file and folder naming
conventions.
3. Click OK.
The project is created in the project folder, which is defined in Tools menu >
Options. It has the extension .LPR.
4. Edit the new installation in Installation Expert.
Introduction to Linux Package Editor
See The Installation Expert Window on page 22.
Conventions for Naming Linux Shell Variables
You can use variables in several areas of Linux Package Editor. When you do, follow
standard conventions for naming Linux shell variables.
Variable names:
zMust begin with a letter or an underscore (_).
zMust contain alphanumeric or underscore characters.
zCannot contain special characters or embedded spaces.
zAre case-sensitive.
zCannot be a reserved word. A reserved word is one that is already understood by
Bash. For a list of reserved words, see the Linux or Bash documentation.
Using a Variable
Place a $ before the variable name. Example:
rm -f $INSTALL_LOG_NAME
Assigning a Value to a Variable
Use the format variable_name=value. Do not include spaces before or after the = sign.
Example:
INSTALLDIR=/
For information about shell variables, see the Linux documentation.
Linux Package Editor Reference10
Product Documentation
This documentation assumes that you are proficient in the use of the Windows operating
system. If you need help using the operating system, consult its user documentation.
Use the following sources of information to learn about this product.
Online Help
The online help contains detailed technical information and step-by-step instructions for
performing common tasks.
Access help in the following ways:
zTo display context-sensitive help for the active window or dialog box, press F1.
zTo select a help topic from a table of contents, index, or search, select Help menu >
Help Topics.
Reference Manual
All the material in the online help is also available in a .PDF-format reference manual,
which you can access by selecting Help menu > Re ference Manual.
Introduction to Linux Package Editor
Getting Started Guide
The Getting Started Guide contains system requirements and installation instructions.
You can access a .PDF version of the Getting Started Guide from the Windows Start
menu.
Release Notes
The product release notes cover new features, enhancements, bug fixes, and known
issues for the current version of this product. T o access the release not es, select Release
Notes from the Symantec program group on the Windows Start menu.
Linux Package Editor Reference11
Chapter 2
Setting Up Linux Package Editor
This chapter includes the following topics:
zRequirements for setting up Linux Package Editor on page 12
zSetting Options on page 12
zLinux Environment Settings on page 13
zBrowsing the Linux File System on page 15
Requirements for setting up Linux Package Editor
Before you use Linux Package Editor to create RPM packages:
zSet global options.
See Setting Options.
z(Optional.) Set up a Linux proxy so you can check the syntax of a package’s shell
script with the Linux computer’s interpreter.
See Setting Up an SSH Linux Proxy on page 13.
zEdit default lists that appear throughout the Linux Package Editor.
See Editing the Default User, Group, Package, and Package Group Lists on page 14.
zCustomize the display of the Linux file system throughout the Linux Package Editor
to match your Linux environment.
See Browsing the Linux File System on page 15.
Setting Options
You can set global options that apply to all packages that y ou create with Linux P ack age
Editor.
Set the following options on the Options dialog box, which you access by s electing Tools
menu > Options.
zProject Directory
Specify the default directory in which to store new installation projects. This defaults
to the Projects\LinuxProjectFolder subdirectory of the Wise Package Studio share
point directory.
zText Editor
Specify a text editor executable file. (Example: notepad.exe.) This determines the
text editor that is used to open the session log file, as well as any file in the
installation that you right-click on the Files page.
zAdd extended debug messages in the log file
Mark this to add highly technical debug entries to the session log
(WiseForLinux.log), which records all activity that occurs in Linux Package Editor
during the current session. These entries are provided for technical support
diagnostic purposes; they do not appear when you view the session log.
Linux Package Editor Reference12
The session log is different from the RPM log file, which logs events during RPM
installation.
See Viewing the Session Log and Warnings on page 17.
Linux Environment Settings
The Linux Environment Settings dialog box, which you access by selecting Tools menu >
Linux Environment Settings, lets you:
zSet up a Linux proxy computer.
See Setting Up an SSH Linux Proxy.
zEdit default lists that appear throughout the Linux Package Editor.
See Editing the Default User, Group, Package, and Package Group Lists on page 14.
zCustomize the display of the Linux file system throughout the Linux Package Editor
to match your Linux environment.
See Browsing the Linux File System on page 15.
Setting Up an SSH Linux Proxy
Setting Up Linux Package Editor
Setting up a Linux proxy on your Windows computer lets you check the syntax of a
package’s shell script with the Linux computer’ s interpreter, and obtain archive files from
the Linux computer.
Requirements
zA Windows SSH client.
zThe Linux computer must run SSH.
To set up a Linux proxy
1. Set up SSH on your Windows and Linux computers.
a. Install a third-party SSH client tool on the Windows computer.
b. On the Environment Variables dialog box in Windows, add the installation
directory for the SSH client tool in the PATH environment variable. To access
this dialog box:
Select Start > Control Panel> System.
Click the Advanced tab.
Click the Environment Variables button.
c.Use the SSH client tool to connect to the Linux computer.
2. In Linux Package Editor, select Tools menu > Linux Environment Settings.
The Linux Environment Settings dialog box appears.
3. Complete the top portion of the dialog box:
Mark Enable proxy machine for script and package validation.
Machine Address or Name
Linux Package Editor Reference13
Enter the name or address of the Linux computer on your network. The format
should be linux.company.com or 0.0.0.0.
Setting Up Linux Package Editor
Username
Enter the user name that you use to log on to the Linux computer.
SSH Password
Enter an SSH password here and then re-enter it in Verify Password.
4. Click Test to test the connection.
A message indicates whether the connection was successful.
5. Click OK on the Linux Environment Settings dialog box.
See also:
Checking the Syntax of a Script on page 19
Editing the Default User, Group, Package, and Package Group Lists
In several areas of Linux Package Editor, you can sel ect from lists of Linux users, groups,
packages, and package groups. (Example: On the File Details dialog box, you can set
the File Owner and File Group.) The defaults for these lists were obtained from a
standard Red Hat Linux system, and are visible on the Linux Environment Settings
dialog box. You can customize these lists to match your Linux environment by adding
individual items or importing a list of items from a Linux computer.
Changes that you make on the Linux Environment Settings dialog box are global, which
means that they appear in all projects that you subsequently open.
To add a user, group, package, or package group
1. Check a Linux computer for the details of the user, group, package, or package
group that you will add. You need the correct name and the ID, if applicable, as it
appears on the Linux computer.
2. Select Tools menu > Linux Environment Settings.
3. Click Add Item.
The Edit Linux Configuration Item dialog box appears.
4. Complete the dialog box and click OK:
Name
Enter the name of the i tem to add.
ID
Enter the name of the Linux user or group to add. This field is not applicable if
you select the Package or Package Group option below.
User, Group, Package, Package Group
Select the type of item to add.
5. Click OK.
The item you added appears in the appropriate list box on the Linux Environment
Settings dialog box. Initially, the item appears at the end of the list, but you can
click the column heading to re-sort the list.
To import users, groups, or package groups
When you import a file, it overwrites the existing list.
Linux Package Editor Reference14
1. Obtain a text file containing users, groups, or package groups from a Linux
computer and place the file in a directory that your development computer can
access. (The user file is named passwd.)
2. Select Tools menu > Linux Environment Settings.
3. Click Import File and select a type of file to import from the button menu.
4. On the Select Linux File dialog box, find and open a Linux user, group, or package
group file.
Browsing the Linux File System
In several areas of Linux Package Editor, you can open the Browse Linux File System
dialog box and select a directory from a typical Linux file system. The file system that is
displayed was obtained from a standard Red Hat Linux system. You can customize the
display to match your Linux environment.
Installation directories that you add on the Files page are not visible in the Browse Linu x
File system dialog box.
To access the Browse Linux File System dialog box:
Do either of the following:
Setting Up Linux Package Editor
zClick the Browse button () at any entry field that requires a Linux directory path.
zSelect Tools menu > Linux Environment Settings and click Edit Linux File System.
Tasks You Can Perform on the Browse Linux File System Dialog Box
zT o select a directory for the current project, select it from the directory tree or enter
its name in the Selected File or Directory field.
zTo add a directory, select a parent directory in the list box, click Add Directory, and
enter the new directory name. The new directory is added at the end of the
directory tree, but the tree will be re-sorted the next time you display the Browse
Linux File System dialog box.
zTo delete a directory, select it and click Delete Directory.
zTo toggle between using a single or double-click to select items in the list box, mark
or clear Single-click to Select.
Linux Package Editor Reference15
Chapter 3
Managing Linux Packages
This chapter includes the following topics:
zBuilding a Linux Installation Package on page 16
zViewing the Session Log and Warnings on page 17
zTesting With Preflight Packages on page 18
zChecking the Syntax of a Script on page 19
zLinux Package Editor Reports on page 19
zBuilding a Linux Archive File on page 20
Building a Linux Installation Package
The Linux project file (.LPR) compiles to a shell file (.SH), which acts as a “wrapper” to
the RPM and provides additional functionality.
See About the Shell File on page 9.
Requirements for Building a Package
The project must contain the following information:
zGeneral Information page: Name field
zGeneral Information page: Summary field
zVersion page: Version field
zVersion page: Release field
zPlatforms page: at least one platform must be added
zFiles page: at least one file must be added
The name, version, release, and platform are combined to form the RPM name.
Example: If Name is SampleApp, Version is 1.2, Release is 3, and the platform is
i386, then the RPM name is SampleApp-1.2-3.i386.rpm.
To build a Linux package
1. Click Build, or select Tools menu > Build Installation Package.
The Build Installation Package dialog box appears.
2. Complete the dialog box:
Select Platform
Select a platform from this list, which contains the platforms that are specified
in Installation Expert > Platforms page. Files that have the platform you select
here will be included in the package that is built. Y ou specify a platform for each
file on the File Details dialog box.
See Completing the File Details Dialog on page 28.
Linux Package Editor Reference16
Managing Linux Packages
File Name
Specify the path and file name of the package file to be built. The default is the
project name with the extension .sh. If you override the default, be sure to
include the extension or a build error will occur.
Compiler Variables
Any compiler variables that are specified on the Compiler V ariables page appear
in this list. Double-click a compiler variable to change it for this build only.
See Setting Compiler Variables on page 40.
Build a Preflight Package
Mark this to build a special version of the package that runs the logic and
checks conditions of the installation but does not install any files on the Linux
computer.
See Testing With Preflight Packages on page 18.
3. Click OK.
If the build was successful, a message confirms that the package was created.
Otherwise an error message appears, telling you to check the log file for details. To
check the log file, click the Warnings button at the lower right of the Linux Package
Editor window.
Viewing the Session Log and Warnings
When you experience problems with a package, you can view the session log and the
warnings to determine the cause of the problems.
Session Log
The session log (WiseForLinux.log) records all activity that occurs in Linux Package
Editor during the current session. Therefore, it contains entries for both the current
project and any other projects you opened during the current session. Entries are
categorized as log entries, messages, and warnings.
To view the session log, select File menu > View Session Log File.
Warnings
Warnings are a subset of the session log. When warnings exist, the text on the W arni ngs
button is red.
To view warnings, click the Warnings button at the lower right of the Linux Package
Editor window.
The Warnings dialog box contains entries for both the current project and any other
projects you opened during the current session. To clear the Warnings dialog box, click
Clear Warnings.
See also:
Setting Options on page 12
Linux Package Editor Reference17
Testing With Preflight Packages
The preflight capability in Linux Package Editor helps you determine whether a package
will succeed or fail by testing it in your production environment before deployment.
Preflight packages can perform environmental checks without actually distribut i ng the
package payload to the Linux computers.
A preflight package:
zRuns the RPM in test mode (--test). This performs all the checks that RPM normally
performs during installation, but it does not install the package. It checks the Linux
computer’s environment for what is needed to run the package (specific Re d Hat
commands, Wget, and so on) and for what is needed to install the package software
(dependencies, conflicts, and so on).
zRuns the preflight script, if included. You can write this script to perform additional
environment checks. Examples: Get additional system information, find files.
zWrites a log file on the Linux computer and posts the log file to the URL that is
specified in Installation Expert > Installation Log page. The Linux computer must
have access to that URL. You can view this log in the Reports view.
Because preflight packages do not contain any files to be installed and are smaller than
normal packages, distributing preflight packages for testing purposes minimizes
bandwidth usage.
Managing Linux Packages
Requirements
Microsoft Internet Information Server (IIS)—4.0 or later is required; 5.0 is
recommended.
To run a preflight test
1. (Optional.) Add a preflight script to the package.
a. In Script Editor, select Preflight from the Install Event drop-down list.
b. Create the script to perform the desired environmental checks.
See Using Script Editor on page 42.
2. Build the preflight package.
a. Click Build.
b. On the Build Installation Package dialog box, mark the Build a Preflight
Package check box, complete the rest of the dialog box, and click OK.
The preflight RPM is built without files.
3. Use your normal deployment method to distribute the RPM and run it on one or
more destination computers.
4. When you finish testing, go to the Reports view and select Preflight Reports.
The page lists dated reports for each preflight test that has been run. Select the
report to view.
Linux Package Editor Reference18
Checking the Syntax of a Script
If a Linux computer is accessible to the Windows computer on which you create Linux
packages, you can check the syntax of the scripts in a Linux package from within Linux
Package Editor.
zPerl scripts (.pl) are checked with the Perl syntax checker.
zBourne shell scripts ( .s h) are checked using the -n Ba s h command. This inclu d es
shell scripts that are created by WiseScripts (.wsl) that you add to a package.
To check a call script’s syntax
1. Set up and connect to a Linux proxy computer.
See Setting Up an SSH Linux Proxy on page 13.
2. In Linux Package Editor, go to Script Editor and click the tab of the script to check.
3. Click the Check button at the lower right of the window. If the Check button does
not appear, verify your Linux proxy connection.
The script is checked and a message indicates whether the script’s syntax is correct.
See also:
Managing Linux Packages
Call Script on page 48
Linux Package Editor Reports
Use the following reports to obtain information about your packages and installations.
Project Configurations
report
Installation ReportsDisplays the installation log file for each installation that
Preflight ReportsDisplays the preflight log file for each preflight test that
The Installation Reports and Preflight Reports are obtained from t he installation logs that
are posted to the URL that is specified in Installation Expert > Installation Log page. If
the installatio n has not been run or if the log file has not been posted, the reports page
is empty. If you are using the default log file name, it contains the computer name, so
you can easily find the log file you want.
If your IIS server is not set up correctly, the reports page displays a “page cannot be
found” error message.
Displays a summary of the configuration options that
are set in Installation Expert for each project in the
project folder
The project folder is defined in Tools menu > Options.
has been run
has been run
To view Linux Package Editor reports
1. Select View menu > Reports, or click Reports at the lower left of the window.
2. In the left pane, select the type of report to view.
Linux Package Editor Reference19
3. Click the link for the specific report to view.
To refresh a report, click in the report pane and click on the toolbar.
Building a Linux Archive File
You might want to store a group of files in one file for easier backups and transfers.
Example: You can create an archive file based on one package and then import it to
another package.
Use the Build Linux Archive File feature to create a Linux archive file, compressed
archive file, or RPM file from the contents of the current package.
zAn archive file is a collection of files and directories that are stored in one file. The
archive file is not compressed—it uses the same amount of disk space as all the
individual files and directories combined. You can create archive files in .cpio or .t ar
formats.
zA compressed file is an archive file because it is a collection of files and directories
that are stored in one file. However, the compressed file stores them in a way that
uses less disk space than all the individual files and directories combined. You can
create compressed files in these formats: .gz and .tgz, which is a compressed tar
format.
Managing Linux Packages
zAn RPM file is a package file that contains software that will be installed using RPM.
You can use this feature to create an RPM without the shell wrapper. However, the
RPM will not have the pre-installation and call script capabilities of the shell wrapper.
The archive and compression formats preserve the information that is associated with
the files: directory structure, file contents, ownership and mode (permission) settings.
This lets you store and recreate a file system exactly as it was when you archived it.
Requirements
Because the archive, compressed, and RPM files that you create will contain files from
the current package, the Build Linux Archive File command is available only if the
package contains at least one file.
To build an archive, compressed, or RPM file
1. Select Tools > Build Linux Archive File.
The Build Linux Archive File dialog box appears.
2. Select the platform that this archive file or RPM package runs on. This drop-down
list is populated with the platforms that are defined in Installation Expert >
Platforms page.
3. In Filename, specify the path and name of the file to create. This defaults to an
.RPM file in the default path. The following file types are available: .cpio, .gz, .tar,
.tgz, .rpm.
The naming convention for .RPM files is name-version-release.architecture.rpm.
Example: rootfiles-7.2-1.i386.rpm
4. Click Save.
See also:
Linux Package Editor Reference20
Importing From a Linux Archive File on page 30
Managing Linux Packages
Linux Package Editor Reference21
Chapter 4
Creating Linux Packages
This chapter includes the following topics:
zThe Installation Expert Window on page 22
zDefining the Version on page 24
zDefining the Version on page 24
zFiles Page on page 25
zAbout Dependency Relationships on page 31
zAdding Dependencies on page 32
zAdding Capabilities on page 34
zAdding Conflicts on page 35
zAdding Obsolete Packages on page 36
zAdding Triggers on page 37
zAdding Platforms on page 39
zConfiguring the Installation Log on page 39
zSetting Compiler Variables on page 40
zSpecifying Build Settings on page 41
About Installation Expert in Linux Package Editor
Installation Expert lets you create and edit RPM packages and provides an easy-to-use,
task-oriented user interface to perform the most common installation tasks. Each page
of Installation Expert lets you configure a specific aspect of the package.
In Installation Expert, the pages are organized into logical groups and listed in the order
in which you usually use them.
You also can create a package by importing an RPM file or Linux archive file.
You can add WiseScripts to the package to provide additional package functionality.
See Using Script Editor on page 42 and About script actions in Linux Package Editor on
page 46.
The Installation Expert Window
To access Installation Expert, click Installation Expert at the lower left of the Linux
Package Editor main window.
Linux Package Editor Reference22
Page Groups
Creating Linux Packages
Installation Expert window in Linux Package Editor
Page Area
View NavigationBuild and Troubleshoot
Page Groups
Pages are organized into page groups. Click the group name to expand or collapse its
pages. Click a page name to display that page.
Page Area
When you click a page name in a page group, this area displays the page’ s options. Each
page lets you define a specific aspect of the RPM package. (Examples: On the Files page,
you define what files are included in the package.) Complete only the pages that are
pertinent to your particular package, in any order. If required information is missing, an
error message appears during the build process.
zUse on the toolbar to navigate from page to page, or click the page name in
the list of pages.
zTo display help for the current page, press F1.
View Navigation
Click these tabs to change views.
Build and Troubleshoot
Use the Build and Warning buttons to build and troubleshoot the package. A Check
button might also appear in this area. See:
Building a Linux Installation Package on page 16
Viewing the Session Log and Warnings on page 17
Checking the Syntax of a Script on page 19
Linux Package Editor Reference23
General Information
On the General Information page, you enter information about the RPM package. This
information appears in the package header.
In Linux Package Editor, select Installation Expert > General Information and complete
the page:
zName
Enter the name of the software being packaged. The package name is case
sensitive. Do not include spaces, tabs, or other characters that are not valid in a file
name. This information becomes part of the package label.
zDescription
Enter an in-depth description of the software being packaged. Use a blank line in the
description to separate paragraphs. This information is display ed when anyone uses
rpm -qi to query your pac kage.
zSummary
Enter a one-line description of the packaged software. Typically, you should limit this
to about 50 characters.
zVendor
Enter the name of the organization that is responsible for distributing the packaged
software.
Creating Linux Packages
zURL
Enter a URL that points to additional information about the packaged software. This
might be the URL to documentation on your company’s web site or to the vendor’s
web site.
zCopyright
Enter copyright or license information that applies to the software being packaged.
Example:
Copyright 2006, Sample Company. All rights reserved.
If your software is made available under the terms of the GNU General Public
License, enter GPL.
zPackager Name
Enter the name of the person who is creating the package. You can include an email
address. Example:
Your Name <your.name@address.com>
zPackage Group
You can group packages by the types of functionality they provide. Select the group
to which this package belongs.
zGIF File
Specify a file in .GIF format that should be displayed along with this package name
in various places on the Linux computer. Example: In the list of programs in the
Redhat Package Management utility.
Defining the Version
On the Version page, you define the version information that, combined with the
package name, uniquely identifies the RPM package.
Linux Package Editor Reference24
Creating Linux Packages
In Linux Package Editor, select Installation Expert > Version and complete the page:
zVersion
Enter the version of the software being packaged. Typically, this information comes
from the application’s developer. Do not include hyphens because RPM uses a
hyphen to separate the version from the remainder of the package label.
This information becomes part of the package label. It is used during version
comparisons.
zRelease
Enter the package’s release number, which represents the number of times the
package has been rebuilt using the same version software. T ypically, you enter 1 for
the first PRM you build for a package, and you increment the number every time you
change and rebuild the package.
This information becomes part of the package label.
zSerial/Epoch
(Optional.) The serial number helps RPM to determine version number ordering in
cases where RPM might not be able to interpret the version number. This can
happen when the version number contains an alpha character, or when the version
numbering scheme has changed between releases.
Enter a unique serial number for each version of the software being packaged.
Increment the serial number along with the version.
Files Page
For serial number comparisons to work, the package that requires the serialized
software must specify its version requirements in terms of the serial number.
Generally, use of the serial number is discouraged in favor of a reasonable version
numbering scheme.
On the Files page, you specify the directories and files to be added to the RPM package
for installation on the Linux computer.
Linux Package Editor Reference25
Files page in Linux Package Editor
Creating Linux Packages
Directories
available to
your computer.
Directories to
be installed on
the Linux
computer.
Files in the
directory selected
on the left.
Files to be
installed on the
Linux computer.
About Installation Directories
The lower-left list box is populated with predefined directories that represent a standard
Red Hat Linux system. These directories are represented by the icon. You can
customize the display to match your Linux environment.
See Browsing the Linux File System on page 15.
The lower-left list box also contains directories that you add to the package. These
directories are represented by the icon.
About the $WISEFOLDER Directory
The $WISEFOLDER directory is a project-specific working directory on the Linux
computer. Everything in this directory is extracted when the shell file is run, therefore,
any files that must be present before the RPM is run should be placed in this directory
when the package is created. Examples:
zCall scripts (these are placed here for you when you add them to the script).
zCircular dependency files.
See Handling Circular Dependencies on page 33.
You define the value of $WISEFOLDER on the Build Settings page.
See Specifying Build Settings on page 41.
Working With the Files Page
zUse the right-click menu to expand or collapse the directory structure and to edit or
remove directory settings.
Linux Package Editor Reference26
Creating Linux Packages
zDrag directories or files to the page from Windows Explorer.
zDrag directories or files from the upper list boxes to the lower list boxes.
zRight-click a file in the lower-right list box to open it in the text editor that is
specified on the Options dialog box.
zUse the following buttons:
Add Contents
Add an entire directory and its contents to the installation. The File Details
dialog box appears, where you enter settings for this directory and its files.
See Completing the File Details Dialog on page 28.
Add File
Add files to the directory that is selected in the lower-left list box.
New Folder
Create directories to be installed on the Linux computer. New directories are
created with the default settings.
Installation directories that you add on the Files page are not visible in the
Browse Linux File system dialog box.
Delete Folder
Remove a directory from the installation. This does not delete the directory
from the Linux computer. You cannot delete a predefined directory.
Delete File
Remove a file from the installation. This does not delete the file from the Linux
computer.
Details
View and edit details about a file, including the file category and permissions.
See also:
About Directory and File Settings
Completing the File Details Dialog on page 28
Adding Files to a Package on page 30
Importing From a Linux Archive File on page 30
About Directory and File Settings
You can edit attributes, or settings, for directories and files in a Linux package.
See Completing the File Details Dialog on page 28.
How Directory Settings Are Assigned
The way that directory settings are assigned depends on the type of directory and the
way in which it is added to the package.
zDirectories that you add to the package must have settings that will be applied
when those directories are created on the Linux computer.
When you add a new directory, it is assigned default settings. Review the
When you add a directory by dragging from the upper-left list box or by using
Linux Package Editor Reference27
settings and edit them if necessary.
the Add Contents button, the File Details dialog box appears and displays
Creating Linux Packages
default settings. Review the settings and edit them if necessary. Files in that
directory inherit the directory’s settings.
If you edit the setti ngs for the first di rectory that you add in this manner, then
those settings become the default for directories that you add subsequently.
zPredefined environment directories typically do not have settings in Linux Package
Editor, because those directories already have settings on the Linux computer.
Warning
Editing the settings of a predefined directory can affect applications that are already
present on the Linux computer.
zWhen you import from an .RPM or archive file, the package might contain directories
that do not have settings. T ypically, those directories appear in the package because
they appeared in the paths of files in the imported file.
About File Categories
Each file in a Linu x package is assigned to one of the following categories:
zApplication file
Most files that you add to a package are considered application files.
zConfiguration file
During installations, upgrades, and uninstalls, RPM performs additional processing
for configuration files to prevent the loss of changes that might be made to those
files by the system administrator.
zDocumentation file
RPM keeps track of documentation files in its database.
Be sure to verify that each file in the package is assigned to the correct category. Do this
on the File Details dialog box.
Completing the File Details Dialog
You edit directory and file settings on the File Details dialog box, which appears when
you:
zAdd a directory by dragging from the upper-left list box or by using the Add
Contents button.
zAdd a file by dragging from the upper-right list box or by using the Add File button.
zRight-click a directory in the lower-left list box and select Details.
If you edit the settings for the first directory or file that you add, then those settings
become the default for directories or files that you add subsequently.
To complete the dialog box:
zPlatform
Enter or select the platform that this RPM package runs on. This drop-down list is
populated with the platforms that are defined in Installation Expert > Platforms
page.
zFilename
Read-only.
Linux Package Editor Reference28
Creating Linux Packages
zDestination Path
Read-only. This is the path that the file will be installed to.
zFile Owner
Enter or select the owner of this file.
zFile Group
Enter or select the group that owns this file.
zFile Class
If this is a normal file, enter or select a description of the file. This informational
field is user-defined. It is pre-filled for symbolic link, device, and directory files.
See File Type.
zFile Category
During installation, RPM treats different categories of files in different ways. Select
Application, Configuration, or Documentation to define the category for this
file.
Be sure to verify that each file in the package is assigned to the correct category.
zFile Type
The options in this section are unavailable for directories and for files that you add
by adding the contents of a directory, because those files are always normal files.
These options provide a value for the first position in the file and directory attributes
that are displayed on the Linux computer with the ls -l command. Example: In
drw-rw-rw-, the d in the first position indicates a directory.
Normal File
Normal files are indicated by a - in the first position of the file attributes.
Symbolic Link File
A symbolic link file is a special type of file that contains a path to another file.
Instead of accessing the data in the symbolic link file, the operating system
accesses the data in the file named in the symbolic link. This is similar to a
shortcut in Windows.
You cannot set this option; it is set only when you add or import files that are
already defined as symbolic link files.
Device File
(Read only.) This might be marked for files that are imported. This does not
apply to documentation or configuration files. Device files are indicated by a c
(character device) or b (block device) in the first position of the file attributes.
Directory
Mark this to create an empty directory on the Linux computer. The directory is
created at the location specified in Destination Path, and with the name
specified in Filename above. Directories are indicated by a d in the first
position of the file attributes.
zPermissions
Read, Write, Execute
Specify read, write, and execute permissions for the file owner, the file group,
and the public.
Set User ID Bit
Linux Package Editor Reference29
If this is an executable file, mark this to set the file to run with the same
privileges as the file owner specified above.
Set Group ID Bit
If this is an executable file, mark this to set the file to run with the same
privileges as the file group specified above.
Sticky Bit
When the sticky bit is set on a directory, it restricts write permission by allowing
users to delete only files that they own. This prevents users from ov erwriting or
deleting each other’s files in a publicly accessible directory (example: /tmp).
This bit might be used for other purposes in certain operating systems.
zVerify this file when running RPM verify
The RPM verification function (rpm -V) verifies certain attributes of files and
directories. Mark this to include this file in the verification. You might clear this
check box, and exclude a file from the verification, when the file is likely to change
after it is installed on the Linux computer (example: configuration files).
Adding Files to a Package
A Linux package must contain at least one file.
For additional ways to add directories and files to a package, see Working With the Files
Page on page 26.
Creating Linux Packages
To add files to a package
1. In Linux Package Editor, select Installation Expert > Files page.
2. If the directory where the file is to be added is not listed in the lower-left list box:
a. Select the directory under which the new directory should be created.
b. Click New Folder, enter a name, and click OK.
The directory you specify will be created on the Linux computer if it does not exist.
3. In the lower-left list box, select the directory to which the file will be added.
4. In the upper list boxes, navigate to a file and double-click it or drag it to the lowerright list box. You can select multiple files.
The File Details dialog box appears and displays default settings.
5. Review the settings and edit them if necessary.
See Completing the File Details Dialog on page 28.
6. Click OK.
The file is added to the selected directory and appears in the lower-right list box.
Importing From a Linux Archive File
You can create or add to a package by importing an RPM package or a Linux archive file
in one of these formats: .tgz, .gz, .tar, .cpio.
Examples:
zCreate an archive file based on one package and then import it to another package.
zRepackage an RPM file by importing it from another source and customizing it.
Linux Package Editor Reference30
Creating Linux Packages
To import files from a Linux archive file
If you will import an RPM file, you must be in a new, empty package. However, you can
import an archive file into an existing package.
1. Select Tools menu > Import Linux Archive File.
The Select Linux Archive File dialog box appears.
2. Complete the dialog box:
Platform
Select a platform to assign the imported files to. This drop-down list is
populated with the platforms that are defined in Installation Expert > Platforms
page.
This setting does not overwrite the platform setting of files that you import from
an RPM file.
Filename
Specify the .RPM or archive file to import from.
3. Click OK.
The files and other information are imported to the package. The individual files are
listed on the Files page, where you can edit them.
4. Display the File Details dialog box for each imported file and verify that it is assigned
to the correct category.
See also:
Files Page on page 25
Completing the File Details Dialog on page 28
Building a Linux Archive File on page 20
About Dependency Relationships
Every RPM package provides capabilities. A capability is a text string representing a
function that the package claims it provides. In most cases, a capability names a file or
package, but a capability also can be any arbitrary text string.
Capability information for installed packages is stored in the RPM database. When you
install or uninstall a package, RPM compares it to packages in the database. This
package comparison checks for the following types of dependencies:
zRequires (dependencies). In order to run properly, the current package requires a
capability that is provided by another package. If none of the installed packages
provide that capability, the current package is not installed.
You define dependency relationships on the Dependencies page.
See Adding Dependencies on page 32.
A circular dependency occurs when two packages each depend on the other.
See Handling Circular Dependencies on page 33
zProvides (capabilities). The current package provides a capability that another
package needs in order to run properly. When you try to uninstall a package that
another package depends on, a dependency error can occur.
You define capability relationships on the Capabilities page.
Linux Package Editor Reference31
Creating Linux Packages
See Adding Capabilities on page 34.
zConflicts. The capabilities of the current package interfere with those i n another
package. RPM prevents you from installing a package that conflicts with other
packages. This typically is used when packages provide similar capabilities.
Example: sendmail, vmail, and exim are all mail transfer agents and therefore
conflict with each other.
You define conflict relationships on the Conflicts page.
See Adding Conflicts on page 35.
zObsoletes. The current package contains a capability that makes another package
obsolete. This typically is used when the name or version of a package changes.
Example: The apache package was renamed httpd, therefore, the httpd package
makes apache obsolete.
You define obsolete relationships on the Obsoletes page.
See Adding Obsolete Packages on page 36.
About Virtual Packages
A virtual package is a generic text string that represents functionality that is provided by
several RPM packages. (Example: a web server or ftp server.) Any other package
requiring that functionality can state a dependency on the virtual package without
having to specify all possible packages individually. It can be installed when any one of
the dependency packages is installed.
Example: Your package is a mail program that requires the functionality of a local
delivery agent. Several local delivery agents are available, and your package can work
with any of them. The developers of the local delivery agent packages specify a
capability of “lda”, which is a virtual package. If your package specifies a dependency on
“lda”, then it can be installed when any one of the local delivery agent packages is
present.
Virtual packages do not have version numbers.
Adding Dependencies
On the Dependencies page, you specify one or more RPM packages that the current
package depends on.
When you add an executable file to the package, it is checked for shared library
dependencies. If any are found, they are added to this page.
To add a dependency:
In Linux Package Editor, select Installation Expert > Dependencies page, click Add, and
complete the Define Dependency dialog box:
zPackage Name
Enter or select the package that the current package depends on. This can be a
package name, a file name, a shared library, or a virtual package.
See About Virtual Packages on page 32.
If you leave the Operator and Version blank below, RPM checks for the presence of the
package you specified above. If y ou enter the Operator and Version, RPM checks for a
specific version of the package.
Linux Package Editor Reference32
Creating Linux Packages
zOperator
(Optional.) Select the operator to use during the package comparison.
zVersion
(Optional.) Enter the version of the above package that is required. If you enter a
version number you must enter an operator above.
zFlags
The following options represent bits in the flag RPMTAG_REQUIREFLAGS, which
specifies the dependency range and context. These options might be marked in
packages that you import.
Provides
Not available on this page.
Requires
PreReq
Interpreter
Config
zEvent Flag
Specify when this dependency is required:
No Event
The dependency is needed to run the package but not to install it.
PreInstall
The dependency is required before installation.
PostInstall
The dependency is required after installation.
PreUninstall
The dependency is required before uninstallation.
PostUninstall
The dependency is required after uninstallation.
Verification
The dependency is required when verification (rpm -V) is run. This is not
commonly used.
The following options do not apply to this page and are not available:
Trigger Install
Trigger Uninstall
Trigger Post-Uninstall
Trigger Script Name
See also:
About Dependency Relationships on page 31
Handling Circular Dependencies
A circular dependency occurs when two packages each depend on the other. Example:
mysql and perl-DBD depend on each other. To avoid problems that can occur with
circular dependencies, it is best to install both packages at the same time. The follo wing
example describes how to handle circular dependencies in Linux Package Editor.
Linux Package Editor Reference33
Creating Linux Packages
Example:
You import an RPM for Application A into Linux Package Editor. The Dependencies page
shows a dependency on Application B. During testing, you try to install Application B
before you run the Application A installation. The Application B installation fails because
it requires Application A.
To resolve this circular dependency, do the following in the Application A package:
1. On the Files page, add the Application B package file to $WISEFOLDER.
2. On the Build Settings page, enter the following in the RPM Command Line
Options field:
$WISEFOLDER\application B file name
This must precede any other options in the command line.
Note
If the dependency files are removed from this package, remove this line from the
command line.
At run time, the Application B file is extracted from $WISEFOLDER before the Pre- RPM
script runs. This makes it available to the rp m command so that it can be installed at the
same time as the Application A files.
See also:
Adding Dependencies on page 32
Adding Files to a Package on page 30
Specifying Build Settings on page 41
About the $WISEFOLDER Directory on page 26
Adding Capabilities
On the Capabilities page, you specify the capabilities that this RPM package provides.
Specify as many capabilities as you think other packages might be looking for. Include
your package name as one of the capabilities.
To add a capability
In Linux Package Editor, select Installation Expert > Capabilities page, click Add, and
complete the Define Capability dialog box:
zPackage Name
Enter or select the capability that the current package provides. This can be a
package name, a file name, a shared library, or a virtual package.
See About Virtual Packages on page 32.
If you leave the Operator and Version blank below, RPM checks for the presence of the
above package. If you enter the Operator and Version, RPM checks for a specific
version of the package.
zOperator
(Optional.) Select the operator to use during the package comparison.
Linux Package Editor Reference34
Creating Linux Packages
zVersion
(Optional.) Enter the version of the above package that is provided. If you enter a
version number you must enter an operator above.
zFlags
The following options represent bits in the flag RPMTAG_PROVIDEFLAGS, which
specifies the capability range and context. These options might be marked in
packages that you import.
Provides
Requires
Not available on this page.
PreReq
Not available on this page.
Interpreter
Not available on this page.
Config
zEvent Flag
The following options do not apply to this page and are not available:
No Event
On the Conflicts page, you specify the RPM packages that conflict with the current
package. In order for the current package to run properly, these conflicting packages
cannot be installed on the Linux computer.
To add a conflict:
In Linux Package Editor, select Installation Expert > Conflicts page, click Add, and
complete the Define Conflict dialog box:
zPackage Name
Enter or select a package that conflicts with the current package. This can be a
package name, a file name, or a shared library.
If you leave the Operator and Version blank below, RPM checks for the presence of the
above package. If you enter the Operator and Version, RPM checks for a specific
version of the package.
Linux Package Editor Reference35
Creating Linux Packages
zOperator
(Optional.) Select the operator to use during the package comparison.
zVersion
(Optional.) Enter the version of the above package that conflicts. If you enter a
version number you must enter an operator above.
zFlags
The following options do not apply to this page and are not available:
Provides
Requires
PreReq
Interpreter
Config
No Event
PreInstall
PostInstall
PreUninstall
PostUninstall
Verification
Trigger Install
Trigger Uninstall
Trigger Post-Uninstall
Trigger Script Name
See also:
About Dependency Relationships on page 31
Adding Obsolete Packages
On the Obsoletes page, you specify the packages that the current package makes
obsolete. This typically is used when the name or version of a package changes.
To add an obsolete package:
In Linux Package Editor, select Installation Expert > Obsoletes page, click Add, and
complete the Define Obsolete Package dialog box:
zPackage Name
Enter or select a package that the current package makes obsolete. This can be a
package name or a file name.
If you leave the Operator and Version blank below, RPM checks for the presence of the
above package. If you enter the Operator and Version, RPM checks for a specific
version of the package.
zOperator
(Optional.) Select the operator to use during the package comparison.
zVersion
(Optional.) Enter the version of the above package that is made obsolete. If you
enter a version number you must enter an operator above.
zFlags
The following options do not apply to this page and are not available:
On the Triggers page, you specify the packages that cause a trigger to occur in the
current package. You also define a trigger scri pt, which you can then edit in Script Editor.
Triggers provide a way for a package to take action when the installed status of another
package changes. This lets your package deal with changes that occur in another
package, usually one that has a dependency relationship with your package.
When you define a trigger , you specify the event that causes the trigger and the script to
run when the event occurs. A trigger can occur when your package or another package
is installed or uninstalled. A trigger script might change some configuration of yo ur
package, or it might send a notification email.
To add a trigger:
In Linux Package Editor, select Installation Expert > Triggers page, click Add, and
complete the Define Trigger Package dialog box:
zPackage Name
Enter or select a package that causes a trigger in the current package. This must
this be an actual package name.
If you leave the Operator and Version blank below, RPM checks for the presence of the
above package. If you enter the Operator and Version, RPM checks for a specific
version of the package.
zOperator
(Optional.) Select the operator to use during the package comparison.
zVersion
(Optional.) Enter the version of the above package that causes a trigger. If you
enter a version number you must enter an operator above.
zFlags
The following options do not apply to this page and are not available:
Provides
Specify the event that will cause the trigger to occur:
Trigger Install
Runs the trigger script when the trigger package specified above is installed or
upgraded, or when that package is already installed, and the current package i s
installed or upgraded.
Trigger Uninstall
Runs the trigger script when the trigger package specified above is uninstalled,
or when that package is already installed, and the current package is
uninstalled.
Creating Linux Packages
Trigger Post-Uninstall
Runs the trigger script only when the trigger package specified above is
uninstalled.
zTrigger Script Name
Select a script to run when the trigger event occurs. This drop-down list contains
any trigger scripts that you have added to this package. To create a new script, click
New. The New Script dialog box appears.
To add a trigger script
Complete the New Script dialog box:
1. In New Script Name, enter a name for the script.
2. Select the script type:
WiseScript (.wsl). This is a shell script format file.
Perl Script (.pl).
Bourne Shell (.sh).
Any other script for which there is an interpreter on the Linux computer.
3. Click OK on the New Script dialog box and the Define Trigger package dialog box.
The script is added to the install events in Script Editor. There, you can create and
edit the script.
4. In Script Editor, select the trigger script from the Install Event drop-down list.
5. Create the script in the script window:
If you created a WiseScript, use the script actions that are provided in Script
Linux Package Editor Reference38
Editor.
If you created another type of script, use the right pane of Script Editor as a
basic text editor. The first line in the script must define the command
interpreter. Examples:
See also:
About Dependency Relationships on page 31
Adding Platforms
On the Platforms page, you specify the Linux platforms on which this package can be
installed. The platforms you specify populate the Platform drop-down list that appears
on the File Details dialog box. When you add a file to the package, you specify the
platform on which the file should be installed. Then, when you install to a specific
platform, only the files that match the platform are installed.
In Linux Package Editor, select Installation Expert > Platforms page, click Add, and
complete the Define Platform dialog box:
Select an architecture. Currently, only i386 is supported. This information becomes
part of the package label.
zOperating System
Select an operating system. Currently, only Linux is supported.
See also:
Completing the File Details Dialog on page 28
Configuring the Installation Log
When a package runs on a Linux computer, it can create an installation log. On the
Installation Log page, you specify the installation log’s location and contents.
In Linux Package Editor, select Installation Expert > Installation Log and complete the
page:
zDo not create an installation log
Mark this to prevent the installation log from being created.
zCreate the log in the Wise Management Directory
Mark this to create the installation log in a project-specific subdirectory of the Wise
management directory on the Linux computer. The location of this directory is
defined in Installation Expert > Build Settings page.
zCreate the log at this location
To create the log in a specific location on the Linux computer, mark this and specify
the location in the field to the right.
Linux Package Editor Reference39
Creating Linux Packages
zUse default log filename
Mark this to name the log file with the default name (Project-Type-ClientDateTime.txt). To provide a specific name for the log file, clear this check box and
enter the name in the Log filename field.
zPost log file to URL
To post a copy of the installation log to a network location, mark this and enter the
location in the URL field. The default location is Wise Repository, which represents
the IIS Web server that runs Wise Package Studio Web applications.
This lets you manage the installation logs for multiple computers, and view the logs
in the Reports view in Linux Package Editor.
The Linux computer must have access to the URL you specify here. Also, the web
server must have write access to the location specified here.
Note
If you use the default installation log file name (Project-Type-Client-DateTime.txt), the
Add Text to INSTALL.LOG script action will not work in the Pre-Uninstall, Post-Uninstall,
or Verification scripts. Those scripts cannot determine the log name because of the date
and time in the file name. This is not a problem if you use a specific log file name.
Debug Options
The following options control the amount of information that is recorded in the
installation log. You can set different levels of detail during different phases of package
development. Example: During the package debugging phase, you might have the
installation log write a marker for each command being executed, but when you finish
debugging, you turn that option off.
zWrite a marker for each command being executed
zSend the standard output of each command to the log
zSend the standard error of the each command to the log
zEcho each command as it is being executed
Setting Compiler Variables
On the Compiler Variables page, you set compiler variables that change the package
(.SH) during compile. You can use compiler variables to include or exclude portions of
script from the package or to build a debug version of the package.
Compiler variables are different from shell variables. The values of compiler variables
are set before you build the installation, while the values of shell variables are se t when
the end user runs the RPM package.
You set the default v alue of compiler v ariables on the Compiler Variables page, and then
you select the compiler variables in the Compiler Variable If action in Script Editor.
Compiler variables are surrounded by % characters in the script. (Example:
%_DEBUG_%.)
You can change the value of compiler variables on the Build Installation Package dialog
box that appears when you build the package.
Linux Package Editor Reference40
To add a compiler variable
In Linux Package Editor, select Installation Expert > Compiler Variables page, click Add,
and complete the Compiler Variables dialog box:
zVariable Name
Enter the name of the compiler variable. You do not need to include the %
characters.
zDefault Value
Enter the default value of the compiler variable.
See also:
Compiler Variable Actions on page 52
Building a Linux Installation Package on page 16
Specifying Build Settings
On the Build Settings page, you can specify how the installation package interacts with
the Linux computer during installation.
In Linux Package Editor, select Installation Expert > Build Settings and complete the
page:
Creating Linux Packages
zWise Management Directory on the Linux Computer
Specify the directory on the Linux computer to serve as a working directory for
Linux Package Editor packages. A separate subdirectory is created for each Linux
Package Editor project, with the project name as the subdirectory name. The value
of $WISEFOLDER = the Wise Management Directory + the project-specific
subdirectory.
This is used to store project-specific files (example: call scripts, installation logs,
circular dependency files).
zInstallation Directory for this Package
Specify the directory on the Linux computer in which to install the application. This
defines the value of $INSTALLDIR.
zRPM Command Line Options
Specify additional RPM commands for Linux Package Editor to include in the RPM -U
command that installs the package.
See also:
About the $WISEFOLDER Directory on page 26
Linux Package Editor Reference41
Chapter 5
Using Script Editor
This chapter includes the following topics:
zThe Script Editor Window on page 42
zViewing Script Code on page 43
zAdding an Action to a Script on page 44
zEditing Scripts
The Script Editor Window
Script Editor provides a powerful and easy-to-use scripting environment. You don’t need
to memorize commands, because Script Editor supports a point-and-click method of
scripting. Scripts provide additional package functionality; they are not required.
However, most packages have at least a post-install script to re-load the shared libraries
(command: ldconfig).
The Script Editor window contains tools for developing and editing scripts. To access
Script Editor, click Script Editor at the bottom of the Linux Package Editor window.
Action
categories
Actions list
Script Editor window in Linux Package Editor
Current installation
script
Installation Script
list
Tabs for the main
script and each call
script
Linux Package Editor Reference42
Using Script Editor
Actions
The Actions list displays the actions that you can add to your script. To view a different
category of actions, select the category from the Actions drop-down list. The actions
that appear in the Actions list are filtered according to the current install event.
Installation Script Area
The installation script area displays the installation scripts that are run by Linux Package
Editor.
From the Install Event drop-down list, you can select one of the following installation
scripts to display and edit.
Pre-RPMRuns as soon as the shell runs
Pre-InstallRuns before the package is installed
Post-InstallRuns after the package is installed
Pre-UninstallRuns before the package is uninstalled
Post-UninstallRuns after the package is uninstalled
VerificationRuns when a verification (rpm -V) is run on the package
PreflightRuns when you install a preflight package
The Install Event drop-down list also includes any trigger scripts that you add to the
package.
See Adding Triggers on page 37.
Script Tabs
A tab for the current installation script appears at the bottom of the installation script
area. When you add a Call Script action to the current installation script, a tab for the
call script appears next to the tab for the current installation script.
Script Line Numbering
zTo show or hide script line numbers, select View menu > Line Numbers.
zConnection lines connect the beginning and end of an If block or a loop. To show or
hide connection lines, select View menu > Connection Lines.
Viewing Script Code
Most of the script actions in Script Editor run Linux commands. To view the Linux
commands that underly the current Linux Package Editor script, save the script as a
shell file.
To view script code
1. In Linux Package Editor, select Script Editor.
2. Select File menu > Save Script as Shell.
The Save as script file dialog box appears.
Linux Package Editor Reference43
3. Specify the location and name of the shell file, and then click Save.
4. To view the code on the de stin ation Lin ux com pute r, use the cat command
(example: cat shell_file.sh). To view the code on a Windows computer, open it in
Wordpad.
See also:
About script actions in Linux Package Editor on page 46
Adding an Action to a Script
In Script Editor, do any of the following:
zFrom the Actions list in the left pane, drag an action onto a line in the Installation
Script list in the right pa ne. The new action appears above the line that is
highlighted when you drop the action.
zClick in the script and double-click the action in the Actions list to place the new
action above the line you clicked.
zClick in the script and start typing the first few letters of the action name. As you
type, the current line becomes a drop-down list with all the action names, and the
action that most closely matches the letters you typed is the current item in the list.
When the action you want is the current item in the list, press Enter.
Using Script Editor
When you add an action, a dialog box appears that lets you set the parameters for the
action unless it does not require parameters.
Some actions come in pairs. (Example: When you add an If action, you must also add an
End action at the end of the condition block.) Script Editor indents actions inside these
pairs.
Context-sensitive help is available for every script action dialog box; press F1 when the
dialog box appears.
See also:
The Script Editor Window on page 42
Editing Scripts
To edit a script in Script Editor, use the commands on the Edit menu, the commands on
the right-click menu, or the tools on the toolbar. You can edit only one script line at a
time, but you can cut, copy, or paste several lines at one time.
Select the installation script to display and edit from the Install Event drop-down list.
Editing Script Action Parameters
Double-click the action in the script. For most script actions, a dialog box appears so you
can configure its parameters.
To copy and paste script lines
1. Select one or more script lines.
2. Select Edit menu > Cut or Copy.
Linux Package Editor Reference44
Using Script Editor
3. If you’re copying the lines to another installation, open that installation script in
Script Editor.
4. Select a line in the script above which to place the lines you copied, then select Edit
menu > Paste.
The lines appear above the line you selected.
To duplicate or move script lines
1. Select one or more script lines.
2. Select Edit menu > Duplicate, or Edit menu > Move Up or Move Down.
To comment out script lines
You can temporarily comment out certain script lines to help with the debug process.
Commented out lines remain in the script, but are skipped when the script is execute d.
1. Select one or more lines.
2. Select Edit menu > Comment.
The commented out lines appear in green and begin with “/*”. To reactivate
commented out lines, select the lines and select Edit menu > Comment.
Finding and Replacing Text in a Script
To find and replace text in a script
1. In Linux Package Editor, select Script Editor.
2. Press Ctrl+F.
3. Enter the text to find.
4. (Replace function only.) Enter the replacement text.
You can replace a command’s parameters and editable text, but not the command
itself.
5. Click Find Next, Replace, or Replace All.
Linux Package Editor Reference45
Chapter 6
Script Actions
This chapter includes the following topics:
Add Text to INSTALL.LOG
Add User or Group
Call Script
Change File Attributes
Check File or Directory
Check HTTP Connection
Check Process
Check RPM Database
Compiler Variable Actions
Copy File(s)
Create Directory
Delete File or Directory
Delete Line From Text File
Delete User or Group
Else Statement
ElseIf Statement
End If
End While
Execute Program
Execute Shell Command
Exit Installation
Find File
Get System Information
Get Temporary Filename
Halt Compile
If Statement
Insert Line Into Text File
Manage a Service
Post to HTTP Server
Read/Update Text File
Remark
Rename File/Directory
Search File for Text
Set Variable
Start/Stop Process
While Statement
About script actions in Linux Package Editor
The Linux Package Editor contains script actions that let you perform various
installation-related tasks. The script actions are fully coded; all you do is enter
parameters for the action. This section describes the function and usage of each action.
Use Script Editor to insert script actions.
See Editing Scripts on page 44.
Linux Package Editor Reference46
Most of the script actions in Script Editor run Linux commands. To view the Linux
commands that underly the current Linux Package Editor script, save the script as a
shell file.
See Viewing Script Code on page 43.
Add Text to INSTALL.LOG
This action adds a line of text to the installation log that is defined in Installation Expert
> Installation Log page. Use this to comment the log file, or to print return codes from
other actions in the script.
Because the log is written continuously when the package is run, the location of the text
in the log depends on where in the script you place the Add Text to INSTALL.LOG script
line.
Note
If you use the default installation log file name (Project-Type-Client-DateTime.txt), the
Add Text to INSTALL.LOG script action will not work in the Pre-Uninstall, Post-Uninstall,
or Verification scripts. Those scripts cannot determine the log name because of the date
and time in the file name. This is not a problem if you use a specific log file name.
Script Actions
To complete the dialog box:
zEnter Log Text
Enter the text to be added to the log file. You can enter a variable, preceded by $
and adhering to standard conventions for naming Linux shell variables.
See also:
Configuring the Installation Log on page 39
Add User or Group
This action creates a new user or group on the Linux computer. You can use this action
to define a user or group for the application itself. We recommend that you add this
action to the Post-Install script, so that a new user or group is added only if the
installation is successful.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
To complete the dialog box
zSelect User or Group. If you select Group, all the fields that follow Name are
unavailable.
zUse This ID
Do one of the following:
Enter an ID. It must be a unique value on the Linux computer.
Linux Package Editor Reference47
Script Actions
Leave this field blank and mark System Account to assign this user or group
the smallest ID available that is less than 500. (Linux reserves IDs below 500
for system accounts.)
Leave this field blank and don’t mark System Account to assign this user or
group the next available ID starting with 500.
zSystem Account
Mark this to make this user or group a system account.
zName
Enter a name for the user or group.
zLogin Group
Enter a group name that exists on the Linux computer. If you clear Do Not Create
Unique Group For This User, this field is unavailable.
zOther Groups
To add this user to additional groups, enter the groups here. To separate groups,
use commas with no spaces. The groups must exist on the Linux computer.
zDo Not Create Unique Group For This User
By default, when you create a new user, Linux creates a unique group with the same
name as the user is created. To prevent creating this group, mark this option and
specify the name of an existing group in Login Group.
Call Script
zUse the Nologin Shell for This User
Mark this to create this user with the nologin shell, which prevents this user from
logging in. Use the nologin shell for accounts that are disabled or that only need FTP,
POP3, or SMTP (mail server) access.
zHome Directory
If this is a system user, or if you are defining a user for the application itself,
mark None.
To use the default home directory (/home/user_name/), mark Default.
To specify a directory other than the default, mark Directory and enter the
directory name in the field to the right.
zComment
Text that you enter here appears in the comment field of the new user’s line in the
password file (passwd).
This action adds an additional script to the current installation script. During the build
process, the called script is copied into the calling script at the location of the Call Script
action, resulting in a combination of the scripts. This action is not a vailable from within a
called script or a Pre-Flight script.
You can call an existing script or create a new script.
When the application is installed on the Linux computer, the scripts are installed to a
subdirectory of the Wise Management directory with the same name as the project.
When the action is run, the results are placed in the $RETURNCODE variable:
zIf the action ran successfully, the variable is set to the return code of the script.
zIf the script was not found, the return code is set to 127 for most systems.
Linux Package Editor Reference48
Script Actions
Types of Scripts
The following scripts are supported:
zWiseScript (.wsl). This is a special shell script format that allows the use of
WiseScript commands. It is converted to a shell script (.sh) file.
zPerl Script (.pl).
zBourne Shell (.sh).
Global and Local Scripts
zGlobal scripts are accessible by all packages, which lets you re-use them and share
them with colleagues. You can save time by developing a library of global scripts
that perform specific functions, such as subroutines. Global scripts are saved in
LinuxProjectFolder\GlobalScripts.
zLocal scripts are accessible only by the current package. They are saved in the
scripts directory under the specific project directory.
To add a call script
1. Add the Call Script action.
The Call Script dialog box appears.
2. Complete the dialog box:
Global Script
Mark this to call an existing or new global script. To call an existing script, select
it from the drop-down list. To call a new script, click New and specify the script’s
name and type on the New Script dialog box.
Local Script
Mark this to call an existing or new local script. To call an existing script, select
it from the drop-down list. To call a new script, click New and specify the script’s
name and type on the New Script dialog box.
Arguments
Enter any arguments for the script.
A tab appears at the bottom of the script window for the Call Script action.
To edit a call script
Click the new script’s tab at the bottom of the script window.
zIf you created a WiseScript, use the script actions that are provided in Script Editor.
zIf you created another type of script, use the right pane of Script Editor as a basic
text editor. The first line in the script must define the command interpreter.
Examples:
This action changes the permissions and ownership attributes for a file or directory on
the Linux computer.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
To complete the dialog box
zPathname
Specify the file or directory for which to change attributes.
zPermissions
Specify read, write, and execute permissions for the file’s owner and group, and
others (public).
zSet User ID Bit
If this is an executable file, mark this to set the file to run with the same privileges
as the file owner specified in the Permissions section.
Script Actions
zSet Group ID Bit
If this is an executable file, mark this to set the file to run with the same privileges
as the file group specified above.
zOwner
Enter or select the owner of this file or directory.
zGroup
Enter or select the group that owns this file or directory.
Check File or Directory
This action checks a file or directory on the Linux computer to see if it exists or if its size
is non-zero.
When the action is run, the results are placed in the $RETURNCODE variable:
0The file or directory exists, or it is non-zero size.
non-zeroThe file or directory does not exist, or it is zero size.
To complete the dialog box
zCheck
Select whether to check the existence of a file or directory , or whether a file’ s size is
non-zero.
zPathname
Specify the file or directory to check.
Linux Package Editor Reference50
Check HTTP Connection
This action uses the Wget downloading tool to determine whether a given URL is valid.
When the action is run, the results are placed in the $RETURNCODE variable:
0The URL was valid.
non-zeroThe action was unsuccessful.
Note
If the Web server redirects URLs that are not valid to another internal Web page, this
action does not detect an error.
To complete the dialog box
zURL to Check
Enter a URL.
zHTTP Status Return Variable
Enter or select a variable in which to place the code that is returned by the Web
server. This will be a standard HTTP return code.
Script Actions
Check Process
This action determines whether a specific process is running on the Linux computer.
When the action is run, the number of instances of the specified process is placed in the
$RETURNCODE variable.
Note
In rare instances, two different processes might have the same name. Both processes
would be reported as instances of the same process.
To complete the dialog box:
zProcess Name to Check
zProcess ID Return Variable
When you define the variable, you do not have to precede it with a $. Otherwise,
follow standard conventions for naming Linux shell variables.
Enter a Linux process name. Example: initd.
Enter or select a variable in which to place the process ID number. If multiple
instances are running, the process ID of the first instance is used.
When you define the variable, you do not have to precede it with a $. Otherwise,
follow standard conventions for Linux variables
Check RPM Database
This action queries the RPM database on the Linux computer and returns the results to a
user-defined variable.
Linux Package Editor Reference51
Script Actions
To complete the dialog box:
zPackage Name
Enter or select a package on which to perform the query.
zOperation
Specify the check to perform. Each option returns a different value to the variable
you define below.
Is Package Installed?
If the package is installed, 0 is returned to the variable. If the package is not
installed, a non-zero value is returned.
Verify Package
Mark this to use the rp m -V command to verify the package. When you mark
this option, you can enter command-line options in Options below. If the
package is verified, 0 is returned to the variable. If the package is not verified, a
non-zero value is returned.
Get Package Version
The package version is returned to the variable.
Get Package Release
The release number is returned to the variable.
Get Other Package Information
Use the --queryformat option to obtain additional information with a custom
query. When you mark this option, you can enter queryformat tags in Options
below.
zVariable
Enter or select the name of the variable in which to place the results of the query.
When you define the variable, you do not have to precede it with a $. Otherwise,
follow standard conventions for naming Linux shell variables.
zOptions
This is available only when the following options are marked:
If you marked the Verify package option above, enter one or more valid
command-line options to use with the rpm -V command.
If you marked the Get Other Package Information option above, enter a
valid Linux queryformat tag. The braces and other characters that enclose the
tag in the option are inserted for you. Example: Entering PROVIDES results in
the following option:
--qf "%{PROVIDES}"
The above example displays the capabilities that the package provides.
This action does not support format strings in the --queryformat option. To add
more complex queries to the script, use the Execute Shell Command script
action.
Compiler Variable Actions
Compiler Variable If, Else, and End actions are used in an If block to let you build
different versions of an installation. You set the value of a compiler variable at build
Linux Package Editor Reference52
See Execute Shell Command on page 56.
Script Actions
time, and the actions inside a compiler variable If block are added to the script according
to the value of the compiler variable.
You create compiler variables on the Compiler Variables page. When you create a
compiler variable, you specify its default value.
See Setting Compiler Variables on page 40.
You can change the v alue of a compi ler variable on the Build Installation Package dialog
box that appears when you build the package. To do so, double-click the variable name
and enter the new value.
Example:
zOn the Compiler Variable page, create a compiler variable named DEBUG with a
default value of “N”.
zIn the installation script, add a Compiler Variable If action that checks if DEBUG
equals “Y”.
zIn the If block, add an Add Text to INSTALL.LOG action that contains useful debug
information.
zEnd the If block with a Compiler Variable End action.
zWhen you build the package, double-click the DEBUG variable on the Build
Installation Package dialog box and change the value to “Y”.
Copy File(s)
The Add T ext to INSTALL.LOG action within the Compiler Variable If block is added to the
final script. The debug information you requested then appears in the installation log.
To create a compiler variable If block
1. Add a Compiler Variable If action and complete the dialog box:
Variable
Select a compiler variable from the first drop-down list, and a comparison
method from the second drop-down list.
The Value
Enter the value to be used in the comparison. This is case-sensitive, unless you
selected a comparison method that ignores case. Do not enter shell variables in
this field, because these variables are not evaluated until after the package is
built.
2. Below the Compiler Variable If action, add one or more actions to perform if the
compiler variable has the specified value.
3. (Optional.) Add a Compiler Variable Else action, followed by one or more actions to
perform if the compiler variable does not have the specified value.
4. Add a Compiler Variable End action.
This action copies a file or directory on the Linux computer from one location to another.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
Linux Package Editor Reference53
non-zeroThe action was unsuccessful.
To complete the dialog box
zSource File/Path
Specify the file or directory to copy. You can use the following wildcards: *, ?, and
[].
zDestination
Specify the path to copy to.
Create Directory
This action creates a directory on the Linux computer.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
Script Actions
To complete the dialog box
zPathname
Enter the full directory path to create.
Delete File or Directory
This action removes files or directories from the Linux computer.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
To complete the dialog box
zFile/Dir Path
Specify the path of the file or directory to delete.
Delete Line From Text File
This action deletes lines from a text file on the Linux computer. Example: You can delete
a user from the password file (passwd).
When the action is run, the number of lines deleted from the file is placed in the
$RETURNCODE variable.
Linux Package Editor Reference54
To complete the dialog box
zFile to Modify
Specify the file from which to delete a line.
zLine
Enter the text that is in the line to delete. Y ou can use an y regular expression. If y ou
enter a substring, the entire line is deleted.
zDelete All Occurrences
Mark this to delete all occurrences of the text in the file.
Delete User or Group
This script action deletes a user or group from the Linux computer. We recommend that
you add this action to the Post-Uninstall script so that a user or group is deleted only if
the uninstall is successful. This action is not available for Verification or Preflight scripts.
To complete the dialog box
zUser or Group
Select User or Group.
zName
Enter the name of the user or group to delete.
Script Actions
Else Statement
This action marks the beginning of a section of instructions to be executed when the
condition specified in the matching If Statement is false. It takes no parameters, and
selecting it from the Actions list inserts it directly into the script with no further dialog
boxes or prompts.
See also:
If Statement on page 59
ElseIf Statement
This action is used inside an If block to check for another condition. It marks the
beginning of a block of code that is executed only if the condition checked by the If
Statement is false, all previous ElseIfs are false, and this ElseIf is true. You can use one
If Statement with multiple ElseIf Statements to check for multiple conditions.
To complete the dialog box
zVariable
Select a variable from the first drop-down list, and a comparison method from the
second drop-down list.
zThe Value
Enter the value to be used in the comparison. This is case-sensitive, unless you
selected a comparison method that ignores case. If you enter variable names in this
field, include $ before the variable. You cannot use compiler variables.
Linux Package Editor Reference55
End If
End While
Script Actions
See also:
If Statement on page 59
This action marks the end of an If block. It takes no parameters, and selecting it from
the Actions list inserts it directly into the script with no further dialog boxes or prompts.
See also:
If Statement on page 59
This action marks the end of a While loop. It takes no par ameters, and selecting it from
the Actions list inserts it directly into the script with no further dialog boxes or prompts.
See also:
While Statement on page 65
Execute Program
This action runs a program on the Linux computer.
To complete the dialog box
zProgram Path
Specify the full path to the program to run, including the program file name.
Variables are allowed. If you enter the program name only, then enter the program’s
location in the Default Directory field below.
zArguments
Enter any arguments to apply to the program when it runs.
zDefault Directory
Specify the directory that should be current when the program runs. The installation
performs a Change Directory command (cd) before running the program. If
Program Path does not contain the path to the program, then enter the program
location here.
zWait for Program to Exit
Mark this to stop the installation while this program runs. Installation does not
resume until the program exits.
Execute Shell Command
This action sends commands directly to the bash shell. Use it to run Linux commands
that are not handled by any of the script actions. Example: to set up one environment
variable.
Linux Package Editor Reference56
Typically, you would use this for a single Linux command or a small number of
commands, where it would be easier to type the command than to write a script and
assign that script to a Call Script Action.
To complete the dialog box
zShell command
Enter the command to send to the bash shell.
Exit Installation
This action exits the installation.
To complete the dialog box
zExit Code
If this installation is called by another application, this is the return code to the
calling application.
Find File
Script Actions
This action searches for a file on the Linux computer. If more than one match exists,
only the first match is returned.
To complete the dialog box
zFilename
Enter the file name only, not a full path. Wildcard characters are allowed.
zVariable Name
Enter a variable in which to put the path of the file if it is found. If the file is not
found, this variable stores the Default Value specified below.
zDefault Value
Enter a value to put into the variable if the file is not found. To use an If statement
that tests the variable, leave this blank so it evaluates to false.
zSearch Directories
Enter a list of directories to search, delimited by spaces or semicolons. You can use
variables.
zRemove Filename
Mark this to remove the file name from the end of the returned path, leaving only
the directory name. This operation is not performed on the Default Value.
Get System Information
This action retrieves information about the Linux computer and stores the result in a
variable.
To complete the dialog box
zVariable
Specify the variable in which to put the retrieved value.
Linux Package Editor Reference57
zRetrieve
Select the information to retrieve:
Architecture
The type of computer. Linux Package Editor supports i386 computers only.
Current Date
This includes the time in 24-hour format. Example: Fri Mar 24 14:53:53 UTC
2006.
Current Time
The time is in 24-hour format.
File Group
The group owner of the file that is specified in Pathname.
File Modification Time
The time and date on which the file that is specified in Pathname was modified.
File Owner
The file owner of the file that is specified in Pathname.
File Size
The size in bytes of the file that is specified in Pathname.
Free Disk Space
Free disk space in megabytes of the partition for the file or directory that is
specified in Pathname.
Script Actions
Free Memory
The amount of physical RAM.
Installed Memory
The amount of physical memory.
OS
The computer’s operating system. Linux Package Editor supports Linux only.
zPathname
Use this field only for operations that retrieve information on files or directories.
Specify the full path of the file or directory to retrieve information from.
Get Temporary Filename
This action generates a unique, temporary name for a file, appends it to the /tmp path,
and puts the full path into a variable. (Example: /tmp/Wise Temp.123456.) This action is
not available for Preflight scripts.
Use the temporary name to install a file to the /tmp directory, from which it will be
deleted after the installation. (Example: Use this to install a temporary log file that is
needed only during installation.)
To complete the dialog box
zVariable
Specify a variable in which to put the temporary file na me (example: $L OGFILE). To
refer to this file elsewhere in the installation, specify the variable.
Linux Package Editor Reference58
Halt Compile
If Statement
Script Actions
This action immediately stops the compile (build) process. It must be placed between
Compiler Variable If and Compiler Variable End statements or the script will never build.
Use this to ensure that conditions are met before compiling.
To complete the dialog box
zEnter Message Text
Enter a message to display to the user if the build is stopped.
This action marks the beginning of a conditional block of script, an If block. If the
condition specified in the If Statement is true, the lines inside the If block are executed.
The If block can also contain an Else or several ElseIf actions.
To create an If block
1. Add an If Statement and complete the dialog box:
Variable
Select a variable from the first drop-down list, and a comparison method from
the second drop-down list.
The Value
Enter the value to be used in the comparison. This is case-sensitive, unless you
selected a comparison method that ignores case. If you enter variable names,
include $ before the variable. You cannot use compiler variables.
2. Below the If Statement, add one or more actions to perform if the variable has the
specified value.
3. (Optional.) Add an Else or several ElseIf actions. Follow the Else action with one or
more actions to perform if the compiler variable does not have the specified value.
4. Add an End If action.
See also:
Else Statement on page 55
ElseIf Statement on page 55
End If on page 56
Insert Line Into Text File
This action edits a text file on the Linux computer. (Example: You can add a user to the
password file.) You can insert a new line at a particular line number, or you can search
for text and insert a new line after each occurrence of the text.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
Linux Package Editor Reference59
Script Actions
To complete the dialog box
zFilename
Specify the path of the text file to edit.
zText to Insert
Enter the text to add to the file.
zLine Number
Enter the line number at which to insert the new text. Enter 0 to append to the end
of the file. Information in the Search for Text area overrides any line number that
is specified here unless the text is not found.
zSearch for Text
Enter the text to search for. If more than one line in the file matches, all the lines
are edited.
zComment Text
Enter a comment to insert after the found line. When replacing an existing line, use
this to leave the existing line in place but inactive. Set Insert Action to insert
before the existing line so that subsequent installations find and edit the active
command, not the commented line.
zInsert Action
Select the action to be taken when a line is found.
zMatch Criteria
Select how the line is matched with the text in Search for Text.
zCase Insensitive
Mark this to make the match case-insensitive.
zMake Backup File
Mark this to make a copy of the text file before editing it. A number is appended to
the end of the file name for the backup copies (example: text.001, text.002, and so
on).
Manage a Service
This action lets you manage services in the etc/rc#. d directories. You can add, delete, or
modify a service on a Linux computer. The serv ice’s startup script must be in the /etc/
init.d directory. This action is not available for Verification scripts.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
To complete the dialog box
zAction
Select either to add, delete, or modify the service.
zService Name
Enter the name of the service.
Linux Package Editor Reference60
zRunlevel
If you are adding or modifying a service, mark the runlevels in which the service
should start.
zStart Service After Adding or Stop Before Deleting
If you clear this option and you are starting a service, the service does not start
until Linux is restarted in one of the marked runlevels. If you clear this option and
you are deleting a service, the service is not stopped before it is deleted.
Post to HTTP Server
This action posts information over the Internet to a Web server. (Example: Use it to
gather information about the Linux computer during installation.)
Requirements
zYou must set up a CGI program or Active Server Page (.ASP) on the server that
accepts data sent by an HTTP POST operation and deciphers encoded characters.
zThe Linux computer must have a valid Internet connection.
To complete the dialog box
zDestination URL
Enter the URL of the CGI program or .ASP page that accepts posted data.
Script Actions
zText to Post
Enter one or more lines in the following format:
field=data
where field is the name of the fi eld as it is expected by the CGI program, and data is
the data to be sent in that field. If a line does not appear to contain a field name
followed by =, it is assumed to be a continuation of the previous line, and the data
on the two lines is concatenated and sent with a single field name.
The field name can be a variable name, but it does not have to be. Also, you can
enter a variable in place of the data. Precede the variable name with a $ and follow
standard conventions for naming Linux shell variables.
Read/Update Text File
This action either reads a text file that is on the Linux computer and writes the contents
of the file to a variable, or writes the contents of a variable to a text file on the Linux
computer.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
Linux Package Editor Reference61
Remark
Script Actions
To complete the dialog box
zPathname
Specify the full path to the text file to be read or written on the Linux computer
(example: $INSTALLDIR\File.txt).
zVariable
Specify the variable to write to or read from (example: TEXTLINE).
zAction
Select an action:
Read lines of file into variable
Reads the contents of the text file into the variable.
Write variable into text file
Writes the contents of the variable to a text file.
zMake Backup File
Mark this to make a copy of the text file before editing it. A number is appended to
the end of the file name for the backup copies (example: text.001, text.002, and so
on).
This action adds comments or blank lines to the script. Remarks are green and prefaced
by /*Rem.
To complete the dialog box
zEnter Remark
Enter the comment. To add a blank line, leave this field blank.
Rename File/Directory
This action renames or moves a file or directory on the Linux computer. This can be an
existing file or directory, or a file or directory that your installation installed. The file
must not be busy.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action ran successfully.
non-zeroThe action was unsuccessful.
To complete the dialog box
zOld Pathname
Specify the full path to the existing file or directory (examples:
$INSTALLDIR\PICTURES\picture.jpg or $INSTALLDIR\PICTURES\).
zNew Pathname
Enter the full path to the new file or directory.
Linux Package Editor Reference62
Search File for Text
This action finds a text string in a file on the Linux computer.
When the action is run, the number of occurrences found is placed in the $RETURNCODE
variable.
To complete the dialog box
zSearch File
Specify the file to search.
zSearch String
Enter the text string to search for. You can use any regular expression.
Set Variable
This action creates and modifies variables that are used in the Linux installation. A
variable can be set using a string expression, numeric expression, or logical expression .
Numeric expressions are run through the Linux bc command. Logical expressions are
run through the Linux Bash test command.
Script Actions
To complete the dialog box
zSet Variable
Specify a variable, adhering to standard conventions for naming Linux shell
variables.
zString Expression
Mark this to set the variable to part of a string that is stored in another variable.
Define the string in the String Function, Variab le Name, and Argument fields.
zString Function
Select one of the following functions to manipulate or parse text.
Note
Leaving this blank is the same as selecting Literal.
LeftSets the variable to the left portion of the string in Variable
Name
In Argument, enter the number of characters from the left
of the string to use.
RightSets the variable to the right portion of the string in
Variable Name
In Argument, enter the number of char acters from the right
of the string to use.
Linux Package Editor Reference63
Script Actions
MidSets the variable to the middle portion of the string in
Variable Name (from a specified starting point to the end of
the string)
In Argument, enter the starting point as the number of
characters from the left of the string. Example: If the string
is 12345, and you specify 2 as the starting point, this returns
2345.
ConcatJoins the string in Variable Name and the literal text or
variable value in Argument
InstrDetermines if a substring is present within an original string
In Argument, enter the substring.
BeforeReturns the portion of a string before a specified substring
In Argument, enter the substring. Example: If the string is
12345, and you specify 4 as the substring, this returns 123.
AfterReturns the portion of a string after a specified substring
In Argument, enter the substring. Example: If the string is
12345, and you specify 2 as the substring, this returns 345.
LcaseConverts all characters in the string in Variable Name to
lowercase
UcaseConverts all characters in the string in Variable Name to
uppercase
LtrimDeletes all leading spaces from the string in Variable Name
RtrimDeletes all trailing spaces from the string in Variable Name
LiteralSets the variable to the literal contents of the Argument
field
No variable substitution is made.
VariableSets the variable to the string in Variable Name
zVariable Name
The functions in String Function act on the string that is represented by the
variable you specify here.
zArgument
If the function in String Function requires an argument, enter it here. You can
enter a variable, preceded by $ and adhering to standard conventions for naming
Linux shell variables.
zNumeric Expression
Mark this to set the variable to the value of a numeric expression, which you enter
in Expression.
zLogical Expression
Mark this to set the variable to the value of a logical expression, which you enter in
Expression.
zExpression
If you select Numeric Expression or Logical Expression, enter the expression
here.
Linux Package Editor Reference64
For a numeric expression, enter a valid Linux bc command. You can use
symbols such as + and – for addition and subtraction.
For a logical expression, enter a valid Linux Bash test command. You can use -a
for an AND operation and -o for an OR operation.
Start/Stop Process
This action lets you start or stop a process on the Linux computer during installation of a
package. If you try to stop a process and want the script to pause until the process
stops, add a While Statement action to determine if the process is still running.
See While Statement.
This action is not available for Verification and Pre-Flight scripts.
When the action is run, the results are placed in the $RETURNCODE variable:
0The action to start or stop a process ran successfully.
1The file to start or the process to stop was not found.
2Permission to start the process was denied.
Script Actions
To complete the dialog box
zProcess Name
Enter the name of the process to act on.
zOperation
Select whether to start or stop the process.
While Statement
This action begins a While loop. An EndWhile action must end the loop. As long as the
condition that is specified in the While Statement dialog box is true, the script lines
inside the loop execute repeatedly. If the condition is not true, then the While loop is
exited, and the next script line is executed.
To create a While loop
1. Add a While Statement and complete the dialog box:
Variable
The Value
Select a variable from the first drop-down list, and a comparison method from
the second drop-down list.
Enter the value to be used in the comparison. This is case-sensitive, unless you
selected a comparison method that ignores case. If you enter variable names,
include $ before the variable. You cannot use compiler variables.
2. Below the While Statement, add one or more actions to perform if the variable has
the specified value.
3. Add an End While action.
Linux Package Editor Reference65
See also:
End While on page 56
Script Actions
Linux Package Editor Reference66
Index
Symbols
$INSTALLDIR, value 41
$WISEFOLDER
about 26
circular dependencies 34
value 41
A
action
about 46
adding to script 44
Also see actions by name
copying 44
pasting 44
Actions list 43
add contents of directory 27
Add Text to Install.log 47
Add User or Group 47
application file 28
archive file
building 20
importing 30
ASP 61
attributes, file 50
B
blank line in script 62
Bourne Script
editing 49
browse Linux file system 15
build
about 16
how to 16
requirements 16
stopping 59
build Linux archive file 20
build settings 41
C
call script
action 48
adding 49
checking syntax 19
global 49
local 49
tab 43
type 49
capabilities
about 31
adding 34
category, file 28
CGI 61
Change File Attributes 50
Check button 19
Check File or Directory 50
Check HTTP Connection 51
Check Process 51
Check RPM Database 51
check syntax 19
circular dependency 33
comment out lines 45
comments in scripts 62
compile
See build
compiler variable
about 40
adding to script 52
changing during build 17
referenced in script 40