From Fedora Project Wiki

贡献角色

贡献角色
以下内容仅仅是建议,最终您以何种身份参与软件包维护,完全取决于您自身的能力。


OS 开发者

如何成为 Fedora 软件包仓库维护人员?

嗯,您已经决定好了要加入了? 本指南会引领您一步一步完成您的第一个软件包维护任务。

成为 Fedora 软件包仓库维护人员

请先完成以下要求

如果您还不知道如何构建一个 RPM 包,请先查阅以下帮助: 如何制作一个 GNU Hello World 软件包 或者更加详细的 如何制作 RPM 包

阅读 打包规定软件包命名规定

您需要十分熟悉以上内容,因为它们包含了许多十分有用的信息。当然,如果您有其它疑问,欢迎到 Packaging 邮件列表提问。

创建您的 Bugzilla 账户

请确保您有一个 Bugzilla 账户。

您的 Bugzilla 帐户注册时填写的邮箱应该与您在 Fedora 账户系统 中的用户所对应的邮箱地址保持一致。

请不要使用您专用的 @fedoraproject.org 地址
您不应该在 Bugzilla 中使用您的专用 @fedoraproject.org 邮箱地址。因为这样会导致您无法激活您的 Bugzilla 账户。如果您执意使用,请在 Fedora 基础设施客服系统 请求管理员手动连接 Bugzilla 到您的 Fedora 帐户。

创建一个 Fedora 帐户

首先在 Fedora 账户系统 新建您的个人账户。注意,它不仅用于 Bugzilla !

  1. 访问: https://admin.fedoraproject.org/accounts/
  2. 点击 'New account' 然后填写必填信息
  3. 在您创建账户后, 请确定您签署了 CLA 协议(点击右上角的 "我的账户" 链接,您应该能够看到 CLA: CLA Done)。
  4. 接着您要上传一个公共的 RSA SSH 密钥。您要使用匹配的私人密钥来通过 SSH 访问 Fedora 的账户系统。

订阅几个重要的邮件列表

您必须订阅 devel-announce 邮件列表。尽管这只是一个专为发布声明而设的低流量邮件列表,但是许多重要的开发信息都会在这里发布。

您也可以订阅 devel 邮件列表,这是个有关 Fedora 开发的讨论邮件列表,不过请注意流量比较大。

您也可以考虑订阅 package-announce 邮件列表。当软件仓库的软件有变动的时候,邮件列表会有提示。本列表流量十分高,因为每次软件包的改动都会触发系统发送邮件。

当然,查看以前的存档,请订阅 packaging 邮件列表,这是 Fedora 打包委员会 的专用邮件列表。委员们决定有关 Fedora 的软件规定。

确保您的软件包适合 Fedora 项目

注意这里有许多种加入打包者用户组的方式,而不只是通过提交一个新的软件包。请查阅 如何得到赞助 页面了解更多。

您提交的软件包可以是任意种类的开源自由软件,当然最重要的是在我们的源里面尚未被收录。在创建您的软件包之前,请确保该软件包不在软件仓库中且尚未处于被审核状态(意思是这个软件的软件包之前有人已经制作好了,正在提请官方审核)。

因此请一定完成以下4步,然后再考虑提交:

理解您的责任

Fedora 项目收录的软件包需要被经常维护。尤其是软件有安全更新时,更需要您不断地维护。作为一名 Fedora 项目的软件包维护人员,您需要明确自己的 职责 。我们鼓励您成为一个或多个软件包的 副维护人员 ,当您需要帮助时,请在 Fedora 社区的有关开发的邮件列表中寻找答案。

参阅其他意见

看看其他人提交的软件包以便学习打包技术并且熟悉相关流程。

给个提示,您可以订阅 package-review 邮件列表,所有有关软件包审核的修改都会发送至该列表。

安装客户端(Koji) 并配置证书

欲为 Fedora 和 EPEL 构建软件包,您需要使用 Koji

fedora-packager 软件包将提供相关工具帮助您;所有有关打包的工具都在这个包里面被集成了,以 root 权限安装:

yum install fedora-packager

安装完成后请以打包用户的身份(绝对不要使用 root) 来设置证书及客户端

fedora-packager-setup
证书到期
您申请的证书只有6个月的有效期。然后您必须重新申请。新的证书申请完毕后,之前的证书将永久失效。重新申请请重新运行 fedora-packager-setup

You can now use "koji" to try to build your RPM packages in the Fedora build system, even on platforms or Fedora versions you don't have. Note that you can (and definitely should) test out builds ("scratch" builds) even before your package has been approved and you have been sponsored. A simple way to do a scratch build using koji is to do this at the command line:

