pulseaudio: create pulse user and create /var/run/pulse via volatiles
authorKoen Kooi <koen@openembedded.org>
Sun, 4 Feb 2007 16:10:20 +0000 (16:10 +0000)
committerKoen Kooi <koen@openembedded.org>
Sun, 4 Feb 2007 16:10:20 +0000 (16:10 +0000)
packages/pulseaudio/files/.mtn2git_empty [new file with mode: 0644]
packages/pulseaudio/files/volatiles.04_pulse [new file with mode: 0644]
packages/pulseaudio/pulseaudio_0.9.5.bb

diff --git a/packages/pulseaudio/files/.mtn2git_empty b/packages/pulseaudio/files/.mtn2git_empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/pulseaudio/files/volatiles.04_pulse b/packages/pulseaudio/files/volatiles.04_pulse
new file mode 100644 (file)
index 0000000..5b19980
--- /dev/null
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d pulse pulse 0755 /var/run/pulse none
index b620914..4cdee78 100644 (file)
@@ -10,10 +10,13 @@ DEPENDS += "alsa-lib"
 
 RPROVIDES = "esound esd"
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "http://0pointer.de/lennart/projects/pulseaudio/pulseaudio-${PV}.tar.gz"
 
+SRC_URI += "file://volatiles.04_pulse"
+
+
 inherit autotools pkgconfig
 
 EXTRA_OECONF = "\
@@ -27,19 +30,48 @@ EXTRA_OECONF = "\
 
 PARALLEL_MAKE = ""
 
+
+do_install_append() {
+       install -m 0644 ${WORKDIR}/volatiles.04_pulse  ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
+}
+
+
 LEAD_SONAME = "libpulse.so"
 
-PACKAGES =+ "${PN}-conf ${PN}-bin"
+PACKAGES =+ "${PN}-bin ${PN}-conf"
 PACKAGES_DYNAMIC = "pulseaudio-module-* pulseaudio-lib-*"
 
 FILES_${PN}-conf = "${sysconfdir}"
-FILES_${PN}-bin = "${bindir}/*"
+FILES_${PN}-bin = "${bindir}/* \
+                   ${sysconfdir}/default/volatiles/volatiles.04_pulse"
 
 CONFFILES_${PN}-conf = "\ 
                        ${sysconfdir}/pulse/default.pa \
                       ${sysconfdir}/pulse/daemon.conf \
                       ${sysconfdir}/pulse/client.conf \
                       "
+pkg_postinst_${PN}-bin() {
+if test "x$D" != "x"; then
+        exit 1
+else
+        grep -q pulse: /etc/group || addgroup pulse
+        grep -q pulse: /etc/passwd || \
+            adduser --disabled-password --home=/var/run/pulse/ --system \
+                    --ingroup pulse --no-create-home -g "Pulse audio daemon" pulse                                            
+        /etc/init.d/populate-volatile.sh update
+fi
+}
+
+pkg_postrm${PN}-bin() {
+if test "x$D" != "x"; then
+        exit 1
+else
+        deluser pulse
+fi
+}
+
+
+
 
 do_stage() {
        autotools_stage_all