Differences between revisions 7 and 8
Revision 7 as of 2013-07-02 13:38:40
Size: 4805
Editor: NiteshAJain
Comment:
Revision 8 as of 2014-05-03 03:44:40
Size: 4976
Editor: Praveen A
Comment: don't use gh prefix
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
  1. Use github tags to download the latest version. It is a good idea to add gh to the version so we know we downloaded from github.
  1. Use git-import-orig to import the github tarball and mention upstream version as 3.0.7gh.
  1. Update changelog entry. For example, 3.0.7gh-1, if upstream version is 3.0.7
  1. Use github tags to download the latest version. You can copy the link to zip file and use wget to download the tarball (just change .zip to .tar.gz) --(It is a good idea to add gh to the version so we know we downloaded from github.)--
  1. Remove the upstream tag by git tag -d upstream/xxx. Use git-import-orig to import the github tarball --(and mention upstream version as 3.0.7gh)--.
  1. --(Update changelog entry. For example, 3.0.7gh-1, if upstream version is 3.0.7)--

Sometimes you will need to change the upstream source for various reasons. We'll try to document all know cases and their solutions.

Missing tests

We prefer to run all provided tests and sometimes upstream does not add tests in the gems but they will be available from their upstream source repo (usually github).

  1. Run gem2deb to create initial dsc. Use git-import-dsc --pristine-tar to import it
  2. Use github tags to download the latest version. You can copy the link to zip file and use wget to download the tarball (just change .zip to .tar.gz) It is a good idea to add gh to the version so we know we downloaded from github.

  3. Remove the upstream tag by git tag -d upstream/xxx. Use git-import-orig to import the github tarball and mention upstream version as 3.0.7gh.

  4. Update changelog entry. For example, 3.0.7gh-1, if upstream version is 3.0.7

  5. Update watch file so it uses github tags. ruby-subexec has an example

  6. Open a github issue with upstream to include tests in gem. Usually upstreams respond favorably.
  7. Create debian/README.source and mention why we are using github tarball instead of gem file.

Missing tests and missing tags

  1. Download master branch as a tarball and use +git.yyyymmdd.1234567 suffix, where yyyymmdd correspond to the date of the last commit in master, and 1234567 are the first digits of the commit's SHA.
    1. Run gem2deb to create initial dsc. Use git-import-dsc --pristine-tar to import it
    2. Import the upstream tarball with git import orig and provide upstream version like 3.0.7+git.20130622.ab34f107, if the latest known upstream version is 3.0.7, and the last commit in the master branch is on 2013/06/22.
    3. Update changelog entry as above.
    4. Create debian/README.source and mention why we are using github master tarball instead of gem file.
    5. Request upstream to tag releases and include tests in releases.
    6. add a dversionmangle and a comment to look at README.source in debian/watch

version=3
# Using github master tarball, see README.source
opts=dversionmangle=s/\+git\.[0-9]*\.[a-zA-Z0-9]*// \
http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/messagebus_ruby_api .*/messagebus_ruby_api-(.*).tar.gz

If it has embedded libraries in vendor directory / non distribuable files

For embedded libraries removed, the suffix is +ds or +debian. For non distribuable files removed, the suffix is +dfsg.

  • The first possibility is to use a repack.sh script ruby-fakeweb has an example - look at line 32 for what files to be removed.

    1. run gem2deb, copy repack.sh, create README.source (look at ruby-fakeweb for examples).
    2. Create new orig.tar.gz by running sh debian/repack.sh --upstream-version <upstream version> <path to upstream tarball>

    3. Use dh-make-ruby to create new debian package from repacked orig.source
    4. run git-import-dsc to import the repacked source.
    5. copy repack.sh, create README.source, gbp.conf, update changelog (look at ruby-fakeweb for examples).
    6. a dmangleversion option has to be added to debian/watch to suppress the suffix when looking for corresponding upstream version
  • Another (preferred?) method when the package is already in a Git repository is to take advantage of Git, and use git-buildpackage to filter out unwanted files from the tarball
    1. If you know already the files to exclude, create a debian/gbp.conf file with a filter option in the [git-import-orig] section, and set filter-pristine-tar to True. See ruby-ref, mdpress or ruby-distribution for examples.

    2. You can import the upstream tarball to clean in the upstream branch without merging with master, start a dfsg branch from there, remove the files, tag the corresponding commit with upstream/version+dfsg (or +ds) and merge this branch to master. use then git buildpackage --git-no-pristine-tar --git-upstream-branch=dfsg to create a new tarball from the dfsg branch, and then import it in the pristine-tar branch with pristine-tar commit ../nameofthetarball_version+dfsg.orig.tar.gz. See the corresponding section in the git-buildpackage manual.