diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/libcap | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/libcap')
-rw-r--r-- | meta/recipes-support/libcap/libcap.inc | 70 | ||||
-rw-r--r-- | meta/recipes-support/libcap/libcap/fix-CAP_LAST_CAP.patch | 39 | ||||
-rw-r--r-- | meta/recipes-support/libcap/libcap_2.22.bb | 6 |
3 files changed, 115 insertions, 0 deletions
diff --git a/meta/recipes-support/libcap/libcap.inc b/meta/recipes-support/libcap/libcap.inc new file mode 100644 index 0000000000..0e28ea04a9 --- /dev/null +++ b/meta/recipes-support/libcap/libcap.inc | |||
@@ -0,0 +1,70 @@ | |||
1 | SUMMARY = "Library for getting/setting POSIX.1e capabilities" | ||
2 | HOMEPAGE = "http://sites.google.com/site/fullycapable/" | ||
3 | |||
4 | # no specific GPL version required | ||
5 | LICENSE = "BSD | GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1" | ||
7 | |||
8 | DEPENDS = "perl-native-runtime" | ||
9 | |||
10 | SRC_URI = "${DEBIAN_MIRROR}/main/libc/libcap2/${BPN}2_${PV}.orig.tar.gz \ | ||
11 | file://fix-CAP_LAST_CAP.patch" | ||
12 | |||
13 | PR = "r1" | ||
14 | |||
15 | inherit lib_package | ||
16 | |||
17 | # do NOT pass target cflags to host compilations | ||
18 | # | ||
19 | do_configure() { | ||
20 | # libcap uses := for compilers, fortunately, it gives us a hint | ||
21 | # on what should be replaced with ?= | ||
22 | sed -e 's,:=,?=,g' -i Make.Rules | ||
23 | sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules | ||
24 | |||
25 | # disable gperf detection | ||
26 | sed -e '/shell gperf/cifeq (,yes)' -i libcap/Makefile | ||
27 | } | ||
28 | |||
29 | PACKAGECONFIG ??= "attr ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
30 | PACKAGECONFIG_class-native ??= "" | ||
31 | |||
32 | PACKAGECONFIG[attr] = "LIBATTR=yes,LIBATTR=no,attr" | ||
33 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" | ||
34 | |||
35 | EXTRA_OEMAKE += " \ | ||
36 | INDENT= \ | ||
37 | lib=${@os.path.basename('${libdir}')} \ | ||
38 | RAISE_SETFCAP=no \ | ||
39 | " | ||
40 | |||
41 | EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" | ||
42 | |||
43 | do_compile() { | ||
44 | oe_runmake ${EXTRA_OECONF} | ||
45 | } | ||
46 | |||
47 | do_install() { | ||
48 | oe_runmake install \ | ||
49 | ${EXTRA_OECONF} \ | ||
50 | DESTDIR="${D}" \ | ||
51 | prefix="${prefix}" \ | ||
52 | SBINDIR="${D}${sbindir}" | ||
53 | } | ||
54 | |||
55 | do_install_append() { | ||
56 | # Move the library to base_libdir | ||
57 | install -d ${D}${base_libdir} | ||
58 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then | ||
59 | mv ${D}${libdir}/* ${D}${base_libdir} | ||
60 | rmdir ${D}${libdir} | ||
61 | fi | ||
62 | } | ||
63 | |||
64 | FILES_${PN}-dev += "${base_libdir}/*.so" | ||
65 | |||
66 | # pam files | ||
67 | FILES_${PN} += "${base_libdir}/security/*.so" | ||
68 | FILES_${PN}-dbg += "${base_libdir}/security/.debug/*.so" | ||
69 | |||
70 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-support/libcap/libcap/fix-CAP_LAST_CAP.patch b/meta/recipes-support/libcap/libcap/fix-CAP_LAST_CAP.patch new file mode 100644 index 0000000000..a5571883d3 --- /dev/null +++ b/meta/recipes-support/libcap/libcap/fix-CAP_LAST_CAP.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | fix CAP_LAST_CAP | ||
2 | |||
3 | Upstream-Status: pending | ||
4 | |||
5 | Two new capability CAP_BLOCK_SUSPEND and CAP_WAKE_ALARM have been added into | ||
6 | kernel, but libcap did not update them. | ||
7 | Once libcap uses its capability.h (the default value of KERNEL_HEADERS), and | ||
8 | application always use capability.h from kernel, that will make cap_get_flag | ||
9 | return wrong value. | ||
10 | |||
11 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
12 | --- | ||
13 | libcap/include/linux/capability.h | 10 +++++++++- | ||
14 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/libcap/include/linux/capability.h b/libcap/include/linux/capability.h | ||
17 | index 4924f2a..57026be 100644 | ||
18 | --- a/libcap/include/linux/capability.h | ||
19 | +++ b/libcap/include/linux/capability.h | ||
20 | @@ -360,7 +360,15 @@ struct cpu_vfs_cap_data { | ||
21 | CAP_SYS_ADMIN is not acceptable anymore. */ | ||
22 | #define CAP_SYSLOG 34 | ||
23 | |||
24 | -#define CAP_LAST_CAP CAP_SYSLOG | ||
25 | +/* Allow triggering something that will wake the system */ | ||
26 | + | ||
27 | +#define CAP_WAKE_ALARM 35 | ||
28 | + | ||
29 | +/* Allow preventing system suspends */ | ||
30 | + | ||
31 | +#define CAP_BLOCK_SUSPEND 36 | ||
32 | + | ||
33 | +#define CAP_LAST_CAP CAP_BLOCK_SUSPEND | ||
34 | |||
35 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | ||
36 | |||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta/recipes-support/libcap/libcap_2.22.bb b/meta/recipes-support/libcap/libcap_2.22.bb new file mode 100644 index 0000000000..a989bb6a6b --- /dev/null +++ b/meta/recipes-support/libcap/libcap_2.22.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require libcap.inc | ||
2 | |||
3 | PR = "r6" | ||
4 | |||
5 | SRC_URI[md5sum] = "b4896816b626bea445f0b3849bdd4077" | ||
6 | SRC_URI[sha256sum] = "e1cae65d8febf2579be37c255d2e058715785ead481a4e6a4357a06aff84721f" | ||