fedpkg

Para los empaquetadores, una necesidad, aprender a usar fedpkg.

$ fedpkg -h
usage: fedpkg [-h] [-u USER] [--path PATH] [-v] [-q]

              {clog,co,help,mockbuild,sources,diff,gimmespec,switch-branch,build,import,verrel,local,prep,tag-request,clean,build_common,clone,lint,update,unused-patches,new,scratch-build,new-sources,upload,patch,compile,install,push,commit,srpm,chain-build}
              ...

Fedora Packaging utility

optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER
  --path PATH           Directory to interact with instead of current dir
  -v                    Run with verbose debug output
  -q                    Run quietly only displaying errors

Targets:
  {clog,co,help,mockbuild,sources,diff,gimmespec,switch-branch,build,import,verrel,local,prep,tag-request,clean,build_common,clone,lint,update,unused-patches,new,scratch-build,new-sources,upload,patch,compile,install,push,commit,srpm,chain-build}
    help                Show usage
    build               Request build
    chain-build         Build current package in order with other packages
    clean               Remove untracked files
    clog                Make a clog file containing top changelog entry
    clone               Clone and checkout a module
    co                  Alias for clone
    commit              Commit changes
    compile             Local test rpmbuild compile
    diff                Show changes between commits, commit and working tree,
                        etc
    gimmespec           print spec file name
    import              Import content into a module
    install             Local test rpmbuild install
    lint                Run rpmlint against local build output
    local               Local test rpmbuild binary
    mockbuild           Local test build using mock
    new                 Diff against last tag
    new-sources         Upload new source files
    patch               Create and add a gendiff patch file
    prep                Local test rpmbuild prep
    push                Push changes to remote repository
    scratch-build       Request scratch build
    sources             Download source files
    srpm                Create a source rpm
    switch-branch       Work with branches
    tag-request         Submit last build as a releng tag request
    unused-patches      Print list of patches not referenced by name in
                        specfile
    update              Submit last build as an update
    upload              Upload source files
    verrel              Print the name-version-release

Nueva aplicación (fwsnort)

Aún aprendiendo, algunas notas ligeras.

$ fedpkg clone fwsnort
$ cd fwsnort
$ fedpkg import ~/rpmbuild/SRPMS/fwsnort-1.0.6-7.fc12.src.rpm
$ fedpkg commit
$ fedpkg push
$ fedpkg build

Adoptando un huérfano (rubygem-state_machine)

$ fedpkg clone rubygem-state_machine
$ fedpkg import ~/rpmbuild/SRPMS/rubygem-state_machine-0.9.4-1.fc13.src.rpm 
...
 Summary:       Adds support for creating state machines for attributes on a
 Name:          rubygem-%{gemname}
-Version:       0.8.0
+Version:       0.9.4
 Release:       1%{?dist}
 Group:         Development/Languages
 License:       MIT
@@ -40,7 +40,6 @@ rm -rf %{buildroot}
 %defattr(-, root, root, -)
 %doc %{geminstdir}/examples
 %{geminstdir}/lib
-%{geminstdir}/tasks
 %{geminstdir}/test
 %dir %{geminstdir}
 %doc %{gemdir}/doc/%{gemname}-%{version}
...
 %changelog
+* Tue Aug 10 2010 Guillermo Gomez <gomix@fedoraproject.org> - 0.9.4-1
+- Release 0.9.4 of state_machine.
+
 * Mon Aug 17 2009 Darryl Pierce <dpierce@redhat.com> - 0.8.0-1
 - Release 0.8.0 of state_machine.

diff --git a/sources b/sources
index 4c43eda..c9f507d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-40d39370832a1f10dc40acb20f418947  state_machine-0.8.0.gem
+1c054ebba63069e57c9b4cb27f301aca  state_machine-0.9.4.gem
--------------------------------------------
New content staged and new sources uploaded.
Commit if happy or revert with: git reset --hard HEAD

$ fedpkg commit
[master a896a7e] rubygem-state_machine 0.9.4 release
 3 files changed, 6 insertions(+), 3 deletions(-)

$ fedpkg push
Counting objects: 9, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 637 bytes, done.
Total 5 (delta 1), reused 0 (delta 0)
To ssh://gomix@pkgs.fedoraproject.org/rubygem-state_machine
   85a74c7..a896a7e  master -> master

$ fedpkg build
Created task: 2392195
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2392195
...
  0 free  0 open  4 done  0 failed

2392195 build (dist-rawhide, /rubygem-state_machine:a896a7e9c2606874b542e829f6fc44eff0b253d7) completed successfully

Cambiando de rama

Para cambiar de rama mi proceder es así:

