lugaru for Debian
--------------------

Contents:
 1. Install target
 2. Version control in Debian
    2.1 VCS setup for Debian changes
    2.2 VCS setup for new upstream versions
 3. Quilt

1. INSTALL TARGET
OpenLugaru's install target is controlled by LUGARU_INSTALL_PREFIX, it defaults to
/usr/local/


2. VERSION CONTROL IN DEBIAN
The Debian OpenLugaru git repository is set up as follows:

<googlecode mercurial>           master
                                   ||
<debian git>                     master
                                /      \
                           source       data
                           /                \
                    debian_source      debian_data

* <debian git> master:
  Converted directly from master branch of <http://code.google.com/p/lugaru>
  using git-hg from <https://github.com/offbytwo/git-hg>
* source:
  Branched from upstream_hg_master, Data items, Dependencies/, and Xcode/
  removed
* data:
  Branched from upstream_hg_master, Source items, Dependencies/, and Xcode/
  removed
* debian_source:
  Branched from source branch, debian packaging added (debian/)
* debian_data:
  Branched from data branch, debian packaging added (debian/)

Note that former merges have used different branch names than current.


2.1 VCS SETUP FOR DEBIAN CHANGES
Debian packaging work should happen on the debian_source branch, and NOT on
master. Hence, after a standard git clone it is convenient to do:
 $ git branch debian_source origin/debian_source
 $ git checkout debian_source

2.2 VCS SETUP FOR NEW UPSTREAM VERSIONS
In the case or releasing a new snapshot from upstream things are a bit more
complicated, the suggested way to set this up is is:
 i.   Clone the Debian git repository
 ii.  Use git-hg to clone the upstream mercurial repository
 iii. Manually add the hg integration to the Debian git clone
 iiv. Setup our local master branch to track the remote mercurial master branch
 iv.  Merge master into source
 v.   Merge source into debian_source
This integration does unfortunately not follow along as the git repository is
cloned, and hence will have to be setup locally for each person.

 i. Clone the Debian git repository
    $ git clone git://git.debian.org/git/pkg-games/openlugaru.git openlugaru-debian

 ii. Use git-hg to clone the upstream mercurial repository
     $ git clone https://github.com/offbytwo/git-hg.git git-hg
     $ cd git-hg/

     Get the required fast-export submodule
     $ git submodule update --init

     Edit git-hg to call fast-export with --force, it will otherwise fail with
     "Error: repository has at least one unnamed head" for the openlugaru repository
     $ sed s/\$HG_FAST_EXPORT\ -r/\$HG_FAST_EXPORT\ --force\ -r/ -i bin/git-hg
     $ cd ..
     $ git-hg/bin/git-hg clone https://lugaru.googlecode.com/hg/ lugaru-hg-git

 iii. Manually add the hg integration to the Debian git clone
      $ cp -r lugaru-hg-git/.git/hgremote/ openlugaru-debian/.git/
      $ cp -r lugaru-hg-git/.git/hgcheckout/ openlugaru-debian/.git/
      $ cp lugaru-hg-git/.git/FETCH_HEAD openlugaru-debian/.git/
      $ cp -r lugaru-hg-git/.git/refs/remotes/hg openlugaru-debian/.git/refs/remotes

 iiv. Setup our local master branch to track the remote mercurial master branch
      $ git remote add hg .git/hgremote
      $ git checkout master
      $ git-hg pull

 iv. Merge master into source
     $ git branch source origin/source
     $ git checkout source
     $ git merge master

 v. Merge source into debian_source
    $ git branch debian_source origin/debian_source
    $ git checkout debian_source
    $ git merge source
