summaryrefslogtreecommitdiff
path: root/meta/opie-image.oe
blob: 9d0f1d866bb401b40413de0788afce749a107b61 (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
export IMAGE_BASENAME = "opie-image"
export IMAGE_LINGUAS = ""

# The included feeds are choosen by ${DISTRO}
export FEED_URIS_openzaurus = "OZ-3.5.1##http://openzaurus.org/official/unstable/3.5.1/feed/ \
			       OZ-Upgrades##http://openzaurus.org/official/unstable/3.5.1/upgrades/"

export FEED_URIS_familiar = "OZ-3.5.1##http://openzaurus.org/official/unstable/3.5.1/feed/ \
			     OZ-Upgrades##http://openzaurus.org/official/unstable/3.5.1/upgrades/"

PR = "r3"

include opie-collections.oe

#
# Putting it altogether. Better state IPKG_INSTALL and DEPENDS twice, because library names != package names.
#

export IPKG_INSTALL = "task-bootstrap ${OPIE_LIBS_RDEPENDS} ${OPIE_BASE} ${OPIE_BASE_APPLETS} \
                       ${OPIE_BASE_SETTINGS} ${OPIE_BASE_APPS} ${OPIE_BASE_RDEPENDS} \
                       ${OPIE_PIM} ${OPIE_EXTRA_APPLETS} ${OPIE_EXTRA_SETTINGS} \
                       ${OPIE_EXTRA_APPS} ${OPIE_BASE_STYLES} ${OPIE_BASE_DECOS} \
                       ${OPIE_BASE_INPUTMETHODS}"
 
DEPENDS = "task-bootstrap ${OPIE_LIBS_DEPENDS} ${OPIE_BASE} ${OPIE_BASE_APPLETS} \
            ${OPIE_BASE_SETTINGS}  ${OPIE_BASE_APPS} ${OPIE_BASE_DEPENDS} ${OPIE_PIM} \
            ${OPIE_EXTRA_APPLETS} ${OPIE_EXTRA_SETTINGS} ${OPIE_EXTRA_APPS} \
            ${OPIE_BASE_STYLES} ${OPIE_BASE_DECOS} ${OPIE_BASE_INPUTMETHODS}"

# merge feed-sources into ipkg.conf for opie-aqpkg as it can't handle feed-sources outside of ipkg.conf.
merge_feeds() {

	test -z "${FEED_URIS}" && exit 0

 	# comment out existing feed-sources inserted by ipkg-collateral
	cat ${IMAGE_ROOTFS}/etc/ipkg.conf | sed "s/^src\ /#src\ /" > ${IMAGE_ROOTFS}/etc/ipkg.conf_
	rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf
	
	# extract, then delete destinations
	cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
	cat ${IMAGE_ROOTFS}/etc/ipkg.conf | egrep -v "^dest\ " > ${IMAGE_ROOTFS}/etc/ipkg.conf_
	rm ${IMAGE_ROOTFS}/etc/ipkg.conf && mv ${IMAGE_ROOTFS}/etc/ipkg.conf_ ${IMAGE_ROOTFS}/etc/ipkg.conf


	for line in ${FEED_URIS}
	do
		# strip leading and trailing spaces/tabs, then split into name and uri
		line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
		feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
		feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"		

		# insert new feed-sources
		echo "src $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
	done
	
	# remove temporary files and rebuild ipkg.conf
	echo "" >> ${IMAGE_ROOTFS}/etc/ipkg.conf
	cat ${IMAGE_ROOTFS}/etc/ipkg.conf.dest >> ${IMAGE_ROOTFS}/etc/ipkg.conf
	rm ${IMAGE_ROOTFS}/etc/ipkg.conf.dest
	
	# remove -feed.conf files which are no longer needed
	cd ${IMAGE_ROOTFS}/etc/ipkg/ && rm -- *-feed.conf				
}


# zap the root password
#IMAGE_POSTPROCESS_COMMAND = "zap_root_password"

# merge feed-sources into ipkg.conf
IMAGE_PREPROCESS_COMMAND = "merge_feeds"

inherit image_ipk