Patchwork [RFC,3/4] pulseaudio 1.1: convert to useradd.bbclass

login
register
mail settings
Submitter Koen Kooi
Date Nov. 29, 2011, 9:25 p.m.
Message ID <1322601901-26195-3-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/15645/
State New
Headers show

Comments

Koen Kooi - Nov. 29, 2011, 9:25 p.m.
The only thing that got lost in the conversion is the "Pulse Audio daemon" description:

root@beagleboard:~# grep pulse /etc/passwd /etc/group
/etc/passwd:pulse:x:999:1000::/var/run/pulse:/bin/false
/etc/group:audio:x:29:pulse
/etc/group:pulse:x:1000:pulse

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/recipes-multimedia/pulseaudio/pulseaudio.inc  |   18 ++++++++----------
 .../pulseaudio/pulseaudio_1.1.bb                   |    2 +-
 2 files changed, 9 insertions(+), 11 deletions(-)
Koen Kooi - Dec. 1, 2011, 10:42 a.m.
Op 29 nov. 2011, om 22:25 heeft Koen Kooi het volgende geschreven:

> The only thing that got lost in the conversion is the "Pulse Audio daemon" description:
> 
> root@beagleboard:~# grep pulse /etc/passwd /etc/group
> /etc/passwd:pulse:x:999:1000::/var/run/pulse:/bin/false
> /etc/group:audio:x:29:pulse
> /etc/group:pulse:x:1000:pulse
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

No objections in the past 2 days, so I guess it's ready to go in. I'll send a rebased v2 in a minute.

regards,

Koen

Patch

diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
index 131d659..4170857 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -16,7 +16,7 @@  SRC_URI = "http://0pointer.de/lennart/projects/pulseaudio/pulseaudio-${PV}.tar.g
            file://gcc4-compile-fix.patch \
            file://volatiles.04_pulse"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig useradd
 
 EXTRA_OECONF = "\
 		--disable-lynx \
@@ -50,6 +50,12 @@  do_install_append() {
 	fi
 }
 
+USERADD_PACKAGES = "pulseaudio-server"
+GROUPADD_PARAM_pulseaudio-server = "pulse"
+USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
+                              --no-create-home --shell /bin/false \
+                              --groups audio,pulse --gid pulse pulse"
+
 PACKAGES =+ "libpulsecore libpulsecommon libpulsedsp libpulse libpulse-simple libpulse-browse libpulse-mainloop-glib \
              pulseaudio-server pulseaudio-misc pulseaudio-gconf-helper"
 
@@ -90,20 +96,12 @@  pkg_postinst_${PN}-server() {
         if [ "x$D" != "x" ]; then
                 exit 1
         fi
-        grep -q pulse: ${sysconfdir}/group || addgroup pulse
-        grep -q pulse: ${sysconfdir}/passwd || \
-            adduser --disabled-password --home=/var/run/pulse --system \
-                    --ingroup pulse --no-create-home -g "Pulse audio daemon" pulse
-        addgroup pulse audio
+
         if [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
             ${sysconfdir}/init.d/populate-volatile.sh update
         fi
 }
 
-pkg_postrm_${PN}-server() {
-        deluser pulse || true
-}
-
 python populate_packages_prepend() {
         #d.setVar('PKG_pulseaudio', 'pulseaudio')
 
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_1.1.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_1.1.bb
index 576d2b7..7fa5799 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_1.1.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_1.1.bb
@@ -1,6 +1,6 @@ 
 require pulseaudio.inc
 
-PR = "r2"
+PR = "r3"
 
 DEPENDS += "libjson gdbm speex libxml-parser-perl-native"