koji build --scratch TARGET path_to_source_RPM

Where:

  • TARGET is a distribution keyword such as f17 (for Fedora 17). You can run "koji list-targets" to see all targets. To build for the next release (rawhide), don't use "dist-rawhide" - use "fX" where X is one more than the latest stable or branched release.
  • Note that you need to supply the path to the source RPM (which ends in .src.rpm), and not a URL. (If you only have the spec file, use rpmbuild --nodeps -bs SPECFILE to create the new source RPM).

Your koji builds can only depend on packages that are actually in the TARGET distribution repository. Thus, you can't use koji to build for released distributions if your package depends on other new packages that Bodhi hasn't released yet. You can use koji to build for rawhide (the next unreleased version), even if it depends on other new packages, as long as the other packages were built for the "rawhide" as described below. If you need to build against a package that is not yet a stable released update, you can file a ticket with rel-eng at: https://fedorahosted.org/rel-eng/newticket and request that that package be added as a buildroot override. For packages in EPEL, you have to use the component epel to get the request to the right persons.

You can learn more about koji via:

koji --help            # General help
koji --help-commands   # list of koji commands
koji COMMAND --help    # help on command COMMAND

Using the Koji build system has more information about using Koji.

制作一个软件包

上传您制作的软件包

上传您制作的源代码 RPM 包和与之相匹配的 SPEC 配置文件到互联网的任意位置上。请确保其可以通过地址访问。如果您已经有了一个 Fedora 帐户,您也可以使用位于 http://fedorapeople.org 的空间来存放。 这些文件必须可被他人访问。 请不要使用网盘或者是赚钱网址来完成。 如果您是社区其中一个组的人士,可以使用 http://fedorapeople.org 的空间。请签署 CLA,并访问这里 并提交一个 "Initial package hosting request" 支持单。然后应该就可以访问了。

申请审核您提交的软件包

您需要首先点击该链接创建一个支持单:https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&format=fedora-review.

  • 在您提交审核请求之前,确保之前没有相同的包被请求。软件包审核进度跟踪器 有很方便的搜索功能。
  • 确保 软件包 (除去版本号) 在 'Review Summary' 栏目中同时有一个简短的介绍
  • 在 'Review Description' 中加上 description 中(通常情况下跟 %description 一致)。包括 SRPMSPECURLs
  • 在审核请求中注明这是您的第一个软件包,同时您需要担保人。包含越多的信息越好。如果您参与过其它软件包的审核工作,请附上相应链接。如果您是上游开发者,也请注明。
  • 链接一个成功的 koji 构建是为您的审核通过加分的好方法。
Make sure that you mention in the 'Review Description' field that this is your first package, and you are seeking a sponsor. In Fedora Package Collection, all new contributors must be sponsored. Some potential sponsors will look at the FE-NEEDSPONSOR bug in bugzilla to find packages to review. You can add your package to this list by editing your review request bug and adding FE-NEEDSPONSOR in the 'Bug xyz blocks' field (where xyz is the bug number for your review request).

具体我们是如何审核您制作的软件包的,请访问 软件包审核流程 介绍页面。

通知上游相关人员

Fedora 项目 与上游项目保持紧密联系 。通知上游项目的开发者是您打包工作的一部分。 您可以通过给开发者发送一封邮件介绍一下您自己和当前软件包的审核进度,这么做也为日后会话提供一个舞台。 这些上游开发者通常很愿意看到自己的软件成为 Fedora 的一部分的事实,他们或续也会通知您已知的 Bug 和未来的开发路线图等等。

介绍自己

当一位新人加入 Feodra 软件包维护项目时,我们需要您在 devel 邮件列表介绍一下您自己。请先访问 devel ,然后加入订阅。我们需要您这么做的主要目的是建立大家之间的信任,当然这也有助于大家了解您,以及增加您的软件包被审核成功的几率。

我们这么做还为了打破匿名氛围,并且培养一个项目内的真实世界。您不必透露自己的一些秘密,我们的目标只是建立成员间的友谊。

自我介绍信格式:

邮件主题: Self Introduction: 您的姓名

正文: 您想些什么都可以,建议附上您的 GPG 密钥代码。

留意用户反馈

初次加入请注意 Bugzilla 的报告。一旦用户有反馈,您会收到相关邮件。 尽可能修复用户提出的 Bug 。

安装配置软件包构建工具 Koji

