• How to include the .git folder in a source package's .tar.xz archive?

    From Hunter Wittenborn@21:1/5 to All on Fri Oct 29 04:20:02 2021
    I, or mostly the work of another individual rather, is working on getting a program packaged for Debian for potential inclusion in the Debian repositories, but we've hit a roadblock in getting our package to work.



    Part of the packaging process for our program includes running Git commands to get things like the timestamp for when some files were last modified, which are used in things like the building of man pages via Asciidoc to set the last modified time [1].



    The problem is that whenever I (and the other guy) build the program with something like debuild, the resulting .tar.xz archive doesn't contain the .git repository in which the 'debian/' folder is contained. I've attempted to do some Googling, but I didn'
    t get much of anywhere with it (I actually got some answers on how to do the opposite for some reason :P).



    Anything I could try?



    [1]: https://github.com/gamer4life1/makedeb/blob/launchpad/Makefile#L1-L3



    ---

    Hunter Wittenborn

    mailto:hunter@hunterwittenborn.com

    https://www.hunterwittenborn.com

    https://github.com/hwittenborn
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>I, or mostly
    the work of another individual rather, is working on getting a program packaged for Debian for potential inclusion in the Debian repositories, but we've hit a roadblock in getting our package to work.<br></div><div><br></div><div>Part of the packaging
    process for our program includes running Git commands to get things like the timestamp for when some files were last modified, which are used in things like the building of man pages via Asciidoc to set the last modified time [1].<br></div><div><br></div>
    <div>The problem is that whenever I (and the other guy) build the program with something like debuild, the resulting .tar.
  • From Daniel =?utf-8?Q?Gr=C3=B6ber?=@21:1/5 to Hunter Wittenborn on Fri Oct 29 06:10:01 2021
    Hi,

    On Thu, Oct 28, 2021 at 09:02:21PM -0500, Hunter Wittenborn wrote:
    Anything I could try?

    I'm not sure this is a path very well travelled, but dpkg does in principle seem to support a source package format called "3.0 (git)" where the source tarball is basically a depth limited git-bundle. See dpkg-source(1) section "Format: 3.0 (git)".

    I just stumbled on this while looking at the dpkg source I haven't actually used it though.

    --Daniel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tobias Frost@21:1/5 to Hunter Wittenborn on Fri Oct 29 07:40:01 2021
    On Thu, Oct 28, 2021 at 09:02:21PM -0500, Hunter Wittenborn wrote:
    I, or mostly the work of another individual rather, is working on getting a program packaged for Debian for potential inclusion in the Debian repositories, but we've hit a roadblock in getting our package to work.





    Part of the packaging process for our program includes running Git commands to get things like the timestamp for when some files were last modified, which are used in things like the building of man pages via Asciidoc to set the last modified time [1].



    The problem is that whenever I (and the other guy) build the program with something like debuild, the resulting .tar.xz archive doesn't contain the .git repository in which the 'debian/' folder is contained. I've attempted to do some Googling, but I didn't get much of anywhere with it (I actually got some answers on how to do the opposite for some reason :P).



    Anything I could try?

    For the packaging, I'd implement to retrieve the timestamp from d/changelog. (e.g. using dpkg-parsechangleog). Possibly you want to prepare your build system that it accepts injecting this timestamps.)

    Note that the Debian packaging, when the maintainer uses git for that, resides in its own git repository; even if it is now on the same place, this might change (e.g. if package maintainer changes). Best is you consider that already now and dont rely on the git repo. to be (See https://wiki.debian.org/UpstreamGuide#Pristine_Upstream_Source to keep debian/)

    --
    tobi





    [1]: https://github.com/gamer4life1/makedeb/blob/launchpad/Makefile#L1-L3



    ---

    Hunter Wittenborn

    mailto:hunter@hunterwittenborn.com

    https://www.hunterwittenborn.com

    https://github.com/hwittenborn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rahmatullin@21:1/5 to Hunter Wittenborn on Fri Oct 29 08:30:02 2021
    On Thu, Oct 28, 2021 at 09:02:21PM -0500, Hunter Wittenborn wrote:
    Part of the packaging process for our program includes running Git
    commands to get things like the timestamp for when some files were last modified, which are used in things like the building of man pages via Asciidoc to set the last modified time [1].
    This is a bad idea for several reasons. It also seems to mean your
    software doesn't have a published source tarball.

    The problem is that whenever I (and the other guy) build the program
    with something like debuild, the resulting .tar.xz archive doesn't
    contain the .git repository in which the 'debian/' folder is contained.
    Putting .git into the orig tarball is very wrong and you shouldn't do
    that. You should find a way how to make a source distribution for your
    software that allow building from a tarball without .git.
    Please also consider the reproducible builds initiative and https://reproducible-builds.org/docs/source-date-epoch/

    --
    WBR, wRAR

    -----BEGIN PGP SIGNATURE-----

    iQJhBAABCgBLFiEEolIP6gqGcKZh3YxVM2L3AxpJkuEFAmF7lG4tFIAAAAAAFQAP cGthLWFkZHJlc3NAZ251cGcub3Jnd3JhckBkZWJpYW4ub3JnAAoJEDNi9wMaSZLh lSkQAIf814Y6KacbygzmgyJqW5kfewsXkFPTjmycPM7Sti4vLfe6GfUxPiulmHR/ Et7bzH/cbZg6MrHpMYyht3BSpXbyx+WjzZKB5W3kBx09daRiSrZRA1U1fTL/DZP5 lER1Q9GZSGARKkxwLKriNnrIFh9LhzF0NyqTxd1y8rmI8NISsM4Xh2WSj10Y8Rgr Ax53Bf+Lz1EIeUimz/ysCOXvva4SoH8uM4eRW9ajTNf6Y9iygJXpfrey2SCRY5Es yqTUp1YuycIMOT206m/JRXOz+Bv14YS2t7ftjs1TDFZUS3X3zP5klHsqU13irUsc avBDtFrfMfB8iWrB15naxDygqEYeTb/+XWlQvN1WBFi02Eo4K1jwIirvnbRtVduu TetOdts7ZORSrbbK5McAJLQY66zfPb6XF7hheIWT9NFQuXQzKQ12+IU6I1LBAxGc GSUjtoThzs6/5cNgdalicY6yN9WJMusuDhY2TcBHeaBnYZzuJBO8pAQ5aOzbw62g agr/pnj+8cLohZ5VscZe45+geJGiKr4UI7yosn/Sc8VFMHbLJ2Fr4BABuqG84xNR Xunm2Q2uy/zobhGqdXJdbsSNTCQoUfZ0hcwo6GXXUFJauGo9xVFzNatF8IKy1qWY 409g300QrSKD8vjkXrKqpg+S5U5QAzVksH5xkOmPkFudsW6d
    =I+Ba
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alec Leamas@21:1/5 to Tobias Frost on Fri Oct 29 15:30:01 2021
    On 29/10/2021 07:35, Tobias Frost wrote:
    On Thu, Oct 28, 2021 at 09:02:21PM -0500, Hunter Wittenborn wrote:
    The problem is that whenever I (and the other guy) build the program with
    something like debuild, the resulting .tar.xz archive doesn't contain the
    .git repository in which the 'debian/' folder is contained. I've attempted to
    do some Googling, but I didn't get much of anywhere with it (I actually got >> some answers on how to do the opposite for some reason :P).



    Anything I could try?

    For the packaging, I'd implement to retrieve the timestamp from d/changelog. (e.g. using dpkg-parsechangleog). Possibly you want to prepare your build system that it accepts injecting this timestamps.)

    Note that the Debian packaging, when the maintainer uses git for that, resides
    in its own git repository; even if it is now on the same place, this might change (e.g. if package maintainer changes). Best is you consider that already
    now and dont rely on the git repo. to be (See https://wiki.debian.org/UpstreamGuide#Pristine_Upstream_Source to keep debian/)



    Other solutions could be creating a file like VERSION with relevant git
    data and add that to the distribution. That file can normally not be
    checked into git, it's a chicken and egg problem. The solution is to add
    the logic to autoconf/cmake/whatever is used.

    Also, git has provisions for substituting keywords like date and hash
    when checking out data. However, this is in my opinion utterly messy to
    handle. See git-attributes(1)

    --alec

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Wise@21:1/5 to Alec Leamas on Sat Oct 30 02:00:02 2021
    On Fri, 2021-10-29 at 15:28 +0200, Alec Leamas wrote:

    Other solutions could be creating a file like VERSION with relevant git
    data and add that to the distribution. That file can normally not be
    checked into git, it's a chicken and egg problem. The solution is to add
    the logic to autoconf/cmake/whatever is used.

    I maintain a package called autorevision, which is aimed at adding git information to exported tarballs. It supports various languages and
    build systems. Please use that instead of any sort of custom solution.

    https://autorevision.github.io/

    --
    bye,
    pabs

    https://wiki.debian.org/PaulWise

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmF8iM0ACgkQMRa6Xp/6 aaPDFA//X3xWmpDrZ5fK4Tbh60MNPmXkVPslGTKC/VSNKTTfXi8OgztngAk1sd+H 1SBwAfRbNP0gGfO+b+wu/5VkSI1co5ylVVDeHVtwkzMSXZG9KS1lzIAcm0EFDyk8 VoVmoh3mXaIw+bkt1kgSgVTiNiOYO7zPDk2bRy8kLfYy0/SFe0w6wE3KU1WBxugw KW3bhuzLXwHSMG8RyPV1a8qhDbHpJafrVllHKoZx5+Wtd5YWw7A6dLBTnzwa0XU3 X6YhS2oqkuSyYQ9LkHPX5T+LRM8dafy47MRtyEALbI9gsodir1+a+w4F6SuR9I2m 8LmF2AQw0lFeX7eNX2rbT5KbKzyjuTe7+7t/mb/JVtBvLa4hV/dTmJrOaM9QZkY6 YxJM6rSL9BvyJJYXrUXaUYJMMypZ2Dh7ap5xjlVxGmw40suH+xwm5cD7iNdFcJBE zV4tRLXQr2uIY17A7jxTLA1GELe3C9PL5xT4Na4HtQT+f9h1Z+1tX9PYMduQZUPq D5TOkd8yaELTehXGLGsweaAvpdUgIey0qs1/IRZp15SCw2eNwkxV6IrYbb/6j6EK Jk9TSNZt++UqMIeTP1ejoxpdE2AeNLmSp81ky1RQUMhJWzfQeKS8tGkNOZFX3VTu 59WF2vp8oVVJog7Zjy3OTA7Kjf4khQAu0XHgehPgHTkYew6SHr0=
    =J8uw
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)