unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

template (2135B)


      1 # Template file for 'libcap'
      2 pkgname=libcap
      3 version=2.78
      4 revision=4
      5 short_desc="POSIX capability library and utilities"
      6 maintainer="finwo <finwo@pm.me>"
      7 license="BSD-3-Clause OR GPL-2.0-only"
      8 homepage="https://sites.google.com/site/fullycapable/"
      9 distfiles="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.78.tar.xz"
     10 checksum=0d621e562fd932ccf67b9660fb018e468a683d7b827541df27813228c996bb11
     11 # glibc first: the post-install runs /sbin/ldconfig, which needs libc
     12 # present. busybox first: control scripts run under /bin/sh, which must
     13 # exist before the script executes (ordering, not just runtime truth -
     14 # apk runs each package's scripts right after unpacking it).
     15 depends="glibc busybox"
     16 
     17 # Notes:
     18 # - Pin cross-checked against kernel.org sha256sums.asc.
     19 # - No configure step upstream; plain make with prefix/lib vars. Install
     20 #   honors FAKEROOT (not DESTDIR).
     21 # - iproute2's `ip` uses libcap for drop_cap() (ambient-capability hygiene),
     22 #   and `ip vrf/netns exec` keeps working with it; FRR will want it later
     23 #   for daemon privilege drops. Only libcap + progs are built: no pam_cap
     24 #   (no PAM in UNOS), no go bindings, no C++ wrapper, no tests.
     25 # - setcap/getcap/capsh ship as admin tools for the file-caps story.
     26 # - Shared-only per packages/README.md: the .a files are removed.
     27 # - Sysroot seed (second lib install + .pc prefix rewrite) so iproute2's
     28 #   configure finds it via PKG_CONFIG_PATH.
     29 
     30 do_build() {
     31   cd "${WRKSRC}"
     32   make -j"$(nproc)" -C libcap prefix=/usr lib=lib
     33   make -j"$(nproc)" -C progs prefix=/usr lib=lib
     34   [ -x libcap/libcap.so ] || die "libcap: shared lib missing after build"
     35 }
     36 
     37 do_install() {
     38   cd "${WRKSRC}"
     39   make -C libcap install prefix=/usr lib=lib FAKEROOT="${DESTDIR}"
     40   make -C libcap install prefix=/usr lib=lib FAKEROOT="${SYSROOT}"
     41   make -C progs install prefix=/usr lib=lib FAKEROOT="${DESTDIR}"
     42   rm -f "${DESTDIR}"/usr/lib/libcap.a "${DESTDIR}"/usr/lib/libpsx.a
     43   rm -f "${SYSROOT}"/usr/lib/libcap.a "${SYSROOT}"/usr/lib/libpsx.a
     44   for pc in libcap.pc libpsx.pc; do
     45     [ -f "${SYSROOT}/usr/lib/pkgconfig/${pc}" ] || die "libcap: no sysroot ${pc}"
     46   done
     47 }