enigma2 : change vfd font (skin_user.xml)
[vuplus_openembedded] / recipes / gpe-icons / gpe-icons.inc
1 SECTION = "gpe"
2 RDEPENDS += "gdk-pixbuf-loader-png"
3
4 #only icons present in the package
5 PACKAGE_ARCH = "all"
6
7 INC_PR = "r5"
8
9 ALTERNATIVE_NAME = "gpe-pixmaps"
10 ALTERNATIVE_LINK = "${datadir}/gpe/pixmaps"
11 ALTERNATIVE_PATH = "${datadir}/gpe/pixmaps.${PN}"
12 ALTERNATIVE_PRIORITY ?= 1
13
14 # copy icons from other alternatives if they are not provided by current alternative
15 # ie gpe-sketchbook install own icon to pixmaps dir even before gpe-icons_*.bb is installed
16 # so if we switch pixmaps link to neo theme, there would be no icon for gpe-sketchbook 
17 # unless we copy it to neo theme in postinst too
18 # inherit update-alternatives is not used, because not all distributions want to use it 
19 # and conditional inherit is a bit difficult to use (inherit ${GPE_INHERIT} works, but only if we always want at least 1 bbclass)
20
21 pkg_postinst_shr() {
22         if [[ -e ${ALTERNATIVE_LINK} && ! -h ${ALTERNATIVE_LINK} ]] ; then
23                 echo "warn: ${ALTERNATIVE_LINK} exists and it's not a link!"
24                 echo "warn: It will be replaced with link managed by update-alternatives"
25                 echo "warn: Moving ${ALTERNATIVE_LINK} to ${ALTERNATIVE_LINK}.old."
26                 echo "warn: It should be empty but probably isn't!"
27                 echo "warn: Check what's left there and remove it manually."
28                 mv -f ${ALTERNATIVE_LINK} ${ALTERNATIVE_LINK}.old
29         fi
30         pixmap_dirs_root="${datadir}/gpe/"
31         cd ${pixmap_dirs_root}
32         for pixmap_dir in pixmaps.*; do
33                 if [ "${pixmap_dir}"x == "pixmaps.${PN}"x ] ; then
34                           continue;
35                 fi
36                 for pixmap in `find ${pixmap_dir}`; do 
37                           pixmap_target=`echo ${pixmap} | sed "s/${pixmap_dir}/pixmaps.${PN}/g"`; 
38                           if [ ! -e ${pixmap_target} ] ; then 
39                                       cp -ra ${pixmap} ${pixmap_target}; 
40                                       echo "${pixmap} merged"; 
41                           fi; 
42                 done
43         done
44         update-alternatives --install ${ALTERNATIVE_LINK} ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH} ${ALTERNATIVE_PRIORITY}
45 }
46
47 pkg_postrm_shr() {
48         update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}
49 }