如果您想要为 Fedora 软件仓库或者 EPEL 打包软件,您需要 使用 Koji 构建系统。 您也需要 生成一个适用于 Fedora 账户系统的客户端证书,并把它保存至 ~/.fedora.cert,这样 fedpkg 将会从这里查找它。

证书到期
您申请的证书只有6个月的有效期。然后您必须重新申请。新的证书申请完毕后,之前的证书将永久失效。

fedora-packager 工具包含了所有您在 Fedora 上做打包工作需要的工具。请通过 yum 安装:

yum install fedora-packager

使用一般用户生成配置:

fedora-packager-setup

重新申请证书后的操作
每次证书过期时您都需要重新申请新证书,并且每次保存完新证书后您需要重新运行 fedora-packager-setup

您现在可以使用 "koji" 来试着针对不同架构和不同发行版本(必须是 Fedora 的不同版本)构建您自己的 RPM 包了。Note that you can test out builds ("scratch" builds) even when your package hasn't been approved and you don't have a sponsor. A simple way to do a scratch build using koji is to do this at the command line:

koji build --arch-override=PLATFORM --scratch TARGET path_to_source_RPM

术语解析:

  • PLATFORM is a platform keyword such as i386 (32-bit), x86_64, ppc, or ppc64. You can omit --arch-override=PLATFORM, in which case koji will do test builds on all the architectures the spec file says the package supports.
  • TARGET is a distribution keyword such as dist-f9 (for Fedora 9). You can run "koji list-targets" to see all targets. To build for the next release (rawhide), don't use "dist-rawhide" - use "dist-fX" where X is one more than the latest stable release.
  • Note that you need to supply the path to the source RPM (which ends in .src.rpm), and not a URL. (If you only have the spec file, use rpmbuild --nodeps -bs SPECFILE to create the new source RPM).

Your koji builds can only depend on packages that are actually in the TARGET distribution repository. Thus, you can't use koji to build for released distributions if your package depends on other new packages that Bodhi hasn't released yet. You can use koji to build for rawhide (the next unreleased version), even if it depends on other new packages, as long as the other packages were built for the "rawhide" as described below. If you need to build against a package that is not yet a stable released update, you can file a ticket with rel-eng at: https://fedorahosted.org/rel-eng/newticket and request that that package be added as a buildroot override. For packages in EPEL, you have to use the component epel to get the request to the right persons.

koji 的更多命令帮助:

koji --help            # General help
koji --help-commands   # list of koji commands
koji COMMAND --help    # help on command COMMAND

使用 Koji 构建系统 有更多使用方面的信息。

得到认可

When the package is APPROVED by the reviewer, you must separately obtain member sponsorship in order to check in and build your package. 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.

See how to get sponsored into the packager group for more information on the process of becoming sponsored.

Review and approval for the first package for new packagers must be done by registered sponsors. Subsequent reviews can be done by any package maintainer. Informal reviews can always be done by anyone interested.

Your sponsor can add you to the packager group. You should receive email confirmation of your sponsorship.

Add Package to Source Code Management (SCM) system and Set Owner

If you are becoming a maintainer for a new package, instead of being a co-maintainer, follow Package SCM admin requests to get a module for your new package and branches for recent releases.

This will be used to set up the proper records in the owners database, which is used for access to build the package, bugzilla population, and other features. This step creates a module in the repository your new package, with branches for each requested distribution.

Check out the module

You could check out your module now, but before doing that, consider doing "mkdir ~/fedora-scm ; cd ~/fedora-scm" - that way, all your files are inside that. Also, run ssh-add, so that you won't have to keep typing in your key password.

Running ssh-add before doing any SCM operations is a very good idea. It will save you from having to type your key password for every operation. You only have to run ssh-add once per session, it will remember it until you log out or reboot. If "ssh-add" reports "Could not open a connection to your authentication agent.", start a new shell under it using "exec ssh-agent bash".

Now you are ready to checkout your module from the SCM:

 fedpkg clone <packagename>

Where <packagename> should be replaced with the name of your package.

If this step fails, be sure your private ssh key (~/.ssh/id_rsa) mode is set to 0400. You might have to wait for up to an hour after your request for a new git module has been approved to get write access. Make sure your public key is the same as in the Fedora Accounts System (FAS). Key propagation may take an hour or so after uploading into FAS
Note that fedpkg does not set the user config for your new git repo automatically. Make sure to have these set globally or locally in your new repo before you do your first commit (see [1]).
Note: If you are not a member of the fedora packager group, you will receive a "permission denied" error. Use the -a flag to clone anonymously.

测试您制作的软件包

