]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/meta/opie-image.bb
familiar: rework feed handling. add config files for v0.8.4(-rc*).
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / meta / opie-image.bb
1 export IMAGE_BASENAME = "opie-image"
2 export IMAGE_LINGUAS = ""
3
4 FEED_URIS_append_openzaurus = " opie##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/opie"
5 FEED_URIS_append_opensimpad = " opie##http://ewi546.ewi.utwente.nl/mirror/www.openzaurus.org/official/unstable/${DISTRO_VERSION}/feed/opie"
6
7 DISTRO_FEEDS_append_familiar () {
8
9 # opie - additional packages specific to the opie graphical environment
10 src/gz opie ${DISTRO_FEED_PREFIX}/opie
11 src/gz opie-${MACHINE} ${DISTRO_FEED_PREFIX}/opie/machine/${MACHINE}
12 }
13
14 DISTRO_LOCALE_FEEDS_PREFIXES_append_familiar = " ${DISTRO_FEED_PREFIX}/opie"
15
16 LICENSE = "MIT"
17 PR = "r19"
18
19 DEPENDS = "task-bootstrap meta-opie"
20
21 extra_stuff := '${@base_conditional("ROOT_FLASH_SIZE", "16", "", "task-opie-extra-games task-opie-extra-apps task-opie-extra-styles",d)}'
22
23 INSTALL_PACKAGES = "task-bootstrap task-opie-base task-opie-base-applets \
24                     task-opie-base-inputmethods task-opie-base-apps \
25                     task-opie-base-settings task-opie-base-decorations \
26                     task-opie-base-styles task-opie-base-pim \
27                     task-opie-extra-settings \
28                     task-opie-bluetooth task-opie-irda \
29                     ${extra_stuff}"
30
31 export IPKG_INSTALL = "${INSTALL_PACKAGES}"
32
33 # merge feed-sources into ipkg.conf for opie-aqpkg as it can't handle feed-sources outside of ipkg.conf.
34 merge_feeds() {
35
36         if ! test -z "${FEED_URIS}"
37         then
38                 # Die gracefully if ipkg-collateral failed
39                 if ! test -e "${IMAGE_ROOTFS}/etc/ipkg.conf"
40                 then
41                         echo "[${IMAGE_ROOTFS}/etc/ipkg.conf] is missing!"
42                         exit 1
43                 fi
44                 
45                 # comment out existing feed-sources inserted by ipkg-collateral
46                 cat ${IMAGE_ROOTFS}/etc/ipkg.conf | sed "s/^src\ /#src\ /" > ${IMAGE_ROOTFS}/etc/ipkg.conf_
47                 rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf
48                 
49                 # extract, then delete destinations
50                 cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
51                 cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep -v "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf_
52                 rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf
53
54
55                 for line in ${FEED_URIS}
56                 do
57                         # strip leading and trailing spaces/tabs, then split into name and uri
58                         line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
59                         feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
60                         feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"                
61
62                         # insert new feed-sources
63                         echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
64                 done
65                 
66                 # remove temporary files and rebuild ipkg.conf
67                 echo "" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
68                 cat ${IMAGE_ROOTFS}/etc/ipkg.conf.dest >> ${IMAGE_ROOTFS}/etc/ipkg.conf
69                 rm ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
70                 
71                 # remove -feed.conf files which are no longer needed
72                 cd ${IMAGE_ROOTFS}/etc/ipkg/ && rm -- *-feed.conf                               
73         fi
74 }
75
76 # merge feed-sources into ipkg.conf and create /etc/timestamp from build date
77 IMAGE_PREPROCESS_COMMAND = "merge_feeds; "
78
79 inherit image_ipk