libcap: added package.

This commit is contained in:
Ricardo Martins 2015-09-28 16:11:03 +01:00
parent 26644c1ced
commit e31403f964
2 changed files with 80 additions and 0 deletions

68
rules/libcap/default.bash Normal file
View File

@ -0,0 +1,68 @@
version=\
(
'2.24'
)
url=\
(
"https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-$version.tar.xz"
)
md5=\
(
'd43ab9f680435a7fff35b4ace8d45b80'
)
maintainer=\
(
'Ricardo Martins <rasm@oceanscan-mst.com>'
)
post_unpack()
{
patches=$(ls "$pkg_dir"/patches/*.patch)
cd ../libcap-$version
if [ -n "$patches" ]; then
cat $patches | patch -p1
fi
}
build()
{
$cmd_make \
-C "../libcap-$version/libcap" \
CC="$cmd_target_cc" \
LIBATTR=no
}
host_install()
{
$cmd_make \
-C "../libcap-$version/libcap" \
LIBATTR=no \
prefix="$cfg_dir_toolchain_sysroot/usr" \
DESTDIR="$cfg_dir_toolchain_sysroot/usr" \
inc_prefix="$cfg_dir_toolchain_sysroot/usr" \
INCDIR="$cfg_dir_toolchain_sysroot/usr/include" \
lib_prefix="$cfg_dir_toolchain_sysroot/usr" \
LIBDIR="$cfg_dir_toolchain_sysroot/usr/lib" \
PKGCONFIGDIR="$cfg_dir_toolchain_sysroot/usr/lib/pkgconfig" \
install &&
deps="$(grep Libs.private "$cfg_dir_toolchain_sysroot/usr/lib/pkgconfig/libcap.pc" | cut -f2- -d:)"
sed -e "s,@prefix@,$cfg_dir_toolchain_sysroot/usr," \
-e 's,@exec_prefix@,${prefix}/bin,' \
-e 's,@libdir@,${prefix}/lib,' \
-e 's,@includedir@,${prefix}/include,' \
-e "s,@VERSION@,$version," \
-e "s,@deps@,$deps," \
"../libcap-$version/libcap/libcap.pc.in" > "$cfg_dir_toolchain_sysroot/usr/lib/pkgconfig/libcap.pc"
}
target_install()
{
cp -a "$cfg_dir_toolchain_sysroot/usr/lib/libcap"*.so* "$cfg_dir_rootfs/lib" &&
$cmd_target_strip "$cfg_dir_rootfs/lib/libcap"*.so*
}

View File

@ -0,0 +1,12 @@
diff -Nru libcap-2.24.rasm/libcap/Makefile libcap-2.24/libcap/Makefile
--- libcap-2.24.rasm/libcap/Makefile 2014-01-06 00:55:03.000000000 +0000
+++ libcap-2.24/libcap/Makefile 2015-09-28 15:42:42.298857032 +0100
@@ -43,7 +43,7 @@
$< >$@
_makenames: _makenames.c cap_names.list.h
- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
+ gcc $< -o $@
cap_names.h: _makenames
./_makenames > cap_names.h