• Re: Packaging help: users and directories

    From Nicolas Mora@21:1/5 to All on Wed Dec 29 01:50:01 2021
    Hello Gavin,

    Le 2021-12-28 à 19 h 14, Gavin Henry a écrit :
    I was given this advice from Arthur, a Debian developer, but I can't
    find some of the finer details I'm looking for:


    In addition to the developer reference and the other documentation, you
    can get some inspiration from packages with a postinst script ,where
    users and services are created, such as dnsmasq [1] or bind9 [2].

    To create sqlite3 databases, you will need dbconfig-comon [3].

    /Nicolas

    [1] https://salsa.debian.org/debian/dnsmasq/-/tree/master/debian
    [2] https://salsa.debian.org/dns-team/bind9/-/tree/debian/main/debian
    [3] https://www.debian.org/doc/manuals/dbconfig-common/ch-develguide.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 01:20:02 2021
    I was given this advice from Arthur, a Debian developer, but I can't find
    some of the finer details I'm looking for:

    -------
    I recommend looking at https://wiki.debian.org/UpstreamGuide to some
    pointers about how to make it easy to ensure your software can be
    easily packaged in Debian.

    If you're looking to create a deb package that is ready to be included
    in Debian it is best to have your debian/ directory on a separate
    branch. I recommend using git-buildpackage, see https://wiki.debian.org/PackagingWithGit (this is what most
    collaboratively maintained packages use now).

    For information on how to create Debian packages see https://www.debian.org/doc/manuals/developers-reference/ (particularly
    chapters 5 and 6). If you want to look at more of the background there
    is the policy document, see https://www.debian.org/doc/debian-policy/

    There are a lot of tools for efficiently building Debian packages. If
    you want to test your builds in a more controlled environment you
    should probably use pbuilder (of cowbuilder) because those use a clean
    chroot to build your packages to ensure you have the correct
    dependencies specified.

    Hope this helps
    ----------

    Thanks

    <div dir="auto"><div style="" dir="auto"><div style="width:352px;margin:16px 0px"><div style=""><div dir="auto" style="">I was given this advice from Arthur, a Debian developer, but I can&#39;t find some of the finer details I&#39;m looking for:<div dir="
    auto" style=""><br></div><div dir="auto" style="">-------</div><div dir="auto" style="">I recommend looking at <a href="https://wiki.debian.org/UpstreamGuide" style="">https://wiki.debian.org/UpstreamGuide</a> to some<br>pointers about how to make it
    easy to ensure your software can be<br>easily packaged in Debian.<br><br>If you&#39;re looking to create a deb package that is ready to be included<br>in Debian it is best to have your debian/ directory on a separate<br>branch. I recommend using git-
    buildpackage, see<br><a href="https://wiki.debian.org/PackagingWithGit" style="">https://wiki.debian.org/PackagingWithGit</a> (this is what most<br>collaboratively maintained packages use now).<br><br>For information on how to create Debian packages see<
    <a href="https://www.debian.org/doc/manuals/developers-reference/" style="">https://www.debian.org/doc/manuals/developers-reference/</a> (particularly<br>chapters 5 and 6). If you want to look at more of the background there<br>is the policy document,
    see <a href="https://www.debian.org/doc/debian-policy/" style="">https://www.debian.org/doc/debian-policy/</a><br><br>There are a lot of tools for efficiently building Debian packages. If<br>you want to test your builds in a more controlled
    environment you<br>should probably use pbuilder (of cowbuilder) because those use a clean<br>chroot to build your packages to ensure you have the correct<br>dependencies specified.<br><br>Hope this helps<br></div><div dir="auto" style="">----------</div><
    div dir="auto" style=""><br></div><div dir="auto" style="">Thanks</div></div></div></div><div style="height:0px"></div></div><div style="font-size:12.8px" dir="auto"><br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 01:20:02 2021
    Hi all,

    Where are some good examples to read about adding a user and group, a
    systemd service file, a /etc/default file and creating a
    /var/lib/sentrypeer directory to hold an sqlite db file?

    Just look at official packages? I've read

    This is for:

    https://github.com/SentryPeer/SentryPeer

    and I've started here:

    https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian

    Thanks for reading,
    Gavin.

    <div dir="auto">Hi all,<div dir="auto"><br></div><div dir="auto">Where are some good examples to read about adding a user and group, a systemd service file, a /etc/default file and creating a /var/lib/sentrypeer directory to hold an sqlite db file? </
    <div dir="auto"><br></div><div dir="auto">Just look at official packages? I&#39;ve read </div><div dir="auto"><br></div><div dir="auto">This is for:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/SentryPeer/SentryPeer">
    https://github.com/SentryPeer/SentryPeer</a></div><div dir="auto"><br></div><div dir="auto">and I&#39;ve started here:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian">https://
    github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian</a></div><div dir="auto"><br></div><div dir="auto">Thanks for reading, </div><div dir="auto">Gavin. </div><div dir="auto"><br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 09:30:01 2021
    Hello Gavin,

    Le 2021-12-28 à 19 h 14, Gavin Henry a écrit :
    I was given this advice from Arthur, a Debian developer, but I can't
    find some of the finer details I'm looking for:


    In addition to the developer reference and the other documentation, you
    can get some inspiration from packages with a postinst script ,where
    users and services are created, such as dnsmasq [1] or bind9 [2].

    To create sqlite3 databases, you will need dbconfig-comon [3].

    /Nicolas

    [1] https://salsa.debian.org/debian/dnsmasq/-/tree/master/debian
    [2] https://salsa.debian.org/dns-team/bind9/-/tree/debian/main/debian
    [3] https://www.debian.org/doc/manuals/dbconfig-common/ch-develguide.html



    Hi Nicolas,

    We meet again! :)

    Thanks! I want to do this first one, then I'm going to use your project.
    Just so I know how it all works.

    SentryPeer will create the dB, just need /var/lib/sentrypeer directory
    created with the right user ownership etc.

    Gavin.

    <div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Gavin,<br>

    Le 2021-12-28 à 19 h 14, Gavin Henry a écrit :<br>
    &gt; I was given this advice from Arthur, a Debian developer, but I can&#39;t <br>
    &gt; find some of the finer details I&#39;m looking for:<br>
    &gt; <br>

    In addition to the developer reference and the other documentation, you <br> can get some inspiration from packages with a postinst script ,where <br>
    users and services are created, such as dnsmasq [1] or bind9 [2].<br>

    To create sqlite3 databases, you will need dbconfig-comon [3].<br>

    /Nicolas<br>

    [1] <a href="https://salsa.debian.org/debian/dnsmasq/-/tree/master/debian" rel="noreferrer noreferrer" target="_blank">https://salsa.debian.org/debian/dnsmasq/-/tree/master/debian</a><br>
    [2] <a href="https://salsa.debian.org/dns-team/bind9/-/tree/debian/main/debian" rel="noreferrer noreferrer" target="_blank">https://salsa.debian.org/dns-team/bind9/-/tree/debian/main/debian</a><br>
    [3] <a href="https://www.debian.org/doc/manuals/dbconfig-common/ch-develguide.html" rel="noreferrer noreferrer" target="_blank">https://www.debian.org/doc/manuals/dbconfig-common/ch-develguide.html</a></blockquote></div></div><div dir="auto"><br></div><
    div dir="auto"><br></div><div dir="auto">Hi Nicolas, </div><div dir="auto"><br></div><div dir="auto">We meet again! :) </div><div dir="auto"><br></div><div dir="auto">Thanks! I want to do this first one, then I&#39;m going to use your project. Just so
    I know how it all works. </div><div dir="auto"><br></div><div dir="auto">SentryPeer will create the dB, just need /var/lib/sentrypeer directory created with the right user ownership etc. </div><div dir="auto"><br></div><div dir="auto">Gavin. </div><
    div dir="auto"></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 12:40:02 2021
    This is exactly what I wanted to see :-)

    https://salsa.debian.org/dns-team/bind9/-/blob/debian/main/debian/bind9.postinst

    Is it best practice to have:

    1. debian folder in your main repo
    2. debian folder branch in main repo
    3. Separate repo for this

    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Hilmar_Preu=c3=9fe?=@21:1/5 to All on Wed Dec 29 13:10:02 2021
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------lzddUQcHWKwsg53Zm1lGETaT
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    QW0gMjkuMTIuMjAyMSB1bSAxMjozNiB0ZWlsdGUgR2F2aW4gSGVucnkgbWl0Og0KDQpIaSwN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mC8gjA/SrzM4W6uwSWkgrcJIf0qlHONzUCmWqCx7g5urdcP 66H7SYlcm3rep3jIshOCJSOEMM5aUtm2RRMwfNTXHzDbS+IyeMoQisWChAYlawn2unWFyR//VzOW 7IKFj1KgDSK59MPkbIAxlgl64ziasRH6hGQT0i41KTvnJaEVqbfSHqi0EkdwDsC+PdQ1JhpNPKta YAA=
    =GhGR
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Gustafsson@21:1/5 to ghenry@sentrypeer.org on Wed Dec 29 13:10:01 2021
    Hi Gavin,

    On Wed, Dec 29, 2021 at 12:35 PM Gavin Henry <ghenry@sentrypeer.org> wrote:
    [...]
    Is it best practice to have:

    1. debian folder in your main repo
    2. debian folder branch in main repo
    3. Separate repo for this

    A separate repo hosted on salsa.debian.org.

    On Wed, Dec 29, 2021 at 12:37 PM Gavin Henry <ghenry@sentrypeer.org> wrote:

    What's this for, when it looks like this was written manually? Google
    shows nothing:

    https://salsa.debian.org/dns-team/bind9/-/blob/debian/main/debian/bind9.postinst#L35

    #DEBHELPER#

    The debhelper man page explains it. [1]

    [1] https://manpages.debian.org/unstable/debhelper/debhelper.7.en.html#Automatic_generation_of_Debian_install_scripts

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 14:10:01 2021

    #DEBHELPER#

    One of the first google hits:

    https://manpages.debian.org/bullseye/debhelper/debhelper.7.en.html



    Thanks. I see it now. With quotes "#DEBHELPER#" didn't show up, but:

    Automatic generation of Debian install scripts

    Some debhelper commands will automatically generate parts of Debian
    maintainer scripts. If you want these automatically generated things
    included in your existing Debian maintainer scripts, then you need to add *#DEBHELPER#* to your scripts, in the place the code should be added. *#DEBHELPER#* will be replaced by any auto-generated code when you run *dh_installdeb*.

    <div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; #DEBHELPER#<br>
    &gt; <br>
    One of the first google hits:<br>

    <a href="https://manpages.debian.org/bullseye/debhelper/debhelper.7.en.html" rel="noreferrer noreferrer" target="_blank">https://manpages.debian.org/bullseye/debhelper/debhelper.7.en.html</a></blockquote></div><div dir="auto"><br></div><div dir="auto"><
    </div><div dir="auto">Thanks. I see it now. With quotes &quot;#DEBHELPER#&quot; didn&#39;t show up, but:</div><div dir="auto"><br></div><div dir="auto"><h2>Automatic generation of Debian install scripts</h2>
    <p>Some debhelper commands will automatically generate parts of
    Debian maintainer scripts. If you want these automatically generated things
    included in your existing Debian maintainer scripts, then you need to add
    <b>#DEBHELPER#</b> to your scripts, in the place the code should be added.
    <b>#DEBHELPER#</b> will be replaced by any auto-generated code when you run
    <b>dh_installdeb</b>.</p></div><div class="gmail_quote" dir="auto"></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robin Gustafsson@21:1/5 to ghenry@sentrypeer.org on Wed Dec 29 15:00:03 2021
    On Wed, Dec 29, 2021 at 2:03 PM Gavin Henry <ghenry@sentrypeer.org> wrote:

    Is it best practice to have:

    1. debian folder in your main repo
    2. debian folder branch in main repo
    3. Separate repo for this

    A separate repo hosted on salsa.debian.org.

    Thanks. That's for an official package, or?

    Yes, that's assuming you're pursuing inclusion in Debian. Otherwise
    alternative 2, a separate branch in your existing repository.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to Robin Gustafsson on Wed Dec 29 15:00:02 2021
    On Wed, 29 Dec 2021 at 13:51, Robin Gustafsson <robin@rgson.se> wrote:

    On Wed, Dec 29, 2021 at 2:03 PM Gavin Henry <ghenry@sentrypeer.org> wrote:

    Is it best practice to have:

    1. debian folder in your main repo
    2. debian folder branch in main repo
    3. Separate repo for this

    A separate repo hosted on salsa.debian.org.

    Thanks. That's for an official package, or?

    Yes, that's assuming you're pursuing inclusion in Debian. Otherwise alternative 2, a separate branch in your existing repository.

    That's my plan! :-)

    --
    Kind Regards,

    Gavin Henry.
    https://sentrypeer.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Wed Dec 29 16:50:01 2021
    Dear Gavin Henry,

    Hi Chris!

    I didn't follow your whole discussion, but if you have time I would highly appreciate if you could put all this information together at a well-findable place (maybe: extend https://wiki.debian.org/UpstreamGuide ?)

    Reason:
    I'm probably going to search for similar information in the near future =)


    Regards
    Chris

    PS: This is not meant as a demand. Rather a "hint" that the work will pay of at least for one more person. ... I just figured it's very difficult to transport "nice" in letters. Everything sounds so demanding :/

    I've Cc'd the list, sorry if that wasn't correct.

    What do you class as "all this information"? Starting from scratch?
    I'm coming from a Fedora/RH world so I've always wanted to do a Debian
    package and I am starting to see the flexibility of all the
    multi-files vs the one spec file I have:

    https://github.com/SentryPeer/SentryPeer/blob/main/packaging/rpm/sentrypeer.spec
    https://bugzilla.redhat.com/show_bug.cgi?id=2026516 <- main way to get
    a package listed for inclusion

    I'm pretty much done with the Fedora spec file, but I now understand
    about how the rules/control file can do all the requirements for you
    (if using autoconf?).

    My main issue was having zero knowledge of the main terms, so this
    page was hard to approach:

    https://wiki.debian.org/Packaging

    but this was good (as well as doing the RPM spec first and seeing how
    others have done their rules file):

    https://www.debian.org/doc/manuals/maint-guide/index.en.html

    I think the main issue is getting your head around "creating the first
    set of files" and then picking how to build it all moving forward.

    Thanks.

    --
    Kind Regards,

    Gavin Henry.
    https://sentrypeer.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to All on Thu Dec 30 10:10:02 2021
    Thanks all for the help and pointers everyone.

    I've managed to build SentryPeer ( https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian). I'm just going through debuild now to clean up lintian issues and pbuilder runs
    for missing depends.

    Suprisingly enjoyable and "dh" in the rules file does a ton of work for
    you!

    I've emailed the VoIP packaging group to see if I can help now that I know
    some more. I'd like to look after the libosip2 package too as SentryPeer requires it and it looks like it's not been updated in 6 years?

    https://salsa.debian.org/pkg-voip-team/libosip2/-/blob/master/ChangeLog

    Thanks again everyone.

    Gavin.

    <div dir="auto">Thanks all for the help and pointers everyone. <div dir="auto"><br></div><div dir="auto">I&#39;ve managed to build SentryPeer (<a href="https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian">https://github.com/SentryPeer/
    SentryPeer/tree/debian-packaging/debian</a>). I&#39;m just going through debuild now to clean up lintian issues and pbuilder runs for missing depends. </div><div dir="auto"><br></div><div dir="auto">Suprisingly enjoyable and &quot;dh&quot; in the rules
    file does a ton of work for you! </div><div dir="auto"><br></div><div dir="auto">I&#39;ve emailed the VoIP packaging group to see if I can help now that I know some more. I&#39;d like to look after the libosip2 package too as SentryPeer requires it and
    it looks like it&#39;s not been updated in 6 years? </div><div dir="auto"><br></div><div dir="auto"><a href="https://salsa.debian.org/pkg-voip-team/libosip2/-/blob/master/ChangeLog" target="_blank" rel="noreferrer">https://salsa.debian.org/pkg-voip-team/
    libosip2/-/blob/master/ChangeLog</a></div><div dir="auto"><br></div><div dir="auto">Thanks again everyone. </div><div dir="auto"><br></div><div dir="auto">Gavin. </div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Henry@21:1/5 to ghenry@sentrypeer.org on Mon Jan 3 12:40:01 2022
    Got access to salsa.debian.org today! Woot!

    Hopefully one of the VoIP packaging group will get back to me re below in
    the next few weeks.

    Thanks.


    On Thu, 30 Dec 2021, 09:01 Gavin Henry, <ghenry@sentrypeer.org> wrote:

    Thanks all for the help and pointers everyone.

    I've managed to build SentryPeer ( https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian).
    I'm just going through debuild now to clean up lintian issues and pbuilder runs for missing depends.

    Suprisingly enjoyable and "dh" in the rules file does a ton of work for
    you!

    I've emailed the VoIP packaging group to see if I can help now that I know some more. I'd like to look after the libosip2 package too as SentryPeer requires it and it looks like it's not been updated in 6 years?

    https://salsa.debian.org/pkg-voip-team/libosip2/-/blob/master/ChangeLog

    Thanks again everyone.

    Gavin.


    <div dir="auto"><div>Got access to <a href="http://salsa.debian.org">salsa.debian.org</a> today! Woot!<div dir="auto"><br></div><div dir="auto">Hopefully one of the VoIP packaging group will get back to me re below in the next few weeks. </div><div dir="
    auto"><br></div><div dir="auto">Thanks. </div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Dec 2021, 09:01 Gavin Henry, &lt;<a href="mailto:ghenry@sentrypeer.org">ghenry@sentrypeer.org</a>&gt; wrote:<br></div><blockquote
    class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Thanks all for the help and pointers everyone. <div dir="auto"><br></div><div dir="auto">I&#39;ve managed to build SentryPeer (<a href="https://
    github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian" target="_blank" rel="noreferrer">https://github.com/SentryPeer/SentryPeer/tree/debian-packaging/debian</a>). I&#39;m just going through debuild now to clean up lintian issues and pbuilder
    runs for missing depends. </div><div dir="auto"><br></div><div dir="auto">Suprisingly enjoyable and &quot;dh&quot; in the rules file does a ton of work for you! </div><div dir="auto"><br></div><div dir="auto">I&#39;ve emailed the VoIP packaging group
    to see if I can help now that I know some more. I&#39;d like to look after the libosip2 package too as SentryPeer requires it and it looks like it&#39;s not been updated in 6 years? </div><div dir="auto"><br></div><div dir="auto"><a href="https://salsa.
    debian.org/pkg-voip-team/libosip2/-/blob/master/ChangeLog" rel="noreferrer noreferrer" target="_blank">https://salsa.debian.org/pkg-voip-team/libosip2/-/blob/master/ChangeLog</a></div><div dir="auto"><br></div><div dir="auto">Thanks again everyone. </
    <div dir="auto"><br></div><div dir="auto">Gavin. </div></div> </blockquote></div></div></div>

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