# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                util-linux
version             2.22.2
revision            1
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          devel
platforms           darwin
maintainers         nomaintainer
license             GPL-2+

description         Linux utility programs

long_description    ${name} contains miscellaneous utility programs \
                    to handle file systems, consoles, partitions, \
                    and messages. This port contains ONLY those parts \
                    of ${name} that run on Darwin.

homepage            http://freecode.com/projects/util-linux
master_sites        http://www.kernel.org/pub/linux/utils/util-linux/v${branch}/ \
                    ftp://ftp.kernel.org/pub/linux/utils/util-linux/v${branch}/
use_xz              yes

checksums           rmd160  df47075e8e71b7c0816445f0a65bdd3e1c9da059 \
                    sha256  929b517fa39b16a61ec536514e08940a381b92befc629d0348e3097920dd2f12

depends_lib         port:gettext \
                    port:ncurses \

configure.args      --disable-agetty \
                    --disable-cramfs \
                    --disable-eject \
                    --disable-fallocate \
                    --disable-fsck \
                    --disable-kill \
                    --disable-libblkid \
                    --disable-libmount \
                    --disable-libuuid \
                    --disable-login \
                    --disable-losetup \
                    --disable-mount \
                    --disable-mountpoint \
                    --disable-partx \
                    --disable-pg-bell \
                    --disable-pivot_root \
                    --disable-schedutils \
                    --disable-silent-rules \
                    --disable-su \
                    --disable-sulogin \
                    --disable-switch_root \
                    --disable-unshare \
                    --disable-uuidd \
                    --disable-wall \
                    --without-audit

build.target        script scriptreplay setsid look rename colcrt pg rev

destroot {
    foreach path {term-utils/script term-utils/scriptreplay sys-utils/setsid
                  misc-utils/look misc-utils/rename
                  text-utils/colcrt text-utils/pg text-utils/rev} {
        set file [lindex [split ${path} /] 1]
        xinstall -m 755 ${worksrcpath}/${file} ${destroot}${prefix}/bin
        xinstall -m 644 ${worksrcpath}/${path}.1 ${destroot}${prefix}/share/man/man1
    }

    set docdir ${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} README NEWS ChangeLog COPYING AUTHORS ABOUT-NLS \
                       ${destroot}${docdir}
}