From Fedora Project Wiki

(→‎Example for this method: rhbz 619979 is fixed)
Line 35: Line 35:
fedpkg build
fedpkg build
</pre>
</pre>
{{admon/tip|Bug on packages with just a "master" branch|Warning! There's currently a bug in ''fedpkg'' which prevents importing/uploading new sources if all you have is a "master" branch, with no "f-N" branches.  The symptoms are
<pre>
Traceback (most recent call last):
  File "/usr/bin/fedpkg", line 1062, in <module>
    args.command(args)
  File "/usr/bin/fedpkg", line 483, in import_srpm
    mymodule = pyfedpkg.PackageModule(args.path)
  File "/usr/lib/python2.6/site-packages/pyfedpkg/__init__.py", line 857, in
__init__
    self.distval = self._findmasterbranch()
  File "/usr/lib/python2.6/site-packages/pyfedpkg/__init__.py", line 807, in
_findmasterbranch
    return(int(fedoras[-1].strip('f')) + 1)
IndexError: list index out of range
</pre>
See bug 619979 for more information, and a workaround.}}


=== How do I add a new package? ===
=== How do I add a new package? ===

Revision as of 07:48, 2 January 2014

How do I update an existing package?

Refer to How to update a package.

How do I import a SRPM package?

As an alternative, you can import a complete SRPM (.src.rpm) package to update an existing package, using a similar procedure to the initial package import.

The fedpkg tool (from the Package-x-generic-16.pngfedora-packager package) can commit entire src.rpm contents in one step. It uploads new tarballs into lookaside cache, updates a working copy of the last version found in git, and commits all changes. In case you prepare your update packages in an ordinary rpmbuild tree, you can use the script to import a finished update src.rpm in one step. Examples:

fedpkg import ~/rpm/SRPMS/foo-1.0-2.src.rpm
fedpkg import -b f14 ~/bar-2.1-1.src.rpm

Run the command fedpkg import --help for the options it understands. It can also update modules in branch directories other than the default master.

Be careful, since fedpkg can also create non-existing git modules in the master branch on-the-fly. According to current policies, the creation of new modules needs approval. (Changed names here only -- is this accurate? --pfrields 21:33, 31 July 2010 (UTC))


Example for this method

Idea.png
Blind spots
Warning! This way may look easier, but it's not recommended because you can't check the changes that you have made against the version in git before you commit them. People have accidentally overwritten other packages with this method. Please make yourself familiar with above description.
fedpkg clone foo
cd foo
# You're on the master branch right now.
fedpkg srpm
# <install the resulting srpm with the usual commands and modify it>
# commit your changes:
cd foo
fedpkg import -b <branch_name> ~/rpmbuild/SRPM/<package_name>-<version>-<release>.src.rpm
fedpkg switch-branch <branch_name>
git pull
fedpkg build

How do I add a new package?

Please refer to the new package process for existing contributors and the 'Import of complete src.rpm packages' section above.

How do I add a new branch?

Refer to Package SCM Admin Requests.

How do I remove a branch?

(Would this use git branch -d? --pfrields 21:33, 31 July 2010 (UTC))

How do I make changes to an older branch?

Here is the scenario: you've build your package successfully on the f14 branch, but there is a problem keeping your package from building on f13.

Solution: make your changes in the branch and then add a digit to the very right of the release tag. There is no need to change the release in the other branches. This allows upgrades to work smoothly if the user upgrades to a newer release of Fedora.

Name:    foo
Version: 1.0
Release: 1%{?dist}

Name:    foo
Version: 1.0
Release: 1%{?dist}.1

Then tag and build as usual.

Refer to https://www.redhat.com/archives/fedora-extras-list/2006-May/msg00083.html for more information.

How do I request a build?

Use the fedpkg build command.

Detailed information about the Fedora build system is at Using the Koji build system.

I have an account but I can't connect to git via ssh

The fedpkg tool clones repositories using the ssh:// protocol, so this should not be a problem normally. If you cloned using the git utility itself, check the .git/config file to ensure the remote repository is being accessed via an ssh:// protocol, and not git://.

How do I update/import a new branch?

If a new branch is created on the server side, git pull should be able to pull the new branch.

Hints

Reusing the changelog

  • Use fedpkg clog to extract the last spec changelog entry and store it in a local "clog" file. Include this file as the git commit log message. This can be done with the following commands:
fedpkg clog
fedpkg commit -F clog

Expired Certificates (Error 255 or OpenSSL.SSL.Error)

This error usually means that your client certificate (~/.fedora.cert) has expired, so you need to run fedora-cert to get a new one.

You may need to rerun fedora-packager-setup from the fedora-packager package, especially if you get the error:

<class 'OpenSSL.SSL.Error'>: [('SSL routines', 'SSL3_READ_BYTES', 'sslv3
]alert certificate expired'), ('SSL routines', 'SSL3_WRITE_BYTES', 'ssl
handshake failure') 

Remove your ~/.fedora-server*ca.cert and rerun fedora-packager-setup if you get the error:

Error: [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate
verify failed')]