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