The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Git pkg

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
(Added some basic pointers)
 
(add migration info)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 
Mer Project packaging in git project.
 
Mer Project packaging in git project.
 +
 +
gitpkg is deprecated
 +
 +
== Migrating to tar_git ==
 +
 +
Since with pristine-tar we store the contents of the tarball in git it was quite straightforward to turn it into tar_git packaging, sample result: https://github.com/mer-tools/sudo/tree/mer-unified-master
 +
 +
    git checkout pkg-mer -b pkg-mer-move-to-rpmdir
 +
    mkdir rpm
 +
    git mv sudo* rpm/
 +
    git rm _src
 +
    git rm .gitignore
 +
    git commit -m 'Move relevant contents of pkg-mer branch into rpm/'
 +
    git checkout mer-master -b mer-unified-master
 +
    git merge pkg-mer-move-to-rpmdir --allow-unrelated-histories
  
 
=== Upstream repository ===
 
=== Upstream repository ===
Line 8: Line 23:
  
 
  root@mer:~# zypper in gitpkg
 
  root@mer:~# zypper in gitpkg
 +
 +
=== Naming branches and tags ===
 +
 +
* Upstream's '''master''' branch is still called that (obviously)
 +
* Upstream's releases are tagged in some way (e.g. X.Y.Z or PKGNAME-X.Y.Z)
 +
* gitpkg's orphan branch containing packaging files is called '''pkg-mer'''
 +
* Changes from an upstream release (e.g. X.Y.Z) are tagged '''mer-X.Y.Z-R''' (where R is the RPM release number)
 +
* Packaging files for a specific RPM release are tagged '''pkg-mer-X.Y.Z-R'''
 +
 +
==== Generic example ====
 +
 +
* Branch '''master''' (upstream source code)
 +
** Tag '''X.Y.Z''': Describes upstream's vanilla X.Y.Z release
 +
*** Tag '''mer-X.Y.Z-R''': Builds on top of X.Y.Z and (possibly) describes patches for the R release
 +
 +
* Branch '''pkg-mer''' (packaging information)
 +
** Tag '''pkg-mer-X.Y.Z-R''': Contains the 4 packaging files for the R release
 +
 +
==== Specific example: Packaging zsh ====
 +
 +
See https://github.com/thp/mer-tools-zsh:
 +
 +
* Branch '''master'''
 +
** Tag '''zsh-5.0.2''': Upstream 5.0.2 release
 +
*** Tag '''mer-5.0.2-2''': Packaging-related patches against 5.0.2
 +
* Branch '''pkg-mer'''
 +
** Tag '''pkg-mer-5.0.2-2''': Contains _src, zsh.changes, zsh.yaml and zsh.spec
 +
 +
=== Contents of the orphan branch (pkg-mer) ===
 +
 +
The trees in the '''pkg-mer''' branch usually contains 4 files:
 +
 +
* _src
 +
* <packagename>.changes
 +
* <packagename>.yaml
 +
* <packagename>.spec
 +
 +
==== Specific example: Packaging zsh ====
 +
 +
Contents of the _src file:
 +
 +
git:zsh-5.0.2.tar.bz2:zsh-5.0.2:mer-5.0.2-2
 +
 +
This means:
 +
 +
* The source tarball '''zsh-5.0.2.tar.bz2''' is generated from Git commit '''zsh-5.0.2'''
 +
* The patches are generated from '''zsh-5.0.2''' to '''mer-5.0.2-2'''
 +
* Therefore: Tarball + patches will end up representing the state of code in '''mer-5.0.2-2'''
 +
 +
The patches are generated by running '''gp_mkpkg''' - it takes the '''_src''' file as input and generates the tarball and patches (if any), and outputs the changes required to the .yaml file.

Latest revision as of 12:17, 28 February 2017

Mer Project packaging in git project.

gitpkg is deprecated

Contents

[edit] Migrating to tar_git

Since with pristine-tar we store the contents of the tarball in git it was quite straightforward to turn it into tar_git packaging, sample result: https://github.com/mer-tools/sudo/tree/mer-unified-master

   git checkout pkg-mer -b pkg-mer-move-to-rpmdir
   mkdir rpm
   git mv sudo* rpm/
   git rm _src
   git rm .gitignore
   git commit -m 'Move relevant contents of pkg-mer branch into rpm/'
   git checkout mer-master -b mer-unified-master
   git merge pkg-mer-move-to-rpmdir --allow-unrelated-histories

[edit] Upstream repository

[edit] Installing gitpkg

root@mer:~# zypper in gitpkg

[edit] Naming branches and tags

  • Upstream's master branch is still called that (obviously)
  • Upstream's releases are tagged in some way (e.g. X.Y.Z or PKGNAME-X.Y.Z)
  • gitpkg's orphan branch containing packaging files is called pkg-mer
  • Changes from an upstream release (e.g. X.Y.Z) are tagged mer-X.Y.Z-R (where R is the RPM release number)
  • Packaging files for a specific RPM release are tagged pkg-mer-X.Y.Z-R

[edit] Generic example

  • Branch master (upstream source code)
    • Tag X.Y.Z: Describes upstream's vanilla X.Y.Z release
      • Tag mer-X.Y.Z-R: Builds on top of X.Y.Z and (possibly) describes patches for the R release
  • Branch pkg-mer (packaging information)
    • Tag pkg-mer-X.Y.Z-R: Contains the 4 packaging files for the R release

[edit] Specific example: Packaging zsh

See https://github.com/thp/mer-tools-zsh:

  • Branch master
    • Tag zsh-5.0.2: Upstream 5.0.2 release
      • Tag mer-5.0.2-2: Packaging-related patches against 5.0.2
  • Branch pkg-mer
    • Tag pkg-mer-5.0.2-2: Contains _src, zsh.changes, zsh.yaml and zsh.spec

[edit] Contents of the orphan branch (pkg-mer)

The trees in the pkg-mer branch usually contains 4 files:

  • _src
  • <packagename>.changes
  • <packagename>.yaml
  • <packagename>.spec

[edit] Specific example: Packaging zsh

Contents of the _src file:

git:zsh-5.0.2.tar.bz2:zsh-5.0.2:mer-5.0.2-2

This means:

  • The source tarball zsh-5.0.2.tar.bz2 is generated from Git commit zsh-5.0.2
  • The patches are generated from zsh-5.0.2 to mer-5.0.2-2
  • Therefore: Tarball + patches will end up representing the state of code in mer-5.0.2-2

The patches are generated by running gp_mkpkg - it takes the _src file as input and generates the tarball and patches (if any), and outputs the changes required to the .yaml file.

Personal tools