# -*- 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: Portfile 81740 2011-08-04 17:07:11Z jmr@macports.org $

PortSystem	1.0

name		btrfs-progs
version		0.18
categories	sysutils
platforms	darwin linux
maintainers	googlemail.com:0xffea

description	Btrfs utility programs.
long_description	Btrfs is a new copy-on-write filesystem. \
			This port contains utilities to create, check and \
			debug btrfs filesystems.
homepage	http://btrfs.wiki.kernel.org/
master_sites	http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/

checksums	md5 1dfe59152a558eb2f79a4c398de6c4ef \
		sha1 a213256781d7f1a2eb6a860fcce3f6131d415a49 \
		rmd160 8e2441f9d7c452821347d0e564c2fc3c1cbd9dcc

depends_lib	port:ossp-uuid

patchfiles	patch-kerncompat.h.diff \
		patch-disk-io.c.diff \
		patch-extent-tree.c.diff \
		patch-file-item.c.diff \
		patch-ioctl.h.diff \
		patch-utils.c.diff \
		patch-list.h.diff \
		patch-volumes.c.diff \
		patch-btrfsck.c.diff \
		patch-mkfs.c.diff \
		patch-btrfs-image.c.diff

post-patch {
    reinplace "s|CC=gcc|CC=${configure.cc}|g" \
        ${worksrcpath}/Makefile
    reinplace "s|-Werror||g" \
        ${worksrcpath}/Makefile
    reinplace "s|prefix ?= /usr/local|prefix = ${prefix}|g" \
        ${worksrcpath}/Makefile
}

use_configure	no

build.post_args	LDFLAGS=-L${prefix}/lib
