Help With Custom Deb Package - Debian

This is a discussion on Help With Custom Deb Package - Debian ; Hi I am in the process of rebuilding one of my servers and I thought hey why not build a package, that links all the other packages I need, and the corresponding configuration files. I am guessing this has been ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: Help With Custom Deb Package

  1. Help With Custom Deb Package

    Hi

    I am in the process of rebuilding one of my servers and I thought hey why not
    build a package, that links all the other packages I need, and the
    corresponding configuration files.

    I am guessing this has been thought of before but haven't seen anything forit,
    so I thought I would come to the list (tried debian-user first but realised
    that might have been the wrong place to ask the question)

    I am having a look at debhelper, debian policy and maint-guide.
    for example for server test.acme.com

    I was going to create a package test.acme.com and making it dependant on the
    required packages (I can specific a base minimum).

    Any one else done this, what hurdles might I face ? How am i going to handle 2
    packages owning a file, for example for bind and my custom package and the file
    /etc/bind/named.conf ???

    I have come across the replaces option for file handling I think, although now
    I am thinking that i should really just replace the files in the postinst
    scripts, after backing up the files into /var/backup

    My other thought aswell is that i need to use pre-depends on all the packages
    that I want, so that they are in place and configured before my packages tried
    to do any thing ?

    Comments/ thoughts ?

    Alex

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHRfKMkZz88chpJ2MRAvLLAKDYujnWPLazdGWkdHYx+x c6n5zhNwCg9iRv
    0AOROdGaUqkR9IkhB9S48OI=
    =S7EC
    -----END PGP SIGNATURE-----


  2. Re: Help With Custom Deb Package

    On Fri, Nov 23, 2007 at 08:20:12AM +1100, Alex Samad wrote:
    > Hi
    >
    > I am in the process of rebuilding one of my servers and I thought hey whynot
    > build a package, that links all the other packages I need, and the
    > corresponding configuration files.
    >
    > I am guessing this has been thought of before but haven't seen anything for it,
    > so I thought I would come to the list (tried debian-user first but realised
    > that might have been the wrong place to ask the question)
    >
    > I am having a look at debhelper, debian policy and maint-guide.
    > for example for server test.acme.com
    >
    > I was going to create a package test.acme.com and making it dependant onthe
    > required packages (I can specific a base minimum).
    >
    > Any one else done this, what hurdles might I face ? How am i going to handle 2
    > packages owning a file, for example for bind and my custom package and the file
    > /etc/bind/named.conf ???
    >

    In the general case, two packages owning the same file is handled with
    dpkg-divert. I cannot remember if conffiles can be handled that way,
    however.

    > I have come across the replaces option for file handling I think, although now
    > I am thinking that i should really just replace the files in the postinst
    > scripts, after backing up the files into /var/backup
    >

    That is bad. The next time the package whose you file replace is
    upgraded, it will probably cause an error. If not, it will want to
    replace your file with the one from the package.

    > My other thought aswell is that i need to use pre-depends on all the packages
    > that I want, so that they are in place and configured before my packages tried
    > to do any thing ?
    >

    You are going about this the wrong way. Having a meta package that
    depends on other packages is fine (I use this). However, configuration
    files are a different animal. In that case, you might be better off
    repackaging the specific packages whose configuration files you want to
    modify.

    Regards,

    -Roberto

    --
    Roberto C. Sánchez
    http://people.connexer.com/~roberto
    http://www.connexer.com

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHRgjj5SXWIKfIlGQRAqI8AJwI12l4auyGizOCCCDsbg cHBXmc4gCcDCvh
    VPBJvLFRQoWQcemYpfMYdjM=
    =Bvi6
    -----END PGP SIGNATURE-----


  3. Re: Help With Custom Deb Package

    On Thu, Nov 22, 2007 at 05:55:31PM -0500, Roberto C. Sánchez wrote:
    > On Fri, Nov 23, 2007 at 08:20:12AM +1100, Alex Samad wrote:
    > > Hi
    > >
    > > I am in the process of rebuilding one of my servers and I thought hey why not
    > > build a package, that links all the other packages I need, and the
    > > corresponding configuration files.
    > >
    > > I am guessing this has been thought of before but haven't seen anythingfor it,
    > > so I thought I would come to the list (tried debian-user first but realised
    > > that might have been the wrong place to ask the question)
    > >
    > > I am having a look at debhelper, debian policy and maint-guide.
    > > for example for server test.acme.com
    > >
    > > I was going to create a package test.acme.com and making it dependant on the
    > > required packages (I can specific a base minimum).
    > >
    > > Any one else done this, what hurdles might I face ? How am i going to handle 2
    > > packages owning a file, for example for bind and my custom package and the file
    > > /etc/bind/named.conf ???
    > >

    > In the general case, two packages owning the same file is handled with
    > dpkg-divert. I cannot remember if conffiles can be handled that way,
    > however.


    >
    > > I have come across the replaces option for file handling I think, although now
    > > I am thinking that i should really just replace the files in the postinst
    > > scripts, after backing up the files into /var/backup
    > >

    > That is bad. The next time the package whose you file replace is
    > upgraded, it will probably cause an error. If not, it will want to
    > replace your file with the one from the package.

    I am not sure how this is different from when I manually change a conf file
    like /etc/bind/named.conf. I would have presumed that the original package
    would ask if I wanted to overwrite or leave the file alone.

    >
    > > My other thought aswell is that i need to use pre-depends on all the packages
    > > that I want, so that they are in place and configured before my packages tried
    > > to do any thing ?
    > >

    > You are going about this the wrong way. Having a meta package that
    > depends on other packages is fine (I use this). However, configuration
    > files are a different animal. In that case, you might be better off
    > repackaging the specific packages whose configuration files you want to
    > modify.


    This mean I would have to repackage alot of packages, off the top of my head,
    apache, postgres, exim, squid, sshd, slapd, imap.

    I hear the word about meta packages this seems to be the way forward, I just
    want to automate the configuration as well. I was thinking a post inst script
    that placed the new config files in place - this is just about the same as me
    editing the files in place.

    I would like to be able to

    1) install a new machine with net inst cd, do a bare minimum install
    2) apt-get install alex-server-

    and it be done, then I can keep the source for alex-server- in cvs
    and track any changes.


    >
    > Regards,
    >
    > -Roberto
    >
    > --
    > Roberto C. Sánchez
    > http://people.connexer.com/~roberto
    > http://www.connexer.com




    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHRnDvkZz88chpJ2MRAm1JAJ9bR8UwAoRtYrbKpQ10Ab uAcrtbUgCglCx8
    /yTRP1ypP/y5Z/GoaOUSwGA=
    =niR+
    -----END PGP SIGNATURE-----


  4. Re: Help With Custom Deb Package

    On Fri, 23 Nov 2007, Alex Samad wrote:
    > Any one else done this,


    Yes, I'm doing this for years. I ended up with binary packages
    andreas-base, andreas-nox, andreas-x and andreas-laptop on my
    local mirror and these packages will be installed on new boxes.

    > what hurdles might I face ?


    I did not faced any hurdles.

    > How am i going to handle 2
    > packages owning a file, for example for bind and my custom package and the file
    > /etc/bind/named.conf ???


    You should not do this. There are several possibilities to accomplish the
    same effect. Two of them are:

    1. Use (for instance) a cfengine skript that changes /etc/bind/named.conf
    that is provided by bind.
    2. Provide /etc/bind/named.conf.my and copy it into the right place later

    Please be aware that it is not guaranteed which postinst script is called
    first and thus it might happen that the bind postinst can be called either
    before or after your own one. You have two chances to make sure that bind
    postinst is called first:

    1. Use bind as Pre-Depends.
    2. Use an apt Post-Inst hook that is called before apt ends its work
    for your own package.

    > I have come across the replaces option for file handling I think, although now
    > I am thinking that i should really just replace the files in the postinst
    > scripts, after backing up the files into /var/backup


    You could save a backup there but I personally would prefer
    /etc/bind/named.conf.orig because it is closer to the original location
    in case you want to do later editing. Its a matter of personal taste.

    > My other thought aswell is that i need to use pre-depends on all the packages
    > that I want, so that they are in place and configured before my packages tried
    > to do any thing ?


    As I wrote above you can do this. Pre-Depends are a thing that is for
    several reasons not a thing that maintainers like in official Debian
    packages, but for a local package you have in mind it is OK.

    > Comments/ thoughts ?


    Good luck

    Andreas.

    --
    http://fam-tille.de


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  5. Re: Help With Custom Deb Package

    On Fri, Nov 23, 2007 at 07:11:31AM +0100, Andreas Tille wrote:
    > On Fri, 23 Nov 2007, Alex Samad wrote:
    >> Any one else done this,

    >
    > Yes, I'm doing this for years. I ended up with binary packages
    > andreas-base, andreas-nox, andreas-x and andreas-laptop on my
    > local mirror and these packages will be installed on new boxes.

    sounds like where I am going

    >
    >> what hurdles might I face ?

    >
    > I did not faced any hurdles.
    >
    >> How am i going to handle 2
    >> packages owning a file, for example for bind and my custom package and the
    >> file
    >> /etc/bind/named.conf ???

    >
    > You should not do this. There are several possibilities to accomplish the
    > same effect. Two of them are:
    >
    > 1. Use (for instance) a cfengine skript that changes /etc/bind/named.conf
    > that is provided by bind.

    cfengine script ? is this some way of manipulating the config files ?

    > 2. Provide /etc/bind/named.conf.my and copy it into the right place later

    can I do this via postinst script - I would like to full automate the setupof
    my box

    >
    > Please be aware that it is not guaranteed which postinst script is called
    > first and thus it might happen that the bind postinst can be called either
    > before or after your own one. You have two chances to make sure that bind
    > postinst is called first:
    >
    > 1. Use bind as Pre-Depends.
    > 2. Use an apt Post-Inst hook that is called before apt ends its work
    > for your own package.


    Which is a safer option, isn't post-inst order still un deterministic, so Iam
    guess pre-depends is better

    >
    >> I have come across the replaces option for file handling I think, although
    >> now
    >> I am thinking that i should really just replace the files in the postinst
    >> scripts, after backing up the files into /var/backup

    >
    > You could save a backup there but I personally would prefer
    > /etc/bind/named.conf.orig because it is closer to the original location
    > in case you want to do later editing. Its a matter of personal taste.

    I usually use .orig, but I have notice a lot of packages (slapd, aptitude)
    placing there backups there, thought it might be the place to put them

    >
    >> My other thought aswell is that i need to use pre-depends on all the
    >> packages
    >> that I want, so that they are in place and configured before my packages
    >> tried
    >> to do any thing ?

    >
    > As I wrote above you can do this. Pre-Depends are a thing that is for
    > several reasons not a thing that maintainers like in official Debian
    > packages, but for a local package you have in mind it is OK.
    >
    >> Comments/ thoughts ?

    >
    > Good luck

    Thanks, glad to hear that is has been successfully before
    >
    > Andreas.
    >
    > --
    > http://fam-tille.de
    >
    >
    > --
    > To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact
    > listmaster@lists.debian.org
    >
    >


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHRnIhkZz88chpJ2MRAlYzAKDK1E41iHVXamM+SzdISI/JYynqqACfUq1h
    pefZoLQqjsEPs5WbctCqvck=
    =WOb9
    -----END PGP SIGNATURE-----


  6. Re: Help With Custom Deb Package

    On Fri, 23 Nov 2007, Alex Samad wrote:

    >> Yes, I'm doing this for years. I ended up with binary packages
    >> andreas-base, andreas-nox, andreas-x and andreas-laptop on my
    >> local mirror and these packages will be installed on new boxes.

    > sounds like where I am going


    Yes (according to the explanation in your other mail).

    >> 1. Use (for instance) a cfengine skript that changes /etc/bind/named.conf
    >> that is provided by bind.

    > cfengine script ? is this some way of manipulating the config files ?


    apt-cache show cfengine2
    http://www.cfengine.org/

    BTW, you probably want to have a look into FAI

    apt-cache show fai-quickstart

    If I would have to set up >=3 servers to set up at the same time I
    would go with FAI. Sounds like a really great concept. You have to
    invest some time in the beginning, but once you have done the first
    steps you will probably very happy. ;-)

    >> 2. Provide /etc/bind/named.conf.my and copy it into the right place later

    > can I do this via postinst script - I would like to full automate the setup of
    > my box


    Yes, but see below. And "full automate" smells really strong like FAI. ;-)

    >> Please be aware that it is not guaranteed which postinst script is called
    >> first and thus it might happen that the bind postinst can be called either
    >> before or after your own one. You have two chances to make sure that bind
    >> postinst is called first:
    >>
    >> 1. Use bind as Pre-Depends.
    >> 2. Use an apt Post-Inst hook that is called before apt ends its work
    >> for your own package.

    >
    > Which is a safer option, isn't post-inst order still un deterministic, so I am
    > guess pre-depends is better


    Sorry I meant "Post-Invoke". You drop a script into /etc/apt/apt.conf.d
    that contains

    DPkg {Post-Invoke {"Do-Your-Stuff-Script";};}

    >> You could save a backup there but I personally would prefer
    >> /etc/bind/named.conf.orig because it is closer to the original location
    >> in case you want to do later editing. Its a matter of personal taste.

    > I usually use .orig, but I have notice a lot of packages (slapd, aptitude)
    > placing there backups there, thought it might be the place to put them


    Well, than use not 'orig', but 'orig_before_my_script' ...

    > Thanks, glad to hear that is has been successfully before


    I guess FAI is done much more often and you might get quite good support
    on FAI lists. But regarding this topic I'm personally incompetent.

    Kind regards

    Andreas.

    --
    http://fam-tille.de


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  7. Re: Help With Custom Deb Package

    Alex Samad wrote:
    > Hi
    >
    > I am in the process of rebuilding one of my servers and I thought hey why not
    > build a package, that links all the other packages I need, and the
    > corresponding configuration files.
    >
    > I am guessing this has been thought of before but haven't seen anything for it,
    > so I thought I would come to the list (tried debian-user first but realised
    > that might have been the wrong place to ask the question)
    >
    > I am having a look at debhelper, debian policy and maint-guide.
    > for example for server test.acme.com
    >
    > I was going to create a package test.acme.com and making it dependant on the
    > required packages (I can specific a base minimum).
    >
    > Any one else done this, what hurdles might I face ? How am i going to handle 2
    > packages owning a file, for example for bind and my custom package and the file
    > /etc/bind/named.conf ???
    >
    > I have come across the replaces option for file handling I think, although now
    > I am thinking that i should really just replace the files in the postinst
    > scripts, after backing up the files into /var/backup
    >
    > My other thought aswell is that i need to use pre-depends on all the packages
    > that I want, so that they are in place and configured before my packages tried
    > to do any thing ?
    >
    > Comments/ thoughts ?

    I did this for Ubuntu clients some time ago. The principle is identical
    though, and I suggest you have a look at it, and maybe ask me questions
    would you have some.

    http://apt.bxlug.be/ubuntu/dupedi/

    > Alex




    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  8. Re: Help With Custom Deb Package

    Hi Alex!

    On Thu, 22 Nov 2007 22:20:12 +0100, Alex Samad wrote:
    > I am in the process of rebuilding one of my servers and I thought hey
    > why not build a package, that links all the other packages I need, and
    > the corresponding configuration files.


    Not that I'm an expert on it, but it seems that aj's implementation
    could be useful, at least for the first point, i.e. a metapackage that
    installs all the other packages you need:

    http://azure.humbug.org.au/~aj/blog/...hacking-equivs

    Thx, bye,
    Gismo / Luca


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  9. Re: Help With Custom Deb Package

    On Fri, 23 Nov 2007, Luca Capello wrote:

    > http://azure.humbug.org.au/~aj/blog/...hacking-equivs


    Well, if you really want a system to create your meta packages you could
    either use equivs or cdd-dev. AJ is right here that you add a little bit
    more complexity to the system, but if you would have a look at the
    debian-med sources as an example it is not that complex. The strategy
    just depends from the complexity you need.

    Kind regards

    Andreas.

    --
    http://fam-tille.de


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  10. Re: Help With Custom Deb Package

    On Fri, Nov 23, 2007 at 07:55:00AM +0100, Andreas Tille wrote:
    > On Fri, 23 Nov 2007, Alex Samad wrote:
    >
    >>> Yes, I'm doing this for years. I ended up with binary packages
    >>> andreas-base, andreas-nox, andreas-x and andreas-laptop on my
    >>> local mirror and these packages will be installed on new boxes.

    >> sounds like where I am going

    >
    > Yes (according to the explanation in your other mail).
    >
    >>> 1. Use (for instance) a cfengine skript that changes
    >>> /etc/bind/named.conf
    >>> that is provided by bind.

    >> cfengine script ? is this some way of manipulating the config files ?

    >
    > apt-cache show cfengine2
    > http://www.cfengine.org/


    looks good

    >
    > BTW, you probably want to have a look into FAI
    >
    > apt-cache show fai-quickstart


    looks interesting

    But hey seem a bit like overkill for what I am wanting to do right now, maybe
    it might evolving into using something like this

    >
    > If I would have to set up >=3 servers to set up at the same time I
    > would go with FAI. Sounds like a really great concept. You have to
    > invest some time in the beginning, but once you have done the first
    > steps you will probably very happy. ;-)
    >
    >>> 2. Provide /etc/bind/named.conf.my and copy it into the right place
    >>> later

    >> can I do this via postinst script - I would like to full automate the
    >> setup of
    >> my box

    >
    > Yes, but see below. And "full automate" smells really strong like FAI. ;-)
    >
    >>> Please be aware that it is not guaranteed which postinst script is called
    >>> first and thus it might happen that the bind postinst can be called
    >>> either
    >>> before or after your own one. You have two chances to make sure that
    >>> bind
    >>> postinst is called first:
    >>>
    >>> 1. Use bind as Pre-Depends.
    >>> 2. Use an apt Post-Inst hook that is called before apt ends its work
    >>> for your own package.

    >>
    >> Which is a safer option, isn't post-inst order still un deterministic, so
    >> I am
    >> guess pre-depends is better

    >
    > Sorry I meant "Post-Invoke". You drop a script into /etc/apt/apt.conf.d
    > that contains
    >
    > DPkg {Post-Invoke {"Do-Your-Stuff-Script";};}
    >
    >>> You could save a backup there but I personally would prefer
    >>> /etc/bind/named.conf.orig because it is closer to the original location
    >>> in case you want to do later editing. Its a matter of personal taste.

    >> I usually use .orig, but I have notice a lot of packages (slapd, aptitude)
    >> placing there backups there, thought it might be the place to put them

    >
    > Well, than use not 'orig', but 'orig_before_my_script' ...
    >
    >> Thanks, glad to hear that is has been successfully before

    >
    > I guess FAI is done much more often and you might get quite good support
    > on FAI lists. But regarding this topic I'm personally incompetent.
    >
    > Kind regards
    >
    > Andreas.

    thanks
    >
    > --
    > http://fam-tille.de
    >
    >
    > --
    > To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact
    > listmaster@lists.debian.org
    >
    >


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHR0EbkZz88chpJ2MRAgAbAKCE0Na1gXSUbhbPC7zFkw nh5c8DJwCeLS03
    6OS0kYwKAShN8ED2Rl6B+FU=
    =wchM
    -----END PGP SIGNATURE-----


  11. Re: Help With Custom Deb Package

    On Fri, Nov 23, 2007 at 10:46:14AM +0100, Luca Capello wrote:
    > Hi Alex!
    >
    > On Thu, 22 Nov 2007 22:20:12 +0100, Alex Samad wrote:
    > > I am in the process of rebuilding one of my servers and I thought hey
    > > why not build a package, that links all the other packages I need, and
    > > the corresponding configuration files.

    >
    > Not that I'm an expert on it, but it seems that aj's implementation
    > could be useful, at least for the first point, i.e. a metapackage that
    > installs all the other packages you need:
    >
    > http://azure.humbug.org.au/~aj/blog/...hacking-equivs


    That looks really good, (i missed the link earlier to the bug report). I guess
    for me, I am going to have a quite a few config files and placing them all in
    one file would not be the best solution, but it give me the ground work for
    creating my own meta-packages

    >
    > Thx, bye,
    > Gismo / Luca
    >
    >
    > --
    > To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    >
    >


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQFHR0I7kZz88chpJ2MRAjEdAKC7qaahAYrqb+XYd4KJBe OlG5gIyQCfefdS
    eDVl+WMFUNlBqKEw7iGVYyc=
    =IFO5
    -----END PGP SIGNATURE-----


+ Reply to Thread