Skip to content

Commit

Permalink
libcap2: bump to 2.25, remove perl dep, fix build with gperf installed
Browse files Browse the repository at this point in the history
  • Loading branch information
rofl0r committed Feb 7, 2017
1 parent b005302 commit 1fdb07a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 10 deletions.
51 changes: 51 additions & 0 deletions KEEP/libcap2-cap_names.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* DO NOT EDIT: this file is generated automatically from
*
* <linux/capability.h>
*/
#define __CAP_BITS 38

#ifdef LIBCAP_PLEASE_INCLUDE_ARRAY
char const *_cap_names[__CAP_BITS] = {
/* 0 */ "cap_chown",
/* 1 */ "cap_dac_override",
/* 2 */ "cap_dac_read_search",
/* 3 */ "cap_fowner",
/* 4 */ "cap_fsetid",
/* 5 */ "cap_kill",
/* 6 */ "cap_setgid",
/* 7 */ "cap_setuid",
/* 8 */ "cap_setpcap",
/* 9 */ "cap_linux_immutable",
/* 10 */ "cap_net_bind_service",
/* 11 */ "cap_net_broadcast",
/* 12 */ "cap_net_admin",
/* 13 */ "cap_net_raw",
/* 14 */ "cap_ipc_lock",
/* 15 */ "cap_ipc_owner",
/* 16 */ "cap_sys_module",
/* 17 */ "cap_sys_rawio",
/* 18 */ "cap_sys_chroot",
/* 19 */ "cap_sys_ptrace",
/* 20 */ "cap_sys_pacct",
/* 21 */ "cap_sys_admin",
/* 22 */ "cap_sys_boot",
/* 23 */ "cap_sys_nice",
/* 24 */ "cap_sys_resource",
/* 25 */ "cap_sys_time",
/* 26 */ "cap_sys_tty_config",
/* 27 */ "cap_mknod",
/* 28 */ "cap_lease",
/* 29 */ "cap_audit_write",
/* 30 */ "cap_audit_control",
/* 31 */ "cap_setfcap",
/* 32 */ "cap_mac_override",
/* 33 */ "cap_mac_admin",
/* 34 */ "cap_syslog",
/* 35 */ "cap_wake_alarm",
/* 36 */ "cap_block_suspend",
/* 37 */ "cap_audit_read",
};
#endif /* LIBCAP_PLEASE_INCLUDE_ARRAY */

/* END OF FILE */
25 changes: 15 additions & 10 deletions pkg/libcap2
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
[mirrors]
http://ftp.de.debian.org/debian/pool/main/libc/libcap2/libcap2_2.22.orig.tar.gz
https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.25.tar.xz

[vars]
filesize=67432
sha512=b66cd3e233cab9c35334c3ed824f2b6207a46b7320be0a29f5290a32cbf4ea7c4fbf22125541cfa25fdd7466d9c14373ff5f68b53fe44036af6763d3ff1cb398
tardir=libcap-2.22
filesize=63672
sha512=c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9
pkgver=2

[deps]
attr

[deps.host]
perl

[build]
sed -i 's,BUILD_GPERF := ,BUILD_GPERF := no #,' Make.Rules
sed -i 's@/bin/bash@/bin/sh@g' progs/capsh.c

cp "$K"/libcap2-cap_names.h libcap/cap_names.h
touch libcap/cap_names.list.h libcap/_makenames libcap/cap_names.h

make -j$MAKE_THREADS prefix="$butch_prefix" lib=lib \
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
BUILD_CC="$HOSTCC" CC="$CC"

make RAISE_SETFCAP=no FAKEROOT="$butch_install_dir" prefix="$butch_prefix" lib=lib install
LIBDIR=$butch_install_dir$butch_prefix/lib
SBINDIR=$butch_install_dir$butch_prefix/sbin
make RAISE_SETFCAP=no FAKEROOT="$butch_install_dir" prefix="$butch_prefix" \
SBINDIR="$butch_prefix"/bin lib=lib install

dest="$butch_install_dir""$butch_prefix"
LIBDIR="$dest"/lib
SBINDIR="$dest"/bin

LD_LIBRARY_PATH=${LIBDIR} ${SBINDIR}/setcap cap_setfcap=i ${SBINDIR}/setcap || echo \
"there was an error setting caps, you may want to investigate this"

0 comments on commit 1fdb07a

Please sign in to comment.