Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   Help With Custom Deb Package (http://www.linux-archive.org/debian-development/3370-help-custom-deb-package.html)

Andreas Tille 11-23-2007 05:11 AM

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

Alex Samad 11-23-2007 05:19 AM

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 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 ???
> >
> 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-<servername>

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


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

Alex Samad 11-23-2007 05:24 AM

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 setup of
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 I am
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
>
>


All times are GMT. The time now is 01:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.