LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 01-26-2007, 08:45 PM   #1
odiseo77
Senior Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,019

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Question Building my own .deb package (help on postinst config)


Hi all, first excuse me if this is more suitable on the programming section (a mod can move it there if he/she prefer). The point is this: I'm building the linux packages for Mercury (a multiplatform MSN messenger clone). Since it's distributed in binary .zip files, I have to make a virtual file system on my home directory and then run 'dpkg-deb -b /home/username/fake_file_system' to build the package, after that, I convert the .deb package to .rpm and .tgz packages using alien. Everything works like a charm, no problems here, but I'd like my packages to come preconfigured for new users because Mercury has a lot of hidden options and need some tweking to work properly (to use the sound system of the desktop you're running and to set the default browser, etc.); for this, Mercury uses a file named GlobalSettings.xml which is stored under /home/username/.Mercury; so basically what I need is to create two GlobalSettings.xml files: one for KDE (using artsplay as sound player) and other one for GNOME and other DE's like fluxbox, XFCE, etc which use mainly alsa as the default sound player. (I think these two files could go in '/usr/share/mercury'), but I need a postinstall script which detects whether the directory '/home/username/.Mercury' exists or not, and if the directory exists do nothing (don't write a new GlobalSettings.xml file there because it would erase a previous config), but if the directory does not exist, then detect which desktop is the user running and write one of the 2 GlobalSettings.xml files in the directory.

So my question is, which file(s) under my /home/username/fake_file_system/DEBIAN directory do the job of the post-installation config and which manual(s) should I read in order to edit these files (so far I only have a '.../DEBIAN/control' file). I've read the debian new maintainers' guide and they say something about a postinst.ex file which, I assume' is the one that does this job, but the reference is rather superficial and doesn't point me to any other manual on how to create a postinstall configuration file.

Oh, and another question: after succesfully building a preconfigured .deb package will this package run fine on other systems after converting it with alien?? (I mean, the postinstallation script will run on the .rpm and .tgz packages??).

Thanks in adavance.
 
Old 01-28-2007, 08:49 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,684

Rep: Reputation: 124Reputation: 124
Well, your cause is very noble, but it's still a script request. Not sure if that's allowed here.

Anyway, I'll give you the benefit of the doubt. Try this:
Code:
#! /bin/bash

S1=`ls -a $HOME | grep .Mercury`
if [ "$S1" = ".Mercury" ]; then
echo found a previous Mercury install, not writing default configuration
exit 0
else
echo no configuration file found, creating default
# <insert write command for xml file here>

exit 0
I know this fails, but you'd have to think along this line.
 
Old 01-28-2007, 09:52 AM   #3
odiseo77
Senior Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,019

Original Poster
Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Hi Dutch Master, thanks for your answer. Well, I don't see anything wrong with scripts as they can be very usefull in these cases (I don't know how to make complex bash scripts, but I can try with a guide under my arm, lol). But what I'd specially like to know is, which file(s) of the debian packaging system do the job of the postinstall configuration. Also a good manual on how to edit these files would be very usefull for me (I've read the Debian New Maintainers' guide but as I said above, the reference to the postinst.ex file is rather vague).

Anyway, creating preconfigured linux packages of Mercury is not that important since most of the people using mercury has a previous configuration (it would be usefull only for new users)... I rather see this as an opportunity to challenge myself and learn something new, but if it's too complex for me to write these scripts, well, I'll leave it like that (I've managed to build the packages anyway).

Thanks in advance.
 
Old 01-28-2007, 11:49 AM   #4
odiseo77
Senior Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,019

Original Poster
Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
ok, I found the file in question, it's the 'postinst' script under the '.../DEBIAN' subdirectory of the fake file system... Thanks for your help.
 
  


Reply

Tags
build


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.deb postinst and prerm probs mithereal Debian 1 09-28-2005 03:24 AM
How to make deb package chrisstooss Debian 6 09-16-2005 06:21 PM
How to install deb package tstrickland Linux - Newbie 10 07-21-2005 07:39 PM
help with deb package on Xandros 3.0 xiongnu Debian 2 06-09-2005 12:03 AM
building optimized deb-src packages (debian/rules) Rounan Debian 1 02-17-2004 01:03 PM


All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration