# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 45065 2009-01-08 00:00:15Z macsforever2000@macports.org $

PortSystem          1.0

categories          cross

name                wolferl-ng
version             0.53
revision            8

maintainers         lilalinux.net:macports
description         Flashing tools and flashes for the UAVP-NG Project
long_description    Flashing tools and flashes for the UAVP-NG Project.
homepage            http://ng.uavp.ch/

depends_lib         port:arm-elf-gcc41

master_sites        file:///Users/nas/Desktop/Mikrokopter/ng/nabil/trunk/sources/

#distfiles           wolferl-ng
#
#checksums           md5 8e79832086ed5f23a943e524969c628f \
#                    sha1 54382570d4e9ad28373d5e301055862f78c50cbc \
#                    rmd160 969897ab46b2682590c601f4e69ed84509ac90b9
#
#use_bzip2           yes

#patchfiles          patch-configure.ac.diff

variant bl {
configure.args-append --enable-usb-bootloader \
                      --enable-usb-bootloader-switch
        post-destroot {
       	  xinstall -d -m 755 ${destroot}${prefix}/share/${name}/bl
       	  file copy ${worksrcpath}/src/bl/bl.bin ${destroot}${prefix}/share/${name}/bl/bl.bin
       	  file copy ${worksrcpath}/src/bl/bl.dmp ${destroot}${prefix}/share/${name}/bl/bl.dmp
       	  file copy ${worksrcpath}/src/bl/bl.elf ${destroot}${prefix}/share/${name}/bl/bl.elf
       	  file copy ${worksrcpath}/src/bl/bl.hex ${destroot}${prefix}/share/${name}/bl/bl.hex
       	  file copy ${worksrcpath}/src/bl/bl.map ${destroot}${prefix}/share/${name}/bl/bl.map
        }

}

use_autoreconf      yes

worksrcdir          ${name}

fetch {
        system "cp -r  /Users/nas/Desktop/Mikrokopter/ng/nabil/trunk/sources/${name} ${worksrcpath}"
}

checksum {}

extract {}

pre-build {
        system "make -C ${worksrcpath} clean"
}

destroot {
       	file copy ${worksrcpath}/tools/lpc21isp/lpc21isp ${destroot}${prefix}/bin
       	file copy ${worksrcpath}/tools/lpc21iap/lpc21iap ${destroot}${prefix}/bin

       	xinstall -d -m 755 ${destroot}${prefix}/share/${name}/fc
       	file copy ${worksrcpath}/src/fc/wolferl-ng.bin ${destroot}${prefix}/share/${name}/fc/wolferl-ng.bin
       	file copy ${worksrcpath}/src/fc/wolferl-ng.dmp ${destroot}${prefix}/share/${name}/fc/wolferl-ng.dmp
       	file copy ${worksrcpath}/src/fc/wolferl-ng.elf ${destroot}${prefix}/share/${name}/fc/wolferl-ng.elf
       	file copy ${worksrcpath}/src/fc/wolferl-ng.hex ${destroot}${prefix}/share/${name}/fc/wolferl-ng.hex
       	file copy ${worksrcpath}/src/fc/wolferl-ng.map ${destroot}${prefix}/share/${name}/fc/wolferl-ng.map

       	xinstall -d -m 755 ${destroot}${prefix}/include/${name}/fc/ctrl
       	file copy ${worksrcpath}/src/fc/ctrl/dump.h ${destroot}${prefix}/include/${name}/fc/ctrl
}