$ fedpkg clone rubygem-state_machine
...
$ cd rubygem-state_machine
$ fedpkg switch-branch f14
$ fedpkg import /home/makerpm/rpmbuild/SRPMS/rubygem-state_machine-0.9.4-2.fc13.src.rpm  
$ fedpkg commit
$ fedpkg push
$ fedpkg build
$ LANG=en_US.UTF-8 fedpkg update # BUG de bodhi con el entorno

Etiquetas de ramas actuales para fedpkg:

  • el5
  • el6
  • f13
  • f14
  • f15

fedpkg commit

$ fedpkg commit -m "Updated version 1.6.2" 
[master 5303351] Updated version 1.6.2
 3 files changed, 22 insertions(+), 17 deletions(-)

fedpkg update

Una vez que tenga su paquete construido en bodhi (builds), puede crear updates desde fedpkg con:

$ fedpkg update

[ fwsnort-1.6.2-1.fc16 ]

# bugfix, security, enhancement, newpackage (required)
type=enhancement

# testing, stable
request=testing

# Bug numbers: 1234,9876
bugs=

# Description of your update
notes=Updated version 1.2.6

# Enable request automation based on the stable/unstable karma thresholds
autokarma=True
stable_karma=3
unstable_karma=-3

# Automatically close bugs when this marked as stable
close_bugs=False

# Suggest that users restart after update
suggest_reboot=False

:q

Creating a new update for  fwsnort-1.6.2-1.fc16 
Password for gomix: 
Creating a new update for  fwsnort-1.6.2-1.fc16 
Update successfully created
================================================================================
     fwsnort-1.6.2-1.fc16
================================================================================
    Release: Fedora 16
     Status: pending
       Type: enhancement
      Karma: 0
    Request: testing
      Notes: Updated version 1.6.2
  Submitter: gomix
  Submitted: 2012-05-26 18:50:23
   Comments: bodhi - 2012-05-26 18:50:26 (karma 0)
             This update has been submitted for testing by gomix.

  https://admin.fedoraproject.org/updates/fwsnort-1.6.2-1.fc16

fedpkg scratch-build

$ fedpkg scratch-build 
Building fwsnort-1.6.2-1.fc16 for f16-candidate
Created task: 4104403
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=4104403
Watching tasks (this may be safely interrupted)...
4104403 build (f16-candidate, /fwsnort:0883256093287fca2032a61953ddf206c6703759): open (x86-07.phx2.fedoraproject.org)
  4104404 buildSRPMFromSCM (/fwsnort:0883256093287fca2032a61953ddf206c6703759): open (x86-14.phx2.fedoraproject.org)
  4104405 buildArch (fwsnort-1.6.2-1.fc16.src.rpm, noarch): open (x86-05.phx2.fedoraproject.org)
  4104404 buildSRPMFromSCM (/fwsnort:0883256093287fca2032a61953ddf206c6703759): open (x86-14.phx2.fedoraproject.org) -> closed
  0 free  2 open  1 done  0 failed
...

fedpkg build

$ fedpkg build
Building fwsnort-1.6.2-1.fc15 for f15-candidate
Created task: 4104419
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=4104419
Watching tasks (this may be safely interrupted)...
4104419 build (f15-candidate, /fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452): open (x86-18.phx2.fedoraproject.org)
  4104420 buildSRPMFromSCM (/fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452): free
  4104420 buildSRPMFromSCM (/fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452): free -> open (x86-16.phx2.fedoraproject.org)

  4104420 buildSRPMFromSCM (/fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452): open (x86-16.phx2.fedoraproject.org) -> closed
  0 free  1 open  1 done  0 failed
  4104421 buildArch (fwsnort-1.6.2-1.fc15.src.rpm, noarch): free
  4104421 buildArch (fwsnort-1.6.2-1.fc15.src.rpm, noarch): free -> open (x86-04.phx2.fedoraproject.org)
  4104421 buildArch (fwsnort-1.6.2-1.fc15.src.rpm, noarch): open (x86-04.phx2.fedoraproject.org) -> closed
  0 free  1 open  2 done  0 failed
  4104423 tagBuild (noarch): free
  4104423 tagBuild (noarch): free -> open (x86-16.phx2.fedoraproject.org)
  4104423 tagBuild (noarch): open (x86-16.phx2.fedoraproject.org) -> closed
  0 free  1 open  3 done  0 failed
4104419 build (f15-candidate, /fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452): open (x86-18.phx2.fedoraproject.org) -> closed
  0 free  0 open  4 done  0 failed

4104419 build (f15-candidate, /fwsnort:8f6bf513587cbcac63896d1ed9657d3dd2013452) completed successfully

fedpkg clone a la clásica

Clona los repositorios remotos al estilo por carpetas/directorios.

