Building from source
--------------------

1) Check out the Git repository

2) Build using git buildpackage, i.e.
   `gbp buildpackage`

Importing new source tarball
----------------------------

1) Download new LDC release tarball

2) Check out the "ltsmaster" branch in the LDC Git repository,
   pull in all submodules:
   ```
   git submodules init
   git submodules update
   ```
   Remove .git directory and auxiliary files (e.g. .travis.yml),
   the create a new tarball out of the full directory.
   (if the released tag is recent enough, use the release tarball instead)

3) Record the commit hash the "ltsmaster" tarball was built from in
   debian/ldc-ltsmaster-commit.txt

4) Repackage the LDC release and bootstrap tarball, fixing lineendings:
   (needs dos2unix installed)
   ```
   tar -xzf <ldc-release>.tar.gz
   find ldc-<version>-src/ -type f -exec dos2unix {} \;
   tar -czf ldc_<version>.orig.tar.gz ./ldc-<version>-src
   ```
   (repeat this for the ltsmaster tarball)

   This silliness is needed because of two issues: LDC containing
   files with CRLF lineendings, and GBP dropping them unconditionally,
   leading to a pristine-tar conflict later.

   For reference see the following issues:
   https://github.com/ldc-developers/ldc/issues/2402
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719363

5) Rename the ltsmaster tarball to `ldc_<version>.orig-bootstrap.tar.gz`
   and the new LDC release tarball to `ldc_<version>.orig.tar.gz` and place
   them in the same, temporary directory.

6) Import the new sources: `gbp import-orig /path/to/ldc_<version>.orig.tar.gz`
   The bootstrap tarball will automatically be imported as well, due to being
   in the same directory.

7) Refresh and adjust all patches, commit changes

8) Update phobos/druntime library package names to the new SONAMEs, add
   Conflicts: entry on old phobos library to make the transition safer for users,
   do any other necessary changes.

9) Update changelog (`gbp dch`), manual edits

10) Build package the way you like (e.g. `gbp buildpackage --git-builder='debspawn sid --sign'`

11) Run lintian before uploading, make especially sure LDC did not sneak in a statically linked
    copy of any library (like zlib):
    `lintian -IE --pedantic *.changes`

12) Upload.
