increase dvbapp PR.
[vuplus_openembedded] / recipes / alsa / alsa-state.bb
1 # Copyright Matthias Hentges <devel@hentges.net> (c) 2007
2 # License: MIT (see http://www.opensource.org/licenses/mit-license.php
3 #               for a copy of the license)
4 #
5 # Filename: alsa-state.bb
6
7 DESCRIPTION = "Alsa Scenario Files"
8 LICENSE = "MIT"
9 PV = "0.2.0"
10 PR = "r11"
11
12 SRC_URI = "\
13   file://asound.conf \
14   file://asound.state \
15   file://alsa-state \
16 "
17
18 SRC_URI_append_a780 = "file://gsmhandset.state \
19                        file://gsmheadset.state \
20                        file://stereoout.state"
21
22 inherit update-rc.d
23
24 INITSCRIPT_NAME = "alsa-state"
25 INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
26
27 do_install() {
28     install -d ${D}${sysconfdir}/init.d
29     install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
30
31         install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
32         install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
33 }
34
35 PACKAGES += "alsa-states"
36
37 RRECOMMENDS_alsa-state = "alsa-states"
38 RRECOMMENDS_${PN}_om-gta01 = "virtual/alsa-scenarios"
39 RRECOMMENDS_${PN}_om-gta02 = "virtual/alsa-scenarios"
40
41 FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
42 CONFFILES_${PN} = "${sysconfdir}/asound.conf"
43
44 FILES_alsa-states = "${sysconfdir}/*.state"
45
46 PACKAGE_ARCH = "all"
47 PACKAGE_ARCH_alsa-states = "${MACHINE_ARCH}"
48
49 pkg_postinst_${PN}() {
50         if test -z "$D"
51         then
52                 if test -x /usr/sbin/alsactl
53                 then
54                         /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
55                 fi
56                 # INITSCRIPT_PARAMS changed, so remove the old and
57                 # install the new setting.
58                 update-rc.d -f ${INITSCRIPT_NAME} remove
59                 update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
60         fi
61 }