$ fedpkg clone -B fwsnort
Cloning into bare repository /home/gomix/tmp/fwsnort/fedpkg.git...
remote: Counting objects: 41, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 41 (delta 19), reused 0 (delta 0)
Receiving objects: 100% (41/41), 5.49 KiB, done.
Resolving deltas: 100% (19/19), done.

$ cd fwsnort
$ ls
el5  el6  f12  f13  f14  master
$ fedpkg clone -B rubygem-state_machine
Cloning into bare repository /home/gomix/tmp/rubygem-state_machine/fedpkg.git...
remote: Counting objects: 109, done.
remote: Compressing objects: 100% (71/71), done.
remote: Total 109 (delta 41), reused 68 (delta 29)
Receiving objects: 100% (109/109), 12.92 KiB, done.
Resolving deltas: 100% (41/41), done.
[gomix@movix tmp]$ cd rubygem-state_machine/
[gomix@movix rubygem-state_machine]$ ls
el5  el6  f10  f11  f12  f13  f14  f15  master

Trabajando en rawhide/master:

[gomix@movix rubygem-state_machine]$ cd master/
[gomix@movix master]$ fedpkg import /home/makerpm/rpmbuild/SRPMS/rubygem-state_machine-0.9.4-5.fc14.src.rpm
...
[gomix@movix master]$ fedpkg push
Counting objects: 9, done.
...
[gomix@movix master]$ fedpkg build
Building rubygem-state_machine-0.10.3-1.fc16 for dist-rawhide
...

Retirando una rama

$ fedpkg clone mediawiki114
$ fedpkg switch-branch -l
$ fedpkg switch-branch origin/el4
$ fedpkg retire
$ fedpkg push

Entonces vaya a fedorapackages y retire los paquetes allí (o simplemente siga las indicaciones en http://fedoraproject.org/wiki/How_to_remove_a_package_at_end_of_life ).

Ayuda general

$ fedpkg help
usage: fedpkg [-h] [--config CONFIG] [--dist DIST] [--user USER] [--path PATH]
              [-v] [-q]

              {help,build,chain-build,clean,clog,clone,co,commit,ci,compile,diff,gimmespec,gitbuildhash,giturl,import,install,lint,local,mockbuild,mock-config,new,new-sources,patch,prep,pull,pus
h,scratch-build,sources,srpm,switch-branch,tag,unused-patches,upload,verify-files,verrel,retire,tag-request,update}
              ...

optional arguments:
  -h, --help            show this help message and exit
  --config CONFIG, -C CONFIG
                        Specify a config file to use
  --dist DIST           Override the discovered distribution
  --user USER           Override the discovered user name
  --path PATH           Define the directory to work in (defaults to cwd)
  -v                    Run with verbose debug output
  -q                    Run quietly only displaying errors

Targets:
  These are valid commands you can ask fedpkg to do

  {help,build,chain-build,clean,clog,clone,co,commit,ci,compile,diff,gimmespec,gitbuildhash,giturl,import,install,lint,local,mockbuild,mock-config,new,new-sources,patch,prep,pull,push,scratch-build,sources,srpm,switch-branch,tag,unused-patches,upload,verify-files,verrel,retire,tag-request,update}
    help                Show usage
    build               Request build
    chain-build         Build current package in order with other packages
    clean               Remove untracked files
    clog                Make a clog file containing top changelog entry
    clone               Clone and checkout a module
    co                  Alias for clone
    commit              Commit changes
    ci                  Alias for commit
    compile             Local test rpmbuild compile
    diff                Show changes between commits, commit and working tree,
                        etc
    gimmespec           Print the spec file name
    gitbuildhash        Print the git hash used to build the provided n-v-r
    giturl              Print the git url for building
    import              Import srpm content into a module
    install             Local test rpmbuild install
    lint                Run rpmlint against local spec and build output if
                        present. Rpmlint can be configured using the
                        --rpmlintconf/-r option or by setting a .rpmlint file
                        in the working directory
    local               Local test rpmbuild binary
    mockbuild           Local test build using mock
    mock-config         Generate a mock config
    new                 Diff against last tag
    new-sources         Upload new source files
    patch               Create and add a gendiff patch file
    prep                Local test rpmbuild prep
    pull                Pull changes from remote repository and update working
                        copy.
    push                Push changes to remote repository
    scratch-build       Request scratch build
    sources             Download source files
    srpm                Create a source rpm
    switch-branch       Work with branches
    tag                 Management of git tags
    unused-patches      Print list of patches not referenced by name in the
                        specfile
    upload              Upload source files
    verify-files        Locally verify %files section
    verrel              Print the name-version-release
    retire              Retire a package
    tag-request         Submit current build nvr as a releng tag request
    update              Submit last build as an update

For detailed help pass --help to a target