useradd-example: use ${datadir} instead of /usr/share for packaging
It is considered good practice to use the build system provided variables instead of directly specify hardcoded paths. (From OE-Core rev: b93a9dadc9a2754d4e33929bda8dba46dd20b694) Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
344c40b97b
commit
84728a1e8f
|
@ -1,7 +1,7 @@
|
||||||
SUMMARY = "Example recipe for using inherit useradd"
|
SUMMARY = "Example recipe for using inherit useradd"
|
||||||
DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
|
DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
|
||||||
SECTION = "examples"
|
SECTION = "examples"
|
||||||
PR = "r0"
|
PR = "r1"
|
||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
|
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
|
||||||
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
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"
|
GROUPADD_PARAM_${PN}-user3 = "-g 900 group3"
|
||||||
|
|
||||||
do_install () {
|
do_install () {
|
||||||
install -d -m 755 ${D}/usr/share/user1
|
install -d -m 755 ${D}${datadir}/user1
|
||||||
install -d -m 755 ${D}/usr/share/user2
|
install -d -m 755 ${D}${datadir}/user2
|
||||||
install -d -m 755 ${D}/usr/share/user3
|
install -d -m 755 ${D}${datadir}/user3
|
||||||
|
|
||||||
install -p -m 644 file1 ${D}/usr/share/user1/
|
install -p -m 644 file1 ${D}${datadir}/user1/
|
||||||
install -p -m 644 file2 ${D}/usr/share/user1/
|
install -p -m 644 file2 ${D}${datadir}/user1/
|
||||||
|
|
||||||
install -p -m 644 file2 ${D}/usr/share/user2/
|
install -p -m 644 file2 ${D}${datadir}/user2/
|
||||||
install -p -m 644 file3 ${D}/usr/share/user2/
|
install -p -m 644 file3 ${D}${datadir}/user2/
|
||||||
|
|
||||||
install -p -m 644 file3 ${D}/usr/share/user3/
|
install -p -m 644 file3 ${D}${datadir}/user3/
|
||||||
install -p -m 644 file4 ${D}/usr/share/user3/
|
install -p -m 644 file4 ${D}${datadir}/user3/
|
||||||
|
|
||||||
# The new users and groups are created before the do_install
|
# The new users and groups are created before the do_install
|
||||||
# step, so you are now free to make use of them:
|
# step, so you are now free to make use of them:
|
||||||
chown -R user1 ${D}/usr/share/user1
|
chown -R user1 ${D}${datadir}/user1
|
||||||
chown -R user2 ${D}/usr/share/user2
|
chown -R user2 ${D}${datadir}/user2
|
||||||
chown -R user3 ${D}/usr/share/user3
|
chown -R user3 ${D}${datadir}/user3
|
||||||
|
|
||||||
chgrp -R group1 ${D}/usr/share/user1
|
chgrp -R group1 ${D}${datadir}/user1
|
||||||
chgrp -R group2 ${D}/usr/share/user2
|
chgrp -R group2 ${D}${datadir}/user2
|
||||||
chgrp -R group3 ${D}/usr/share/user3
|
chgrp -R group3 ${D}${datadir}/user3
|
||||||
}
|
}
|
||||||
|
|
||||||
FILES_${PN} = "/usr/share/user1/* /usr/share/user2/*"
|
FILES_${PN} = "${datadir}/user1/* ${datadir}/user2/*"
|
||||||
FILES_${PN}-user3 = "/usr/share/user3/*"
|
FILES_${PN}-user3 = "${datadir}/user3/*"
|
||||||
|
|
||||||
# Prevents do_package failures with:
|
# Prevents do_package failures with:
|
||||||
# debugsources.list: No such file or directory:
|
# debugsources.list: No such file or directory:
|
||||||
|
|
Loading…
Reference in New Issue