** Why dfsg version ?

Moar tarball comes from upstream with convenience copies of upstream
projects in 3rdparty directory. Moar offers the possibility to compile
without using some of these copies (Run =perl Configure.pl --help= to
see the related options).

We are trying to use Debian versions when:
- the software is available in Debian
- the software was not heavily modified upstream

Here the status on the convenience copies:
- libatomic_ops libtommath libuv ::
  source files are excluded. Moar is built with Debian packages
- dynasm :: Upstream hosts repos which are taken from an unknown location.
  They may be modified but I've found no way to check.
  AFAIK, Debian does not provide these softwares.
- dyncall :: moar is now built with libffi. dyncall is now excluded
- uthash.h :: file is provided by =uthash-dev 1.9.9.1+git20151125-1=
  moar's uthash is a year old and different from Debian version.
- tinymt :: Not provided by Debian
- cmp :: Not provided by Debian. Even though =libmsgpack= provides a similar
  functionality
- ryu :: Not provided by Debian. Ryu also contains 3rd parties.
- sha1 :: Debian provides =librhash-dev= with sha1 function. But it's
  not a drop-in replacement for =3rdparty/sha1/=
- msinttypes :: To be investigated

** Lintian overrides

The =RPATH= check in lintian needs to be overridden, since the path
=/usr/share/perl6/site/lib= will be used by Rakudo packages that need to
install NativeCall libraries.

** Source managed with git-buildpackage

We use similar tools as described in [[https://pkg-perl.alioth.debian.org/git.html][Perl Git Guide]].

Upstream sources are kept (in plain, uncompressed form) in the
“upstream” branch. The data needed to regenerate original source
tarballs from the upstream branch are kept with the help of the
=pristine-tar(1)= tool in the “pristine-tar” branch. Upstream sources
are merged with Debian-specific changes in the “master” branch, which
is the usual place to work in.

The debian/changelog is managed with =gbp dch=.

** Minimal “everything is working fine” steps to provide a new version

1. Clone the repository.  If it is already cloned, make sure to have
  the “upstream/master” and “pristine-tar” branches
  #+begin_src shell :results verbatim
   gbp clone --all --pristine-tar git@salsa.debian.org:perl6-team/moarvm.git moarvm
  #+end_src
2. Import new upstream tarball
  #+BEGIN_SRC shell :results verbatim
  gbp import-orig --uscan
  #+END_SRC
3. Update =debian/patches= to make them apply without fuzzy
  #+BEGIN_SRC shell :results verbatim
    gbp pq rebase
    gbp pq export
    git add debian/patches/
    git commit -m "Update patches"
  #+END_SRC
4. Make sure that =cme= is happy
  #+BEGIN_SRC shell :results verbatim
    cme check dpkg
  #+END_SRC
5. Optional: update copyright data
  #+BEGIN_SRC shell :results verbatim
    cme update dpkg-copyright
  #+END_SRC
6. Optional: Prepare  =debian/changelog= for /UNRELEASED/ package.
  This can be done from time to time before the release and should be
  ignored by =gbp-dch=:
  #+BEGIN_SRC shell :results verbatim
    gbp dch -a -S
    git add debian/changelog
    git commit -m "$(echo -e 'Update debian/changelog\n\nGbp-Dch: Ignore')"
  #+END_SRC
7. Build the package
  #+BEGIN_SRC shell :results verbatim
    gbp buildpackage
  #+END_SRC
8. Make sure lintian is happy
  #+BEGIN_SRC shell :results verbatim
    lintian -i -I -E --pedantic ../moarvm*.changes
  #+END_SRC
9. Finalise =debian/changelog=
  #+BEGIN_SRC shell :results verbatim
   gbp dch -a -R
   git add debian/changelog
   git commit -m "Release debian/changelog"
  #+END_SRC
10. Create Debian release tag
  #+BEGIN_SRC shell :results verbatim
    gbp buildpackage --git-tag-only
  #+END_SRC
11. Push git branches and tags
  #+BEGIN_SRC shell :results verbatim
    gbp push
  #+END_SRC

-- Dominique Dumont <dod@debian.org>
