diff options
Diffstat (limited to 'meta/recipes-support/libcap-ng')
6 files changed, 123 insertions, 97 deletions
diff --git a/meta/recipes-support/libcap-ng/libcap-ng-python_0.8.2.bb b/meta/recipes-support/libcap-ng/libcap-ng-python_0.8.2.bb new file mode 100644 index 0000000000..1240589d00 --- /dev/null +++ b/meta/recipes-support/libcap-ng/libcap-ng-python_0.8.2.bb @@ -0,0 +1,28 @@ +require libcap-ng.inc + +FILESEXTRAPATHS:prepend := "${THISDIR}/libcap-ng:" + +SUMMARY .= " - python" + +inherit lib_package autotools python3targetconfig + +DEPENDS += "libcap-ng python3 swig-native" + +S = "${WORKDIR}/libcap-ng-${PV}" + +EXTRA_OECONF += "--with-python --with-python3" + +do_install:append() { + rm -rf ${D}${bindir} + rm -rf ${D}${libdir}/.debug + rm -f ${D}${libdir}/lib* + rm -rf ${D}${libdir}/pkgconfig + rm -rf ${D}${datadir} + rm -rf ${D}${includedir} +} + +# PACKAGES = "${PN}" + +FILES:${PN} = "${libdir}/python${PYTHON_BASEVERSION}" +FILES:${PN}-dbg =+ "${PYTHON_SITEPACKAGES_DIR}/.debug/_capng.so" + diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc new file mode 100644 index 0000000000..57fcd50d9f --- /dev/null +++ b/meta/recipes-support/libcap-ng/libcap-ng.inc @@ -0,0 +1,19 @@ +SUMMARY = "An alternate posix capabilities library" +DESCRIPTION = "The libcap-ng library is intended to make programming \ +with POSIX capabilities much easier than the traditional libcap library." +HOMEPAGE = "http://freecode.com/projects/libcap-ng" +SECTION = "base" +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" + +SRC_URI = "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \ + file://determinism.patch \ +" + +SRC_URI[sha256sum] = "52c083b77c2b0d8449dee141f9c3eba76e6d4c5ad44ef05df25891126cb85ae9" + +EXTRA_OECONF:append:class-target = " --with-capability_header=${STAGING_INCDIR}/linux/capability.h" +EXTRA_OECONF:append:class-nativesdk = " --with-capability_header=${STAGING_INCDIR}/linux/capability.h" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch b/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch new file mode 100644 index 0000000000..fbb7380f56 --- /dev/null +++ b/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch @@ -0,0 +1,59 @@ +[PATCH] bindings/python: Allow hardcoded path to capability.h to be overridden + +Currently the path to capability.h is hardcoded. When cross compiling +the host capabiity.h may be different to the target copy, leading +to different options being encoded in the python bindings than +expected. This causes a reproducibility issue amongst other potential +problems. + +Add a configure option to optionally specify the right path to the +correct header as its probably safer/more reliable than trying to +query the compiler to get the header path. + +Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org +Upstream-Status: Submitted [https://github.com/stevegrubb/libcap-ng/pull/30] + +Index: libcap-ng-0.8.2/configure.ac +=================================================================== +--- libcap-ng-0.8.2.orig/configure.ac ++++ libcap-ng-0.8.2/configure.ac +@@ -63,6 +63,13 @@ AC_CHECK_HEADERS(sys/vfs.h, [ + AC_CHECK_HEADERS(linux/magic.h, [] [AC_MSG_WARN(linux/magic.h is required in order to verify procfs.)]) + ], [AC_MSG_WARN(sys/vfs.h is required in order to verify procfs.)]) + ++ ++AC_ARG_WITH([capability_header], ++ [AS_HELP_STRING([--with-capability_header=path : path to cpapbility.h])], ++ [CAPABILITY_HEADER=$withval], ++ [CAPABILITY_HEADER=/usr/include/linux/capability.h]) ++AC_SUBST(CAPABILITY_HEADER) ++ + AC_C_CONST + AC_C_INLINE + AM_PROG_CC_C_O +Index: libcap-ng-0.8.2/bindings/python3/Makefile.am +=================================================================== +--- libcap-ng-0.8.2.orig/bindings/python3/Makefile.am ++++ libcap-ng-0.8.2/bindings/python3/Makefile.am +@@ -41,7 +41,7 @@ nodist__capng_la_SOURCES = capng_wrap.c + capng.py capng_wrap.c: ${srcdir}/../src/capng_swig.i caps.h capng.h + swig -o capng_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/capng_swig.i + caps.h: +- cat /usr/include/linux/capability.h | grep '^#define CAP' | grep -v '[()]' > caps.h ++ cat $(CAPABILITY_HEADER) | grep '^#define CAP' | grep -v '[()]' > caps.h + capng.h: + cat ${top_srcdir}/src/cap-ng.h | grep -v '_state' > capng.h + +Index: libcap-ng-0.8.2/bindings/python/Makefile.am +=================================================================== +--- libcap-ng-0.8.2.orig/bindings/python/Makefile.am ++++ libcap-ng-0.8.2/bindings/python/Makefile.am +@@ -38,7 +38,7 @@ nodist__capng_la_SOURCES = capng_wrap.c + capng.py capng_wrap.c: ${srcdir}/../src/capng_swig.i caps.h capng.h + swig -o capng_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/capng_swig.i + caps.h: +- cat /usr/include/linux/capability.h | grep '^#define CAP' | grep -v '[()]' > caps.h ++ cat $(CAPABILITY_HEADER) | grep '^#define CAP' | grep -v '[()]' > caps.h + capng.h: + cat ${top_srcdir}/src/cap-ng.h | grep -v '_state' > capng.h + diff --git a/meta/recipes-support/libcap-ng/libcap-ng/python.patch b/meta/recipes-support/libcap-ng/libcap-ng/python.patch deleted file mode 100644 index 59591eb469..0000000000 --- a/meta/recipes-support/libcap-ng/libcap-ng/python.patch +++ /dev/null @@ -1,58 +0,0 @@ -From b01bb2694f66cd981e6d61523433dc3eb5ed32f2 Mon Sep 17 00:00:00 2001 -From: Li xin <lixin.fnst@cn.fujitsu.com> -Date: Sat, 18 Jul 2015 23:03:30 +0900 -Subject: [PATCH] configure.ac - Avoid an incorrect check for python. - Makefile.am - avoid hard coded host include paths. - -Upstream-Status: pending - -Signed-off-by: Mark Hatle <mark.hatle@windriver.com> -Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> ---- - bindings/python/Makefile.am | 3 ++- - configure.ac | 15 ++------------- - 2 files changed, 4 insertions(+), 14 deletions(-) - -diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am -index 82b9bb8..f9fe7a8 100644 ---- a/bindings/python/Makefile.am -+++ b/bindings/python/Makefile.am -@@ -23,7 +23,8 @@ SUBDIRS = test - CONFIG_CLEAN_FILES = *.loT *.rej *.orig - AM_CFLAGS = -fPIC -DPIC - PYLIBVER ?= python$(PYTHON_VERSION) --AM_CPPFLAGS = -I. -I$(top_builddir) -I@PYINCLUDEDIR@ -+PYINC ?= /usr/include/$(PYLIBVER) -+AM_CPPFLAGS = -I. -I$(top_builddir) -I$(PYINC) - LIBS = $(top_builddir)/src/libcap-ng.la - SWIG_FLAGS = -python - SWIG_INCLUDES = ${AM_CPPFLAGS} -diff --git a/configure.ac b/configure.ac -index 1d777d5..9d90f64 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -123,19 +123,8 @@ if test x$use_python = xno ; then - else - AC_MSG_RESULT(testing) - AM_PATH_PYTHON --PYINCLUDEDIR=`python${am_cv_python_version} -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"` --if test -f ${PYINCLUDEDIR}/Python.h ; then -- python_found="yes" -- AC_SUBST(PYINCLUDEDIR) -- AC_MSG_NOTICE(Python bindings will be built) --else -- python_found="no" -- if test x$use_python = xyes ; then -- AC_MSG_ERROR([Python explicitly required and python headers found]) -- else -- AC_MSG_WARN("Python headers not found - python bindings will not be made") -- fi --fi -+python_found="yes" -+AC_MSG_NOTICE(Python bindings will be built) - fi - AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes") - --- -1.8.4.2 - diff --git a/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb b/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb deleted file mode 100644 index a31d5dc437..0000000000 --- a/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb +++ /dev/null @@ -1,39 +0,0 @@ -SUMMARY = "An alternate posix capabilities library" -DESCRIPTION = "The libcap-ng library is intended to make programming \ -with POSIX capabilities much easier than the traditional libcap library." -HOMEPAGE = "http://freecode.com/projects/libcap-ng" -SECTION = "base" -LICENSE = "GPLv2+ & LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" - -SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \ - file://python.patch" - -inherit lib_package autotools pythonnative - -SRC_URI[md5sum] = "3d7d126b29e2869a0257c17c8b0d9b2e" -SRC_URI[sha256sum] = "615549ce39b333f6b78baee0c0b4ef18bc726c6bf1cca123dfd89dd963f6d06b" - -DEPENDS += "swig-native python" - -EXTRA_OECONF += "--without-python3" - -EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'" - -PACKAGES += "${PN}-python" - -FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" -FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" - -BBCLASSEXTEND = "native" - -do_install_append() { - # Moving libcap-ng to base_libdir - if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then - mkdir -p ${D}/${base_libdir}/ - mv -f ${D}${libdir}/libcap-ng.so.* ${D}${base_libdir}/ - relpath=${@os.path.relpath("${base_libdir}", "${libdir}")} - ln -sf ${relpath}/libcap-ng.so.0.0.0 ${D}${libdir}/libcap-ng.so - fi -} diff --git a/meta/recipes-support/libcap-ng/libcap-ng_0.8.2.bb b/meta/recipes-support/libcap-ng/libcap-ng_0.8.2.bb new file mode 100644 index 0000000000..6e16e886b9 --- /dev/null +++ b/meta/recipes-support/libcap-ng/libcap-ng_0.8.2.bb @@ -0,0 +1,17 @@ +require libcap-ng.inc + +inherit lib_package autotools + +EXTRA_OECONF += "--without-python --without-python3" + +BBCLASSEXTEND = "native nativesdk" + +do_install:append() { + # Moving libcap-ng to base_libdir + if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then + mkdir -p ${D}/${base_libdir}/ + mv -f ${D}${libdir}/libcap-ng.so.* ${D}${base_libdir}/ + relpath=${@os.path.relpath("${base_libdir}", "${libdir}")} + ln -sf ${relpath}/libcap-ng.so.0.0.0 ${D}${libdir}/libcap-ng.so + fi +} |