summaryrefslogtreecommitdiff
path: root/packages/portabase/portabase_1.9.bb
blob: e6eb9716ffa2229d2b122640f1cf4455cb79fb80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
DESCRIPTION = "Portabase is a small database program for creating, browsing, \
and editing custom tables of data."
SECTION = "opie/applications"
LICENSE = "GPL"
HOMEPAGE = "http://portabase.sourceforge.net/"
DEPENDS = "metakit beecrypt"
APPNAME = "portabase"
PR = "r4"

SRC_URI = "${SOURCEFORGE_MIRROR}/portabase/portabase_${PV}.tar.gz \
	   file://qtopia.patch;patch=1 		\
	   file://fileselector.patch;patch=1    \
           file://qtversion.patch;patch=1 \
           file://qt2310-fontbug.patch;patch=1"

S = "${WORKDIR}/portabase"

inherit palmtop

do_configure_prepend() {
	find . -name "Makefile"|xargs rm -f
}

QMAKE_PROFILES = "portabase.pro"
QPEDIR = "${OPIEDIR}"
EXTRA_QMAKEVARS_POST += "CONFIG-=desktop"

# lrelease portabase.pro

do_install() {
	install -d ${D}${palmtopdir}/bin \
			${D}${palmtopdir}/apps/Applications \
			${D}${palmtopdir}/pics/${APPNAME}		\
			${D}${palmtopdir}/help/en
	install -D -m 0755 ${APPNAME} ${D}${palmtopdir}/bin/${APPNAME}
	install -m 0644 package/${APPNAME}.desktop ${D}${palmtopdir}/apps/Applications/${APPNAME}.desktop

	install -D -m 0644 pics/PortaBase.png ${D}${palmtopdir}/pics/PortaBase.png
	for f in calculator.png checked.png image.png note.png save.png save_disabled.png unchecked.png calendar.xpm QtaDatePickerNext.xpm QtaDatePickerPrev.xpm
	do
		install -D -m 0644 pics/$f ${D}${palmtopdir}/pics/${APPNAME}/$f
	done

	install -D -m 0644 help/html/${APPNAME}.html ${D}${palmtopdir}/help/en/html/${APPNAME}.html
}


pkg_postinst() {
#!/bin/sh

NEWTYPE=application/portabase
EXT=pob

T=${NEWTYPE%/*}
S=${NEWTYPE#*/}

grep  $EXT $QPEDIR/etc/mime.types |
(
    read TYPE EXTS
    if [ -z "$TYPE" ]
    then
        if grep -q "^$NEWTYPE[  ]" $QPEDIR/etc/mime.types || grep -q "^$NEWTYPE$" $QPEDIR/etc/mime.types
        then
            if sed -e '/^'$T"\\/"$S'[   ]/ s/$/ '$EXT'/' <$QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new ||
               sed -e '/^'$T"\\/"$S'$/ s/$/             '$EXT'/' <$QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new
            then
                mv $QPEDIR/etc/mime.types.new $QPEDIR/etc/mime.types
                exit 0
            else
                echo >&2 "Internal MIME type update error"
                exit 1
            fi
        else
            echo "" >>$QPEDIR/etc/mime.types
            sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' $QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new
            mv $QPEDIR/etc/mime.types.new $QPEDIR/etc/mime.types
            echo "$NEWTYPE              $EXT" >>$QPEDIR/etc/mime.types
            exit 0
        fi
    elif [ "$TYPE" = "$NEWTYPE" ]
    then
        #echo "Already done"
        exit 0
    else
        echo >&2 "$EXT already assigned to $TYPE"
        exit 1
    fi
)

NEWTYPE=text/x-csv
EXT=csv

T=${NEWTYPE%/*}
S=${NEWTYPE#*/}

grep  $EXT $QPEDIR/etc/mime.types |
(
    read TYPE EXTS
    if [ -z "$TYPE" ]
    then
        if grep -q "^$NEWTYPE[  ]" $QPEDIR/etc/mime.types || grep -q "^$NEWTYPE$" $QPEDIR/etc/mime.types
        then
            if sed -e '/^'$T"\\/"$S'[   ]/ s/$/ '$EXT'/' <$QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new ||
               sed -e '/^'$T"\\/"$S'$/ s/$/             '$EXT'/' <$QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new
            then
                mv $QPEDIR/etc/mime.types.new $QPEDIR/etc/mime.types
                exit 0
            else
                echo >&2 "Internal MIME type update error"
                exit 1
            fi
        else
            echo "" >>$QPEDIR/etc/mime.types
            sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba' $QPEDIR/etc/mime.types >$QPEDIR/etc/mime.types.new
            mv $QPEDIR/etc/mime.types.new $QPEDIR/etc/mime.types
            echo "$NEWTYPE              $EXT" >>$QPEDIR/etc/mime.types
            exit 0
        fi
    elif [ "$TYPE" = "$NEWTYPE" ]
    then
        #echo "Already done"
        exit 0
    else
        echo >&2 "$EXT already assigned to $TYPE"
        exit 1
    fi
)
}