* updating debian package files
[mdictionary] / debian / mdictionary.postinst
1 #!/bin/sh
2
3 if [ "$1" != "upgrade" ]
4 then
5 # End automatically added section
6 echo -e "Selecting menu location" 
7 maemo-select-menu-location mdictionary.desktop
8 # End automatically added section
9 echo -e "Creating 'Polish - English Sample Dictionary' dictionary" 
10 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/name "Polish-English_Sample_Dictionary"'
11 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/path "/usr/share/mdictionary/dictionaries/StarDictSampleDict"'
12 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/active true'
13 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/StarDictSampleDict/optimized false'
14 echo -e "Creating 'English - Polish Sample Dictionary' dictionary" 
15 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/name "English-Polish_Sample_Dictionary"'
16 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/path "/usr/share/mdictionary/dictionaries/XDXFSampleDict"'
17 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/active true'
18 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/XDXFSampleDict/optimized false'
19
20 echo -e "Adding gconf entries for search engines" 
21 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/engines/xdxf/path "/usr/lib/mdictionary/engine_xdxf.so"'
22 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/engines/stardict/path "/usr/lib/mdictionary/engine_stardict.so"'
23
24 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/engines/bookmarks/path "/usr/lib/mdictionary/engine_bookmarks.so"'
25 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/bookmarks/name "Bookmarks"'
26 su $USER -c 'gconftool-2 --type string --set /apps/maemo/mdictionary/dictionaries/bookmarks/path "/usr/share/mdictionary/dictionaries/bookmarks"'
27 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/bookmarks/active false'
28 su $USER -c 'gconftool-2 --type bool --set /apps/maemo/mdictionary/dictionaries/bookmarks/optimized true'
29
30 echo -e "Changing privilages" 
31 chmod -R 0777 /usr/share/mdictionary/dictionaries
32
33 if [ -f /usr/share/applications/uri-action-defaults.list ]
34 then
35    if [ -z $(grep mdict=hildon-mdictionary.desktop /usr/share/applications/uri-action-defaults.list) ]
36    then
37       echo -e "Adding mdict URI action - uri-action-defaults.list"
38       echo -en "mdict=hildon-mdictionary.desktop" >> /usr/share/applications/uri-action-defaults.list
39    else
40       echo -en "\n\nThere is an entry about mdictionary in uri-action already ... \n\n"
41    fi
42    if [ -z `grep 'mdict=hildon-mdictionary.desktop' /usr/share/applications/schemeinfo.cache` ]
43    then
44       echo -e "Adding mdict URI action - schemeinfo.cache"
45       echo -en "mdict=hildon-mdictionary.desktop" >> /usr/share/applications/schemeinfo.cache
46    else
47       echo -en "\n\nThere is an entry about mdictionary in schemeinfo already ... \n\n"
48    fi
49
50 fi
51
52 fi