summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-03-24 16:02:01 -0500
committerGitHub <noreply@github.com>2017-03-24 16:02:01 -0500
commit50f4f0827daaa3e042a3fb2690677331104f5b80 (patch)
tree646e96daab723ad51cdba2af22e16df3ae3dc113 /var
parent0b4c39a9e0a828d46cb2d16b9b82c2e3d80e7d2a (diff)
downloadspack-50f4f0827daaa3e042a3fb2690677331104f5b80.tar.gz
spack-50f4f0827daaa3e042a3fb2690677331104f5b80.tar.bz2
spack-50f4f0827daaa3e042a3fb2690677331104f5b80.tar.xz
spack-50f4f0827daaa3e042a3fb2690677331104f5b80.zip
Add libcap package (#3546)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/libcap/libcap-fix-the-libcap-native-building-failure-on-CentOS-6.7.patch31
-rw-r--r--var/spack/repos/builtin/packages/libcap/package.py51
2 files changed, 82 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/libcap/libcap-fix-the-libcap-native-building-failure-on-CentOS-6.7.patch b/var/spack/repos/builtin/packages/libcap/libcap-fix-the-libcap-native-building-failure-on-CentOS-6.7.patch
new file mode 100644
index 0000000000..762c69299e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/libcap/libcap-fix-the-libcap-native-building-failure-on-CentOS-6.7.patch
@@ -0,0 +1,31 @@
+Ensure the XATTR_NAME_CAPS is defined when it is used
+
+Upstream-Status: Pending
+
+VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build
+libcap-native in old release, like CentOS release 6.7 (Final), with the blow
+error:
+ cap_file.c: In function ‘cap_get_fd’:
+ cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function)
+ cap_file.c:199: error: (Each undeclared identifier is reported only once
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ libcap/cap_file.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/cap_file.c b/libcap/cap_file.c
+index 40756ea..e27ca80 100644
+--- a/libcap/cap_file.c
++++ b/libcap/cap_file.c
+@@ -25,7 +25,7 @@ extern int fremovexattr(int, const char *);
+
+ #include "libcap.h"
+
+-#ifdef VFS_CAP_U32
++#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS)
+
+ #if VFS_CAP_U32 != __CAP_BLKS
+ # error VFS representation of capabilities is not the same size as kernel
+--
+2.8.1
diff --git a/var/spack/repos/builtin/packages/libcap/package.py b/var/spack/repos/builtin/packages/libcap/package.py
new file mode 100644
index 0000000000..a0e3065c88
--- /dev/null
+++ b/var/spack/repos/builtin/packages/libcap/package.py
@@ -0,0 +1,51 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Libcap(MakefilePackage):
+ """Libcap implements the user-space interfaces to the POSIX 1003.1e
+ capabilities available in Linux kernels. These capabilities are a
+ partitioning of the all powerful root privilege into a set of
+ distinct privileges."""
+
+ homepage = "https://sites.google.com/site/fullycapable/"
+ url = "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.25.tar.gz"
+
+ version('2.25', '4b18f7166a121138cca0cdd8ab64df4c')
+
+ patch('libcap-fix-the-libcap-native-building-failure-on-CentOS-6.7.patch')
+
+ def install(self, spec, prefix):
+ make_args = [
+ 'RAISE_SETFCAP=no',
+ 'lib=lib',
+ 'prefix={0}'.format(prefix),
+ 'install'
+ ]
+ make(*make_args)
+
+ chmod = which('chmod')
+ chmod('+x', join_path(prefix.lib, 'libcap.so'))