From Fedora Project Wiki


什么是 Fedora Packager for Eclipse?

Fedora Packager for Eclipse 是一个自从 F14 开始为 Fedora 用户设计的 Eclipse 插件。它帮助 Fedora 打包者们在 Eclipse 中完成 Fedora 打包 RPM 的工作,而无须纠结于命令行中(大多数情况)。 可以将 Fedora Packager for Eclipse 认为是 fedpkg 的图形化界面,尽管实际上在后台并未使用它。

首先,安装 Fedora Packager for Eclipse:

$ pkcon install eclipse-fedorapackager

Fedora Packager for Eclipse 包含的部分功能为:

  • 方便的克隆 Fedora Git 项目
  • RPM .spec 文件编辑器,包含语法高亮、自动补全 Requires/BuildRequires 模板的包名、%changelog支持 (快捷键 <Ctrl>+<Alt>+C)等。
  • 下载源代码包以及上传新源代码包
  • 准备本地编译(仅执行 spec 文件中的 %prep 部分)
  • 按照当前 .spec 文件生成 SRPM 包
  • 执行本地编译
  • 推送至 Koji(Fedora 编译系统)
  • Mock 编译
  • 推送 Bodhi 更新
  • 创建一个本地 Fedora RPM 项目来简化新 Fedora 打包者的入门过程
  • Eclipse Git 支持(通过 EGit, 请参考 EGit 文档

升级至 Fedora Packager for Eclipse 0.2.0

旧版本的 Fedora Packager for Eclipse (0.1.12 及更早) 并未像 Fedora Packager for Eclipse 0.2 一样严格过滤上下文菜单内容的可见性。为了保证上下文菜单中正确的过滤,0.2.0 及更新版本在从 Fedora Git 导入项目时设定了一些固有状态。 这将会影响使用 Fedora Packager for Eclipse 0.1.12 及更早版本导入的项目上下文菜单不显示。注意我们的更新的版本包含了一个用于升级这些项目的小工具。需要的步骤如下:

1. 打开 Fedora Packaging 视图 Window => Open Perspective => Other.


2. 点击转换工具图标 (如下图所示)

Conversion Tool Icon as Shown in the Fedora Packaging Perspective

3. 在您的工作空间中选择需要升级的项目


4. 点击 OK 然后此时您选择的项目应该已经升级完毕了。

在以上步骤之后,Fedora Packager for Eclipse 的上下文菜单应该可以正常显示了。

如果您已经是维护者并且知道怎样为 Fedora 打包软件包的话,请 跳转到"使用 Fedora Packager for Eclipse" 章节

以维护者的身份创建新的 Fedora 软件包

如果您之前从未给 Fedora 打包过软件,该指南将指引您直到完成首次软件包的提交。 fedora package process



在 Fedora 账户系统中创建账户

  • 第一步是在 Fedora 账户系统 (FAS) 中创建账户。
  • 点击 新账户 并填写空白处。
  • 在创建账户之后,请确定签署了 CLA (如果您点击右上角的 我的帐户 链接的话,您应该看到 CLA: CLA Done)。
  • 您同时需要上传一个RSA SSH 公钥。您需要匹配的私钥来通过 SSH 访问 Fedora 远程主机。

创建 Bugzilla 账户

红帽 bugzilla 创建账户。

  • 对于所有的 Fedora 打包工作,您在 bugzilla 账户中使用的电子邮件地址应该和在 Fedora 账户系统 中的一致。
  • 为了让您的工作和错误追踪更加简便,有一个适用于 Eclipse 的任务管理插件叫 Mylyn。您可以根据这里的指导 You can follow these instructions on 将您的 bugizlla 账户和您 Eclipse Mylyn 插件整合起来


对于新打包者或者在未包含所需 FAS 证书的机器上只需要执行一次。如果确认已经完成过此设置并且正常的话,可以跳过此步骤。下面的步骤解释如何为 FAS 账户 设定这些证书。

  • 首先,安装 fedora-packager RPM 包:
  pkcon install fedora-packager 



如果您已经是维护者并且知道怎样为 Fedora 创建新软件包,请 跳过下个章节



创建一个 RPM 软件包:

要开始使用 Eclipse 创建一个 RPM 软件包,完成创建 本地Fedora 打包项目用户指南中的步骤。 注意您可以使用时那面三种方式之一生成您的项目:

1. Start a plain project using .spec file template or an existing .spec file.
2. Extract .spec file and resources by importing an existing SRPM file

to the project.

3. Using RPM Stubby on feature.xml or pom.xml.

After you created the project, you can use rpm build commands available through the local context menu to build the package and create SRPM file. In next step you need to submit your .spec file and your SRPM file for review.

Submiting For Review

Introduce Yourself Using Fedora Mailing Lists

When a new package maintainer joins the Fedora Project, we request that he/she stays close to upstream. Inform the developers that you are packaging the software by introducing yourself on the
To sign up for the list, visit the devel list signup page.

  • The primary purpose of this is to begin the process of building trust by learning about the package maintainer and increase the chances of your review request being processed sooner.
  • The purpose of all this is to break anonymity and foster real-world community within the project. You are under no obligation to reveal personal secrets. The objective is to establish a level of trust with yourself and the other members of the project.
Subject: Self Introduction
Body: Add any information you believe is applicable including past experience, a link to the review request you have filed and a brief description of yourself. You can also post your GPG key information if you want to.

Uploading the Package

Upload your SRPM and .spec files onto the Internet somewhere. This can be anywhere accessible by a URL.

  • If you need hosting space, please make a note of it in your ticket submission and someone will take care of you.
  • If you have already got a Fedora Account then you can use your storage at <user-name> for this.


   scp path/to/file.spec path/to/rpm-file.src.rpm <user-name> 

file.spec and rpm-file.src.rpm will then be available via the following URLs:


Creating Review Request

Before submitting your request, be sure there is not a previous request for the same package.
Fill out this form in bugzilla.

1. Make sure that you put the name of the package (excluding version and release numbers) in the Review Summary field, along with a very brief summary of what the package is.
2. Put a description of your package (usually, this can be the same thing as what you put in the spec %description) in the Review Description field.
3- Obtain member sponsorship: If this is your first package, or you are a new maintainer who is updating a package, explain it and say that you need a sponsor (you will need sponsorship to check in and build your package).To be able to get sponsored, you should enter FE-NEEDSPONSOR into the Blocks field.
Sponsorship is not automatic and may require that you further participate in other ways in order to demonstrate your understanding of the packaging guidelines.
Key to becoming sponsored is to convince an existing sponsor-level member that you understand and follow the project's guidelines and processes.
For more information check this How to get sponsored user guide.

Bugzilla Form

3. Include the URLs to your SRPM and .spec files.

Bugzilla Review

Bugzilla feedback

  • You should get notifications of changes by email. Fix any blockers that the reviewer(s) point out.

Ready to Ship

Follow these steps after your package is approved by reviewers.

Requesting a new package SCM

When the package is approved by the reviewer, request a git module and branches with the info on Source Code Management(SCM) admin requests.

  • Requests that require package administrators approval may be requested through the fedora-cvs flag in Bugzilla tickets. Changing the fedora-cvs flag to "?" in a Bugzilla report means admin attention is needed.
  • Mention the name of the branches you need your package to be included in.

Package SCM Request

Fedora Packager 导入向导

Once the Fedora Git repository has been created for you, you can import it in Eclipse.

  • Go to File > Import > Git > Projects from Fedora Git (Alternatively use keyboard short-cut CTRL+ALT+F I and enter your package name when prompted. This will clone the desired Git repository. Refer to this user guide on Using Fedora Git for more information.
  • For convenience, the Git Repositories view will also open once the clone process has finished.

Fedora Git Import

  • Here's what the Fedora Git import dialog looks like. Next, specify the package name that will then be prepared for you.

Select Package Name

  • Since you are cloning your new empty git repository, you will just see the sources file in your cloned package directory.

Updating the SCM

Importing and Committing the Package Contents

After you have checked out your empty git module, you need to import and commit your package contents into the master branch.

1. Right-click on your source files in the SOURCES folder of your local RPM project in Eclipse and click Copy.
2. Right-click on your cloned project from Fedora Git and click Paste.
3. To upload these upstream source files to the lookaside cache, right-click on them, select Fedora Packager > Upload this File > Add to Existing Sources. This adds the files to the list of source files required to build the package. Use Fedora Packager > Upload this File > Replace Sources in order to replace the current content of the sources file to contain a single line with the MD5 sum of the file selected. More information about the lookaside cache can be found in this document.
Stop (medium size).png
Do not add upstream sources (tar balls, zip files, etc.) to the Fedora Git repository. Use the lookaside cache instead!
4. Repeat steps 1-2 for your .spec file in SPECS folder.
5. To commit the package contents to the git repository, select the source file and the .spec file to commit (alternatively select the Fedora Git project and select desired unstaged files when the commit dialog is shown), right-click, Team > Commit...
  • Use this message for your initial commit: "Initial import (#nnnnnn)" (where nnnnnn is your Bugzilla package review bug number).
Stop (medium size).png
Fedora Packager for Eclipse won't let you to upload your .spec file or any other patches except your sources (tar balls, zip files, etc.) to the Fedora Git repository!

Building the Package

Closing the Bugzilla Ticket

  • If your package was built successfully, you should close it as NEXTRELEASE.

Updating Your Package

Once you have built your package locally, you can perform the following steps to update your package:

Make locally committed changes public
Push the build to Koji
Push a Bodhi update (optional)

Continue with next steps in this user-guide to be able to use all available features of Fedora Packager plug-in.

Enabling Upstream Release Monitoring

Fedora has infrastructure available for monitoring new upstream releases of the software you are packaging.

使用 Fedora Packager for Eclipse

Before continuing with this part, make sure you have read our initial setup instructions. Moreover, please make sure your FAS SSH keys are properly configured in Eclipse.

Most of the features of Fedora Packager for Eclipse are accessible via its context menu or keyboard short-cuts. The richest context menu is available if you imported a Fedora Git package. A subset of this functionality is also available for Fedora RPM projects. The former is intended for Fedora package maintainers and the latter is useful for creating a new Fedora package, which is not yet part of the Fedora distribution.

Context Menu

The Fedora Packager context menu should be available if you:

1. Right-click on a project which got imported via the Import from Fedora Git wizard or a smaller subset for projects created with the Fedora RPM Project wizard.
2. Right-click on a .spec file which is contained in a Fedora Packager project (e.g. in the Project Explorer).
3. Right-click in the .spec file itself, while editing it.

Fedora Packager for Eclipse Context Menu

Available Keyboard Short-Cuts

As of Fedora Packager 0.2 available Fedora Packager for Eclipse actions have corresponding keyboard short-cuts. All available short-cuts are shown if you press CTRL+ALT+F. Note that keyboard short-cuts work on the package which is associated with the currently open .spec file (with the exception of importing a new Fedora Git package, CTRL+ALT+F I.

Fedora Packager for Eclipse Keyboard Short-Cuts

Fedora Packager for Eclipse Actions

The following table describes all Fedora Packager for Eclipse commands in more detail.

Context Menu Item Command Name (as shown when CTRL+ALT+F was pressed) Keyboard Short-Cut Description
Push Build to Koji Koji Build CTRL+ALT+F K Pushes a regular build to Koji. Checks if there are unpushed changes in the local Git repository prior pushing the build. The build will create an SRPM based on what has been committed and pushed to the Fedora Git repository as well as based on the sources which have been uploaded to the lookaside cache. The target is determined based on the current branch (e.g. master, f15, etc). Once a build has been pushed and was successful, the package will get tagged and will become automatically available in the next Fedora release.
Perform Scratch Build Koji Scratch Build CTRL+ALT+F X Pushes a scratch build to Koji. Very similar to the above. Checks if there are unpushed changes in the local Git repository prior pushing the build. Scratch builds won't get tagged, though.
Perform Scratch Build Using Local SRPM Koji SRPM Scratch Build CTRL+ALT+F U Pushes a scratch build to Koji. Koji will use the provides SRPM for the build (i.e. it won't use anything from the Fedora Git repository or lookaside cache. As with all scratch builds, it won't get tagged.
Create New Bodhi Update Bodhi Update CTRL+ALT+F B Pushes builds which are available in Koji as an update. Updates will usually get pushed to testing and will move to the stable repository. This action checks if there are unpushed changes on the current branch and may prompt for the SSH passphrase as well as for your Eclipse secure storage master password should you have requested Eclipse to store your Bodhi password on a previous update push. It will validate your FAS credentials prior presenting you with the update dialog. The list of builds will get populated with the binary RPMs which the current .spec file produces (again, the Fedora release is based on the currently checked out branch). Additional builds to get pushed as a single update may be added manually.
Upload This File => Add to existing sources N/A N/A Uploads the currently selected file (the file on which the right-click occurred) to the lookaside cache. Appends an entry to the sources file. Only archive files should get uploaded to the lookaside cache. No text files are permitted such as .spec, .xml, .patch, etc. Add, commit and push them to the Fedora Git repository instead.
Upload This File => Replace existing sources N/A N/A Uploads the currently selected file (the file on which the right-click occurred) to the lookaside cache. Replaces any existent content in the sources file (i.e. the uploaded file will be the only entry). Only archive files should get uploaded to the lookaside cache. No text files are permitted such as .spec, .xml, .patch, etc. Add, commit and push them to the Fedora Git repository instead.
Download Sources Download CTRL+ALT+F D Downloads all files as listed in the sources file from the lookaside cache. Does not download files again if already existent in the relevant folder, unless its MD5 checksum mismatches with what's in the sources file.
Prepare Sources for Build Prep Sources CTRL+ALT+F P Execute the %prep section in the .spec file. This will download sources from the lookaside cache if sources are not yet in the containing folder. Note that this behaviour is slightly different for a Fedora RPM project, since downloading from the lookaside cache is not applicable in this case.
Create SRPM SRPM Build CTRL+ALT+F S Create an SRPM based on the current snapshot of the .spec file and the current Git branch one is on. This will download sources from the lookaside cache if sources are not yet in the containing folder. Note that this behaviour is slightly different for a Fedora RPM project, since downloading from the lookaside cache is not applicable in this case.
Build for Local Architecture Local Build CTRL+ALT+F L Build binary RPMs based on the current snapshot of the .spec file and the current Git branch one is on. This will download sources from the lookaside cache if sources are not yet in the containing folder. Note that this behaviour is slightly different for a Fedora RPM project, since downloading from the lookaside cache is not applicable in this case.
Rebuild Local SRPM in Mock Mock Build CTRL+ALT+F R Rebuild the SRPM which has to be specified by the user in a mock chroot based on the current Git branch one is on.
Build From Uploaded Sources in Mock SCM Mock Build CTRL+ALT+F M Rebuild the package in a mock chroot based on the current Git branch one is on. This will only use sources as they are available in the pushed Fedora Git repository and the lookaside cache. This won't work if the machine is offline.
Import SRPM To Repository SRPM Import CTRL+ALT+F O Takes an SRPM specified by the user, extracts its contents into the current branch, replaces the existing sources in the lookaside cache with the extracted source files, and stages any changes made to the Git repository.

As mentioned earlier, as of Fedora Packager for Eclipse 0.2 there are two options for creating Fedora packaging projects:

1. Importing an existing Fedora Git project. This should be used for package maintenance.
2. Create a new Fedora RPM project for a package not yet in Fedora

First, we'll describe how Fedora Packager for Eclipse can be used for creating a new Fedora package. This is handy if you decided to become a new package maintainer (never packaged something for Fedora before) and would like to submit a package for review. It is also useful for existing package maintainers who would like to introduce a new Fedora package. If you'd like to become a new package maintainer, the Fedora RPM Project option of Fedora Packager for Eclipse 0.2, will help you walking you through the process and will make some parts of it easier for you. For existing packager this will help expediting SRPM creation and submitting it for review.

Creating a Local Fedora RPM Project

This option should only be used if the software you'd like to package is not yet part of the Fedora distribution. If it is already part of Fedora, follow instructions here.
1. Select New > Fedora > Fedora RPM Project and click Next.
2. Type the name of your desired package name in Project name and click Next.

New Project

3. Select the option that matches you:
If you are an Existing maintainer, select this option and click Next.
If you are a New maintainer', make sure you follow all the mentioned steps to complete your account setting. Once you are finished you can type in your FAS Account ID and click Next.

New Maintainers

4. You can start the project in three different ways:
4.a. Start a plain project
If you want to upload an existing .spec file, un-check the Generate a .spec file from template option and click Browse to upload your file.
Select your .spec file and click Finish.

Plain Spec Project

If you this project does not have any .spec file yet, leave the Generate a .spec file from template checked and Click Next.
Apply any necessary changes and click Finish.
Your project content and your generated specfile should look like this:

Plain Populated Project

5. At the end of creating the project, you will be asked to open the project in the Fedora Packager Perspective.

Your project will be a local Git repository which has been initialized with the Specfile. The new repository will be automatically opened in the Git Repository View as part of the Fedora Packager Perspective.

4.b. Use existing .spec file and sources by importing SRPM file
If you have already an SRPM, you can upload it to your workspace and the Specfile and sources will be extracted from SRPM.

Srpm Project

Select your SRPM file and click Finish.
Your project content and your generated specfile should look like this:

Srpm Populated Project

4.c. Create project using Rpm Stubby
If you have an Eclipse-feature or Maven-Pom, you can select first option to start your project using RPM Stubby. From the drop down list:
Select ECLIPSE_FEATURE to upload an existing feature.xml file to your project.
Or select MAVEN_POM to upload an existing pom.xml file to your project.

Stubby Project

Select your file and click Finish.
Your project content and your generated Specfile should look like this:

Stubby populate

Local Menu

Now, you can use Fedora Packager's context menu From the main Context Menu. Few commands as is shown in this screen-shot are available to the local project to enable you to locally build your package:

Local Context Menu

导入一个 Fedora Git 项目

开始很简单的,使用 "File" => "Import" => "Git" => "Projects from Fedora Git"。这将克隆所指定的 Git 仓库并且创建需要的本地分支。方便期间,"Git Repositories" 视图将会在克隆进程结束后开启。


该图显示 Fedora Git 导入对话框的样子。下一步,指定准备打包的包名称。


下图显示的是新项目创建完成的样子。注意在 Git 仓库视图中的分支和项目右侧的 "[eclipse-fedorapackager master]" 标示。在这里,eclipse-fedorapackager 代表 Git 仓库名,master 代表当前导出的分支。


Fedora 打包工作

在 Fedora Git 项目创建完成后,为目标发行版打包所需的所有文件都可以直接在刚刚创建的 Eclipse 项目中找到。例如,为 Fedora 13 打包所需的文件都放置在分支 f13/master 中。分支 master 对应当前的 Fedora 开发版本 Fedora rawhide。下面将简要描述下打包软件所需要注意的一系列事宜。如果不按照这个顺序去做也是可以的,但是记住一定要在尝试 Koji 编译前推送本地修改到公共仓库


要在 Eclipse Fedora Packager 中上传新的源代码,首先下载上有的源代码并将下载好的的源代码和 Eclipse 项目放在同一个文件夹下。 如果这个步骤是在 Eclipse 之外完成的,别忘记刷新项目(F5)让文件被识别出来。另一个下载源代码的方式是直接使用 RPM 编辑器。查阅他的文档获取更这方面的多信息。 一旦新的源代码文件在项目中就绪,就可以上传到临时缓冲区中:右键点击文件 => "Fedora Packager" => Upload This File => Replace/Add File。这样既可以添加新文件到编译软件包,亦可以替换 sources 中的当前内容,并包含一个当前选中文件的 MD5 校验和。


$ fedora-cert -n


要为已有的软件包下载编译所需要的源代码,右键点击 spec 文件 => "Fedora Packager" => Download Sources。这将下载所有列举在 sources 部分的源代码。

使用 Spec 文件编辑器

Eclipse Fedora Packager 使用来自 Eclipse Linux Tools 项目 的 RPM Editor 和 ChangeLog 插件。举例来说,一条新的更新日志可以通过快捷键 <CTRL>+<ALT>+C 轻松的插入到 spec 文件中(当然首先应该定下合理的“更新日志”要求)。使用 <CTRL>+<SPACE> 自动补全本地安装的软件包。同时,可以使用右键点击 spec文件 => “Run Rpmlint”的方式运行 rpmline。更多的内容请察看 spec 文件编辑器视频录像: 或者 "Specfile Editor User Guide": Help => Help Contents => Specfile Editor User Guide.

提交更改到本地 Git 仓库

在添加/更改 spec 文件、补丁之后,需要将这些变化提交到仓库去。这样操作:

  1. 选择需要提交的文件(或者选择 Fedora Git Project 然后在提交对话框出现时选择需要提交的 unstaged 文件)。
  2. 右键,选择 "Team" => "Commit..."


切换分支(Git 导出)

双击需要的本地分支就可以切换分支。当前导出的分支在右侧项目名称上有标示。在切换分支前确定已经提交、还原或者隐藏了更改。参考 GitEGit 文档来了解更多这方面内容。



通过右键点击 spec 文件 => “Fedora Packager” => “Prepare Sources for Build”,Eclipse Fedora Packager 将会为本地编译下载并准备源代码。


为本地架构编译 RPM

这是测试 spec 文件是否能成功编译的好方法。一旦本地编译成功 RPM,推荐使用 {{{mock}}} 在 chroot 环境中测试编译。这两种方式 Eclipse Fedora Packager 都支持。

要进行本地编译 RPM 操作,右键点击 spec 文件 => “Fedora Packager” => “Build for Local Architecture”。RPM 编译的结果将在 Eclipse 控制台显示。

使用 mock-builds 是一个测试 spec 文件 “Requires/BuildRequires” 部分的好方法。右键点击 spec 文件 => “Fedora Packager” => “Local Build Using Mock”. 注意这将需要更长的时间(一般超过20分钟)并且需要安装 mock 软件包。方便期间,可以使用 Eclipse 的 “Run in Background” 功能。

公开本地提交的更改(Git 推送)

如果对于本地提交的变化满意的话,就可以准备将这些变化公开(发布)。 Remember, Git allows history to be rewritten before changes are made public. 参考 GitEGit 文档获得更多信息。要让本地仓库和 origin 同步:

  1. 选择 Fedora Git project
  2. 右击, "Team" => "Push..."
  3. 选择要推送的 Git 仓库(通常这将保持不变)
  4. 选择要推送的 Git 引用
  5. 执行推送操作

Git 推送对话框。

Git push dialog

选择要推送的 Git 引用。在本例中,将推送分支 masterf14/master。 记住对于 Eclipse Fedora Packager 来说来源地和目的地的 Git 引用是一样的。点击“Add all branches spec” 按钮将会把所有本地分支的修改全部推送。

Select Git References

推送编译到 Koji

如果对于 spec 文件感到满意,那么可以上传打包所需软代码、提交更改到本地仓库、推送本地更改到远程仓库。当这些都完成了之后,可以将其推送到 Koji 编译系统进行编译:右键点击 spec 文件 => “Fedora Packager” => “Push to Koji”.


Eclipse 将弹出一个包含 Koji URL 窗口以便跟踪编译状态。这是一个该消息外观的例子:



推送 Bohi 更新

在成功编译 RPM 之后,使用 Eclipse Fedora Packager 来推送该软件包的更新。要实现此目的,右键点击 spec => "Fedora Packager" => "Bodhi Update"。使用 Eclipse Fedora Packager 创建一个 Bodhi 更新的需要的信息和使用 Bodhi 网页界面的一致。一旦正确的建立的更新,将可以在 Bodhi 更新页面上察看到更新记录。同时也可以追踪更新状态。

Configure SSH in Eclipse

Before you get started with importing packages from Fedora Git, you should have your FAS SSH keys set up in Eclipse. You should do this because if Fedora Packager for Eclipse finds a ~/.fedora.cert file, it will use an SSH based clone URL with your FAS username extracted from this certificate. Note that you'll have the option of cloning anonymously anyway.

Unfortunately, Eclipse can't use your ssh-agent. Our believe is that this is because Eclipse has to run on several platforms (not just Eclipse). Since UNIX sockets are platform dependent, this may be be reason why Eclipse can't use it.

Eclipse SSH Preferences

Press CTRL+3, type "SSH2" and hit return. This should bring you to the following page:

Eclipse SSH2 Preference page

Make sure that your FAS SSH key is listed there and you can successfully unlock your key.


如果发现了一个 Eclipse Fedora Packager 的 Bug, 请汇报至 (需要 FAS 用户名)。或者,尝试在 RedHat Bugzilla 上的这个搜索来获得所有已知 Bug 的信息。谢谢!

翻译:--Lovenemesis 16:16, 27 October 2010 (UTC)