Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm a newbie with package creation so please feel free to slap me down as needed :). In any case, I wanted to create a package that would install and set up all of specific ldap related packages and config files (heavily customized). The problem that I'm having is that my ldap.conf configuration file will not install onto the local system when doing an gdebi "package name". I'm expecting that the ldap.conf file will be copied into /etc. Here is my structure (created from dh_make):

root@clientb-16:~/navldapubuntu-0.1# ls
debian  ldap.conf
root@clientb-16:~/navldapubuntu-0.1# cd debian
root@clientb-16:~/navldapubuntu-0.1/debian# ls
changelog  control    docs  files    README.Debian  rules   navldapubuntu                navldapubuntu.doc-base.EX
compat     copyright  etc   install  README.source  source  navldapubuntu.debhelper.log  navldapubuntu.substvars
root@clientb-16:~/navldapubuntu-0.1/debian#

I have an ldap.conf file in the top level directory and specified it in the install file as follows:

root@clientb-16:~/navldapubuntu-0.1/debian# more install
ldap.conf etc

It's definitely in the package after doing a "dpkg --contents"...am I way off base? I thought files would automatically get installed. Please help a newb!!:

share|improve this question
    
I'm not an expert, but I'm sure it would help to look into what the rules file does. I'm not sure if the install file is really an official Debian package file or whether it is just supposed to be used by your rules script. So maybe you could update the question with its contents? –  Timo Kluck Mar 20 '13 at 0:25
    
The install file is used by dh_install, if the package uses debhelper for building. –  dsh Mar 20 '13 at 1:21
    
You are probably using the wrong tool (package management) to complete a task (configuration management). You should have a look at chef: wiki.opscode.com/display/chef/Home –  LiveWireBT Mar 20 '13 at 5:14
add comment

1 Answer 1

up vote 0 down vote accepted

When I want to verify the contents of a package I have built, I use dpkg-deb to unpack it in a temporary directory.

$ mkdir /tmp/t
$ dpkg-deb -x foo.deb /tmp/t
$ ls /tmp/t

Does the package install successfully or is there an error? dpkg does not allow more than one package to provide the same file. If another installed package contains that file then your package will fail to install. I searched the contents of official packages for ldap.conf[1], and I find /etc/ldap/ldap.conf instead.

You may find dpkg-divert to be useful to you. I haven't actually used it, but it is there.

[1]: http://packages.ubuntu.com/search?mode=exactfilename&suite=quantal&section=all&arch=any&keywords=ldap.conf&searchon=contents
share|improve this answer
    
Thanks so much!! The package has always successfully installed. I think the problem is exactly what you stated. I built a package, removed the package, and re-installed. Each time I re-installed the file would not get copied over. Couple of questions:(1) Is it possible to do this in a postinst or one of the pre* scripts. I was thinking of a postinst script that does an "install -b /etc/ldap.conf /etc/ldap.conf". I tried this, but it didn't as it couldn't find the source ldap.conf file. This seems easier, but it didn't work. Thanks again!!! –  user2175757 Mar 20 '13 at 17:33
    
I'd like to add that I was using gdebi to install the local package I built and never saw an error when installing the package. –  user2175757 Mar 20 '13 at 18:27
    
Purge the package after removing it. dh may be automatically marking the file as a conffile since it is in /etc. conffiles are not deleted on package removal, but are deleted on package purge. (this is to allow removing, then reinstalling, a package without losing your configuration) The install command you show in your comment can't work because it would be a no-op if it did (install the file right where it already is :)) –  dsh Mar 20 '13 at 20:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.