diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-support/libcap | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-support/libcap')
-rw-r--r-- | meta/recipes-support/libcap/libcap.inc | 68 | ||||
-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, 113 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..fef700a629 --- /dev/null +++ b/meta/recipes-support/libcap/libcap.inc | |||
@@ -0,0 +1,68 @@ | |||
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 = "attr perl-native-runtime" | ||
9 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
10 | # attr and pam are disabled by EXTRA_OEMAKE_class-native | ||
11 | DEPENDS_class-native = "perl-native-runtime" | ||
12 | |||
13 | SRC_URI = "${DEBIAN_MIRROR}/main/libc/libcap2/${BPN}2_${PV}.orig.tar.gz \ | ||
14 | file://fix-CAP_LAST_CAP.patch" | ||
15 | |||
16 | PR = "r1" | ||
17 | |||
18 | inherit lib_package | ||
19 | |||
20 | # do NOT pass target cflags to host compilations | ||
21 | # | ||
22 | do_configure() { | ||
23 | # libcap uses := for compilers, fortunately, it gives us a hint | ||
24 | # on what should be replaced with ?= | ||
25 | sed -e 's,:=,?=,g' -i Make.Rules | ||
26 | sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules | ||
27 | |||
28 | # disable gperf detection | ||
29 | sed -e '/shell gperf/cifeq (,yes)' -i libcap/Makefile | ||
30 | } | ||
31 | |||
32 | EXTRA_OEMAKE = " \ | ||
33 | LIBATTR=yes \ | ||
34 | PAM_CAP=${@base_contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} \ | ||
35 | INDENT= SYSTEM_HEADERS=${STAGING_INCDIR} RAISE_SETFCAP=no \ | ||
36 | lib=${@os.path.basename('${libdir}')} \ | ||
37 | " | ||
38 | EXTRA_OEMAKE_class-native = " \ | ||
39 | LIBATTR=no \ | ||
40 | PAM_CAP=no \ | ||
41 | INDENT= \ | ||
42 | lib=${@os.path.basename('${libdir}')} \ | ||
43 | " | ||
44 | |||
45 | do_compile() { | ||
46 | oe_runmake | ||
47 | } | ||
48 | |||
49 | do_install() { | ||
50 | oe_runmake install DESTDIR="${D}" prefix="${prefix}" SBINDIR="${D}${sbindir}" | ||
51 | } | ||
52 | |||
53 | do_install_append() { | ||
54 | # Move the library to base_libdir | ||
55 | install -d ${D}${base_libdir} | ||
56 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then | ||
57 | mv ${D}${libdir}/* ${D}${base_libdir} | ||
58 | rmdir ${D}${libdir} | ||
59 | fi | ||
60 | } | ||
61 | |||
62 | FILES_${PN}-dev += "${base_libdir}/*.so" | ||
63 | |||
64 | # pam files | ||
65 | FILES_${PN} += "${base_libdir}/security/*.so" | ||
66 | FILES_${PN}-dbg += "${base_libdir}/security/.debug/*.so" | ||
67 | |||
68 | BBCLASSEXTEND = "native" | ||
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" | ||