![]() |
2011-04-16
, 15:40
|
Posts: 3,617 |
Thanked: 2,412 times |
Joined on Nov 2009
@ Cambridge, UK
|
#2
|
hi,
I'm developing an application with qt creator for n900.
In my app I need to save some stuff to a config file. This file should be located at "~/.myapp/config.xml".
Creating and editing the file at runtime is no problem but how do I add it to the debian package so that it will be installed along with the binary?
That should be the standard way in debian, should it?
The Following User Says Thank You to Rob1n For This Useful Post: | ||
![]() |
2011-04-16
, 15:43
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#3
|
hi,
I'm developing an application with qt creator for n900.
In my app I need to save some stuff to a config file. This file should be located at "~/.myapp/config.xml".
Creating and editing the file at runtime is no problem but how do I add it to the debian package so that it will be installed along with the binary?
That should be the standard way in debian, should it?
I search google and found many stuff regarding debian packaging but I'm didn't find a suitable answer.
|
2011-04-16
, 15:58
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#4
|
[...] case "$1" in configure) mkdir -p /etc/myapp/ echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" > /etc/myapp/config.xml echo "<root>" >> /etc/myapp/config.xml echo "</root>" >> /etc/myapp/config.xml ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac [...]
case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) rm -r /etc/myapp/ ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac
![]() |
2011-04-16
, 16:04
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#5
|
So in my postinst.ex file I have now the following code:
And that in my postrm.ex file:Code:[...] case "$1" in configure) mkdir -p /etc/myapp/ echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" > /etc/myapp/config.xml echo "<root>" >> /etc/myapp/config.xml echo "</root>" >> /etc/myapp/config.xml ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac [...]
Is that correct? I haven't tested it.Code:case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) rm -r /etc/myapp/ ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac
|
2011-04-16
, 16:37
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#6
|
![]() |
2011-04-16
, 16:40
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#7
|
|
2011-04-16
, 16:45
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#8
|
![]() |
2011-04-16
, 21:49
|
Posts: 3,617 |
Thanked: 2,412 times |
Joined on Nov 2009
@ Cambridge, UK
|
#9
|
|
2011-04-16
, 22:02
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#10
|
I'm developing an application with qt creator for n900.
In my app I need to save some stuff to a config file. This file should be located at "~/.myapp/config.xml".
Creating and editing the file at runtime is no problem but how do I add it to the debian package so that it will be installed along with the binary?
That should be the standard way in debian, should it?
I search google and found many stuff regarding debian packaging but I'm didn't find a suitable answer.