Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Linux Tools Project/SpecfileEditor/User Guide
Contents
Overview
The Specfile Editor Plug-in for Eclipse provides useful features to help developers manage .spec
files. This plug-in allows users to leverage several Eclipse GUI features in editing .spec
files, including outline/quick outline view in the editor, auto-completion, highlighting, file hyperlinks, and folding.
In addition, the Specfile Editor Plug-in also integrates the rpmlint
tool into the Eclipse interface. rpmlint
is a command-line tool that helps developers detect common RPM package errors. The richer visualization offered by the Eclipse interface helps developers quickly detect, view, and correct mistakes reported by rpmlint
.
Installing
In order for the Specfile Editor Plug-in for Eclipse to work, you should have the rpmlint
package installed.
Once the rpmlint
package is installed, the easiest way to install the Valgrind plug-in for Eclipse is through the Software Updates and Add-ons menu. For information on how to use this menu, refer to http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHelp.
General Usage
To fully benefit from all the features offered by the Specfile Editor, ensure that your .spec
file is part of a project inside the Eclipse workspace. rpmlint
integration, file hyperlinks, and some auto-completion features are not available otherwise. The following screenshot provides an impression of the full interface benefits provided by the Specfile Editor plug-in:
Creating a New Specfile
The Specfile Editor plug-in provides a wizard for creating new .spec
files. To use this wizard, navigate first to File > New > Other... ; then, expand the RPM Wizards entry to select New specfile based on a template.
This will open the Specfile Creation wizard, which provides an interface for generating the basic contents of a .spec
file.
The Specfile Creation wizard contains the following fields:
- Project
- Select a template
- Version
- Summary
- Group
- License
- URL
- Source0
- This field associates the generated
.spec
with a project in the current workspace, which ultimately specifies where the .spec
will be saved. The Select a project... button allows you to select a specific project for this field with ease. By default, the Specfile Editor plug-in specifies the last active project when you invoked the Specfile Creation wizard.- This drop-down list allows you to select a
.spec
template to use. You can install templates provided by rpmdevtools
, which is available https://fedorahosted.org/rpmdevtools .- This fills in the
Version:
line of the .spec
file.- This fills in the
Summary:
line of the .spec
file.- This drop-down list allows you to select a package group to which the project belongs.
- This fills in the
License:
line of the .spec
file.- This fills in the
URL:
line of the .spec
file, which typically specifies the public home page of the project.- This field specifies the source archive from which the package is built.
rpmlint
To enable rpmlint
warnings, right-click on the project containing the .spec
file. Then, select Add/Remove rpmlint warnings from the context menu. You can use this menu selection to disable rpmlint
warnings as well.
Enabling rpmlint
warnings will add a new rpmlint
builder to the project. This rpmlint
builder checks the .spec
file during each project build or clean. Afterwards, the builder displays any appropriate warnings and errors in the Problems pane. Each warning/error is plotted in the .spec
file as well; clicking an rpmlint
warning/error in the Problems pane will automatically place the insertion point on the corresponding section in the .spec
file.
Quick Fixes
You can also directly resolve several warnings and errors through the Quick Fix menu. To access this menu, right-click on a warning or error from the Problems pane and select Quick Fix.
As the name suggests, the Quick Fix menu provides you with quick solutions to common .spec
file errors and problems. For example, rpmlint
detected a no-cleaning-of-buildroot
error in the following %install
section from the .spec
file:
If the Quick Fix menu can provide a solution for a particular error, it will be available in the menu. To apply it, simply select the solution (from the Select a fix: area) and the corresponding problem (from the Problems: area), then click the Finish button.
The following screenshot shows the revisions to the %install
section applied by the Quick Fix menu:
Configuring Specfile Editor Settings
To configure Specfile Editor settings, navigate to Window > Preferences. Then, from the left pane of the Preferences menu, select Specfile Editor.
Upon selecting the Specfile Editor menu, you can configure the format and locale of Changelog entries. To edit the actual content of your Changelogs, click the ChangeLog hyperlink in the menu, or use Ctrl
+Alt
+C
(outside of the Preferences menu).
Macro Completion
Macro definitions enable the Specfile Editor to properly highlight and autocompile .spec
files. The Macro Completion sub-menu allows you to add/remove macro definitions and configure how the Specfile Editor should present macro values during mouse hovers.
The Macro Definitions section shows what macros the Specfile Editor is using. You can add, delete, and reorder macros using the buttons to the left of this section.
The Mouse hover content section enables you to specify what kind of information about a macro value whenever you hover your mouse over it. You can choose whether to display the contents or description of a macro value. The following screenshots illustrate the difference between both options:
RPM Completions
The RPM Completions section allows you to configure generic package list settings. This section allows you to use distribution-specific references which supplement auto-completion in editing .spec
files. These distribution-specific references include a list of installed RPM packages as well as online repositories.
RPM Completions configures the following settings:
- Whether to use
rpm
oryum
to build the package list - The path to the package list file
- Whether or not to automatically build the RPM packages proposals list
- When to refresh package list (Proposals RPM list build rate)
If you are using Eclipse on a Linux distribution that uses neither rpm
nor yum
, then auto-completion (for packages) will refer directly to the installed packages.
Package Information
This sub-section of RPM Completions allows you to configure what package details (i.e. RPM tags) to display during mouse hovers over appropriate values. Package Information also lets you set the number of packages to show details for.
Package Information contains a checklist of RPM tags (e.g. Name, Version, Release) the Specfile Editor should display during mouse hovers on package information in the .spec
file. It also allows you to set a threshold for the number of proposals that enables the Specfile Editor to display this information. By default, the threshold is 10.
Rpmlint
The Rpmlint section allows you to configure where rpmlint
is installed, which is useful if it is installed somewhere other than the default /usr/bin/rpmlint
. This section also allows you to set whether warnings should be used for tabs or spaces, which is useful if they are used in a mixed mode in the .spec
file.
Task Tags
The Task Tags section allows the Specfile Editor to identify specific strings as task tags. The Specfile Editor will only search for these strings in comments. By default, the Specfile Editor identifies the strings TODO
and FIXME
as task tags.
Whenever the Specfile Editor finds a task tag in the .spec
file, it adds the tag to the Tasks view and plots an appropriate marker in the editor. Clicking the tag in the Tasks view will automatically place the insertion point on the corresponding string in the .spec
file.
Templates
The Templates section allows you to share and manage different .spec
file directive/section templates for all contexts.
The Import and Export functions allow you to share templates with other developers who may also be working on the same package. The New and Edit buttons open a menu for adding or revising templates; they both contain the same options.