请参考 Using_Mock_to_test_package_buildsUsing_the_Koji_build_system#Scratch_Builds 以了解更详细的信息。注意 Mock 使用您的本地环境构建,而 Koji 则使用 Fedora 在线构建系统构建。

导入、提交并构建您的软件包

现在您已经使用 fedpkg 签出您的软件包模块(可能是空的),cd 进入模块主支:

cd 软件包名

运行 fedpkg 导入 SRPM 进 SCM:

fedpkg import SRPM路径
# Review Changes, press 'q' to stop; Revert with: git reset --hard HEAD
git commit -m "Initial import (#XXXXXX)."
git push
fedpkg build

XXXXXX 是审核请求的 Bugzilla 编号。

这将导入所有 commit 的内容和仅针对 master (rawhide) 支的构建。

如果 commit 有以下错误信息产生:

W access for why DENIED to YOUR_ACCOUNT
fatal: The remote end hung up unexpectedly
Could not push: Command '['git', 'push']' returned non-zero exit status 128

这就意味着您没有权限修改该分支。请访问 https://admin.fedoraproject.org/pkgdb/acls/name/相应的软件包名 来获取。


更新软件包分支(如果需要)

分支通常是这样命名 f# (formerly F-#。曾经使用 FC-#), master等等。所以 f41 是 Fedora 41 的分支。

首先切换至一个分支:

fedpkg switch-branch BRANCH (e.g. f41)

从 master 主支合并初始 commit,在分支内创建一个相同的 commit:

git merge master

推送修改至服务器:

git push

构建:

fedpkg build

If there is another branch to work with repeat "To switch to a branch" and import and commit to each branch

Be sure that you build for rawhide (master) branch before pushing updates for any other branches! Otherwise, those updates will get inherited into rawhide, which is almost certainly not what you want.
同步到构建服务器需要一段的时间,因此有时您可能需要1个小时才能够执行 "fedpkg build"

如果所有事情都没有问题,那么您的分支就已经入构建队列,软件包将会被干净的构建,然后就大功告成了!

如果构建失败,构建系统将会发送一封邮件给您,报告失败的缘由,并显示相关日志。您需要提交修改,更新 SPEC 文件的版本号,并重新请求新的构建。

在 Bodhi 中提交软件包更新

Fedora 有一个更新系统叫做 Bodhi ,它被用作推送更新、ushing updates, 给软件包分类等等。请不要通过 bodhi 提交 "master" (也就是 rawhide) 软件包。

您可以使用这个命令推送更新至每一个分支:

 fedpkg update

您也可以直接使用 "bodhi" 命令来完成,详见 Bodhi 介绍手册

您还可以使用 Bodhi 的网页界面 为每个 Fedora 版本请求功能增强更新。

The first field asks for the name of the "Package". This field will auto-complete the package name found in the Koji build system, e.g. <package-name>-<version>-<release>.fc16. If completion doesn't work, just enter the package build name yourself.

For new packages, choose "newpackage" as the "type" of update.

Put the "Request" as "testing" if you want to put the package through testing first, see Fedora Quality Assurance . Put "stable" if you want to push the package directly to stable.

Put the bug number of the package's Review Request in the "Bugs" field blank. Bodhi will automatically close it as NEXTRELEASE when it gets pushed to the requested update status.

For new packages, add a copy of the package's description in the "Notes" section, so end users will know what the package is.

Bodhi 介绍手册在此。

在您通过 bodhi 提交更新后,您的软件包就已进入队列。过一段时间,一位管理员会检查队列并推送至相关的源中。

Make the package available in "comps" files

If appropriate for the package, make it available in "comps" files so that it can be selected during installation and included in yum's package group operations. See PackageMaintainers/CompsXml for more info.

等待源最后更新

Fedora 有相关可用的基础设施检测您打包的新版本上游软件。请参阅 Upstream Release Monitoring 以了解更多。阅读 Package update HOWTO 了解我们如何处理软件包更新。

得到帮助

我们也知道这项工作有时候真的很烂,但是我们一直尝试把它做得更好。如果您陷入问题的怪圈中,请到 devel 邮件列表或者位于 freenode.net 的 IRC 频道 #fedora-devel[?] 提问。

Fedora 担保人项目将会有许多人帮助您来参与到打包中。担保人项目页面 有更多信息供您参考。 您也可以查阅 using git FAQ for package maintainers

维护一个在仓库中已存在的软件包

如果您已经参与维护仓库中的一个软件包,并且有意愿维护另一个时,请查阅这个:指南 以完成您的心愿。