PDA

View Full Version : .deb Package removes /opt


nbkr
October 17th, 2007, 02:39 AM
Hi,

I'm writing a small java application (just for testing, nothing useful) and wanted to create a .deb file, so that the software is easy to install.

I could create the deb file and it installs nicely. The software is installed to /opt/nbkr.net/jfeierabend. When I now remove the package via "dpkg --purge jfeierabend" the /opt Folder is removed. (In fact also /usr/local/bin is removed, but I think its the same problem).

Is there any way to avoid this?

Here is how I created the .deb file.

Create a directory "package" with the following content:

$ ls -R
.:
DEBIAN opt usr

./DEBIAN:
control

./opt:
nbkr.net

./opt/nbkr.net:
jfeierabend

./opt/nbkr.net/jfeierabend:
bin conf lib

./opt/nbkr.net/jfeierabend/bin:
jfeierabend.sh

./opt/nbkr.net/jfeierabend/conf:
config.properties

./opt/nbkr.net/jfeierabend/lib:
jfeierabend.jar swt.jar

./usr:
local share

./usr/local:
bin

./usr/local/bin:
jfeierabend

./usr/share:
applications

./usr/share/applications:
jfeierabend.desktop




Heres the content of the "control" File


Package: jfeierabend
Maintainer: MyName <my@mail.address>
Version: 0.0.0
Architecture: all
Section: misc
Priority: optional
Depends:
Suggests:
Description: A simple application that shows how long till "Feierabend".
Doesn't do any useful things. Just demonstrates how Java Gui development can be organised.


This is the command I'm running to create the .deb

find opt/ -type f -exec md5sum {} \; >> DEBIAN/md5sums
find usr/ -type f -exec md5sum {} \; >> DEBIAN/md5sums

fakeroot dpkg-deb --build linux_installer jfeierabend.deb


Any help is highly appreciated!

Regards
nbkr