Patchwork [v2,07/28] useradd-example: use ${datadir} instead of /usr/share for packaging

login
register
mail settings
Submitter Javier Martinez Canillas
Date Aug. 5, 2012, 7:48 p.m.
Message ID <1344196136-7643-8-git-send-email-javier@dowhile0.org>
Download mbox | patch
Permalink /patch/33915/
State Accepted
Commit b93a9dadc9a2754d4e33929bda8dba46dd20b694
Headers show

Comments

Javier Martinez Canillas - Aug. 5, 2012, 7:48 p.m.
It is considered good practice to use the build system provided
variables instead of directly specify hardcoded paths.

Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 .../recipes-skeleton/useradd/useradd-example.bb    |   36 ++++++++++----------
 1 files changed, 18 insertions(+), 18 deletions(-)

Patch

diff --git a/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
index b10c1d0..53d2340 100644
--- a/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
+++ b/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
@@ -1,7 +1,7 @@ 
 SUMMARY = "Example recipe for using inherit useradd"
 DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
 SECTION = "examples"
-PR = "r0"
+PR = "r1"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
@@ -43,32 +43,32 @@  GROUPADD_PARAM_${PN} = "-g 880 group1; -g 890 group2"
 GROUPADD_PARAM_${PN}-user3 = "-g 900 group3"
 
 do_install () {
-	install -d -m 755 ${D}/usr/share/user1
-	install -d -m 755 ${D}/usr/share/user2
-	install -d -m 755 ${D}/usr/share/user3
+	install -d -m 755 ${D}${datadir}/user1
+	install -d -m 755 ${D}${datadir}/user2
+	install -d -m 755 ${D}${datadir}/user3
 
-	install -p -m 644 file1 ${D}/usr/share/user1/
-	install -p -m 644 file2 ${D}/usr/share/user1/
+	install -p -m 644 file1 ${D}${datadir}/user1/
+	install -p -m 644 file2 ${D}${datadir}/user1/
 
-	install -p -m 644 file2 ${D}/usr/share/user2/
-	install -p -m 644 file3 ${D}/usr/share/user2/
+	install -p -m 644 file2 ${D}${datadir}/user2/
+	install -p -m 644 file3 ${D}${datadir}/user2/
 
-	install -p -m 644 file3 ${D}/usr/share/user3/
-	install -p -m 644 file4 ${D}/usr/share/user3/
+	install -p -m 644 file3 ${D}${datadir}/user3/
+	install -p -m 644 file4 ${D}${datadir}/user3/
 
 	# The new users and groups are created before the do_install
 	# step, so you are now free to make use of them:
-	chown -R user1 ${D}/usr/share/user1
-	chown -R user2 ${D}/usr/share/user2
-	chown -R user3 ${D}/usr/share/user3
+	chown -R user1 ${D}${datadir}/user1
+	chown -R user2 ${D}${datadir}/user2
+	chown -R user3 ${D}${datadir}/user3
 
-	chgrp -R group1 ${D}/usr/share/user1
-	chgrp -R group2 ${D}/usr/share/user2
-	chgrp -R group3 ${D}/usr/share/user3
+	chgrp -R group1 ${D}${datadir}/user1
+	chgrp -R group2 ${D}${datadir}/user2
+	chgrp -R group3 ${D}${datadir}/user3
 }
 
-FILES_${PN} = "/usr/share/user1/* /usr/share/user2/*"
-FILES_${PN}-user3 = "/usr/share/user3/*"
+FILES_${PN} = "${datadir}/user1/* ${datadir}/user2/*"
+FILES_${PN}-user3 = "${datadir}/user3/*"
 
 # Prevents do_package failures with:
 # debugsources.list: No such file or directory: