fso-sounds: add fso-sounds-extras package with all remaining sounds and RSUGGEST it
[openembedded.git] / recipes / gpe-icons / gpe-icons.inc
blob706e6fb946839aedfe05da6da87e245b71258c26
1 SECTION = "gpe"
2 RDEPENDS_${PN} += "gdk-pixbuf-loader-png"
4 #only icons present in the package
5 PACKAGE_ARCH = "all"
7 INC_PR = "r6"
9 ALTERNATIVE_NAME = "gpe-pixmaps"
10 ALTERNATIVE_LINK = "${datadir}/gpe/pixmaps"
11 ALTERNATIVE_PATH = "${datadir}/gpe/pixmaps.${PN}"
12 ALTERNATIVE_PRIORITY ?= 1
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)
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}
47 pkg_postrm_shr() {
48         update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}