Mer/Build/UsingGitorious

(notes on gitorious-ising a package)
(improved commands)
Line 20: Line 20:
== Moving a Package to Gitorious ==
== Moving a Package to Gitorious ==
 +
The following scripts need:
 +
  PKG=<package name>
 +
  GPKG=<gitorious-safe package name> (ie [a-z0-9_-]
 +
  UPVER=<upstream version>
 +
  TARBALL=<tarball name>
 +
  TAG=<new version>
 +
Get the upstream source unpacked
   mkdir $PKG
   mkdir $PKG
   cd $PKG
   cd $PKG
-
   tar xf ../$TARBALL
+
  mkdir _tmp
-
   mv */* .
+
  cd _tmp
-
   rmdir $PKG-*
+
   tar xf ../../$TARBALL
 +
   mv */* ../
 +
   cd ..
 +
  rm -rf _tmp
Cleanse the install
Cleanse the install
Line 33: Line 43:
   git init
   git init
   git add .
   git add .
-
   git commit -am"$PKG_$UPVER"
+
   git commit -am"${PKG}_$UPVER"
This is really the upstream branch
This is really the upstream branch

Revision as of 22:10, 14 June 2009

Packaging

The Mer DVCS packaging process looks like this:

Image:Mer_workflow.png

An upstream package is unpacked and the debian/ directory is removed. It is then commited onto the upstream branch.

pristine-tar is used to ensure that the upstream tarball can be recreated perfectly.

master is the main branch and the only non-merge commits directly on this branch should be packaging-based and in debian/

All features or bug fixes are broken out to additional branches; 1 branch per feature or fix. The main difference is that features are not likely to go upstream whilst fixes are. This is very similar to quilt.

Developing

Development of a feature is done by cloning master; then branching locally and developing against master.

Once development is complete a new feature branch is created and the development branch is then cherry-picked onto the new feature branch.

Moving a Package to Gitorious

The following scripts need:

 PKG=<package name>
 GPKG=<gitorious-safe package name> (ie [a-z0-9_-]
 UPVER=<upstream version>
 TARBALL=<tarball name>
 TAG=<new version>

Get the upstream source unpacked

 mkdir $PKG
 cd $PKG
 mkdir _tmp
 cd _tmp
 tar xf ../../$TARBALL
 mv */* ../
 cd ..
 rm -rf _tmp

Cleanse the install

 mv debian ..

Create a git repo with the new stuff

 git init
 git add .
 git commit -am"${PKG}_$UPVER"

This is really the upstream branch

 git branch -m master upstream

For keeping an eye on things you may want gitk running. Use File->reload frequently (F5 doesn't work for me)

 gitk --all &

Save state

 pristine-tar commit ../$TARBALL

Prepare structure create master branch from upstream

 git checkout -b master

create Mer branch from master

 git checkout -b Mer

Apply debianisation

 mv ../debian .
 git add debian/
 git commit -am "initial debianize from upstream"

Now apply features from the .diff.gz this has to be done manually


Identify a libtool feature

 git checkout upstream
 git checkout -b mer/libtool

apply hunks

 git commit -am"libtool fixes"

Identify an obs-fix feature

 git checkout upstream
 git checkout -b mer/obs-fix

apply hunks

 git commit -am"obs pthread fixes"

Now any debian/ hunks

 git checkout Mer

apply hunks

 git commit -am"Added Mer debianisation"

Now pull it all together

 git checkout master

look for all the mer/* and patch/* branches and merge them

 git branch -l
 git merge mer/libtool
 git merge mer/obs-fix

now use git log to create a top level ChangeLog entry

 git add ChangeLog
 git commit -m"$TAG"

Mark an 'upstream' release

 git tag $TAG

Now make a distro release

 git checkout Mer
 git merge master

now use git log to create a debian/changelog entry

 git add debian/changelog
 git commit -m"Mer_$TAG"
 git tag Mer_$TAG


Now push to gitorious

 git symbolic-ref HEAD refs/heads/Mer

Logon to http://gitorious.org/mer and create gitorious project

 git remote add origin git@gitorious.org:mer/$GPKG.git
 git push --mirror origin

on gitorious goto 'Edit Repository' and set default to Mer


Working from Gitorious

 git clone git@gitorious.org:mer/$GPKG.git
 git checkout --track origin/Mer