pkg_name=skalibs
version=2.16.0.0
revision=2
build_style=configure
short_desc="General purpose C programming library used by the s6 suite"
home_page="https://skarnet.org/software/skalibs"
license="ISC"
dist_files="https://skarnet.org/software/skalibs/skalibs-${version}.tar.gz"
checksum="dabb87fe8ce7d9cd104add90e02e0caa7f22f6658f0241bfd8e35edab212109e"

use_flags="static ipv6 -pkgconfig doc"

# skarnets configure gets sysconfdir from --prefix, so /usr would give it /usr/etc
# bpms config style always passes --prefix=/usr, everything that would go under it
# has to be spelled out here
configure_args="
    --sysconfdir=/etc
    --libdir=/usr/lib
    --dynlibdir=/usr/lib
    --includedir=/usr/include
    --sysdepdir=/usr/lib/skalibs/sysdeps
    --disable-rpath
    $(use_if ipv6 --enable-ipv6 --disable-ipv6)
    $(use_if pkgconfig --enable-pkgconfig --disable-pkgconfig)
    $(use_if static --enable-static --disable-static)
    $(use_if static --disable-shared --enable-shared)"

post_install() {
    if use doc; then
        bcopy doc/. "/usr/share/doc/$pkg_name"
    fi
    blicense COPYING
}
