distributable:
  url: https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-{{ version.raw }}.tar.xz
  strip-components: 1

versions:
  url: https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2
  match: /libcap-\d+\.\d+\.tar\.xz/
  strip:
    - /libcap-/
    - /\.tar\.xz/

platforms: linux

build:
  script: make $ARGS --jobs {{ hw.concurrency }} install
  env:
    ARGS:
      - prefix="{{prefix}}"
      - lib=lib
      - RAISE_SETFCAP=no

provides:
  - sbin/capsh
  - sbin/getcap
  - sbin/getpcaps
  - sbin/setcap

test: getcap "{{ prefix }}/sbin/capsh"
