# -*- 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 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem 1.0

name		eggdrop
version		1.6.20
revision        1
set branch	[join [lrange [split ${version} .] 0 1] .]
categories	irc
maintainers	mac.com:dre
description	Eggdrop is the world's most popular Internet Relay Chat (IRC) bot.
long_description	${description}
homepage	http://www.eggheads.org
platforms	darwin
master_sites	ftp://ftp.eggheads.org/pub/eggdrop/source/${branch}/ freebsd
distname        ${name}${version}

checksums       sha1    7ebecd0955af36caa1846d0e7cd1f959f819f6b5 \
                rmd160  567668974e971a0c8ad6674a0500b32991a95f3d

use_bzip2	yes

patchfiles      patch-Makefile.in-LDFLAGS.diff

post-configure	{ system "cd ${worksrcpath} && make config" }
destroot.destdir DEST=${destroot}${prefix}/share/eggdrop

post-destroot	{
    delete ${destroot}${prefix}/share/eggdrop/eggdrop
    ln -s ../share/eggdrop/eggdrop-${version} ${destroot}${prefix}/bin/eggdrop
    move ${destroot}${prefix}/share/eggdrop/eggdrop.conf ${destroot}${prefix}/share/eggdrop/eggdrop.conf.sample
    move ${destroot}${prefix}/share/eggdrop/doc/man1/eggdrop.1 ${destroot}${prefix}/share/man/man1
}

platform darwin 8 {
        configure.cflags-append "-DBIND_8_COMPAT"
}

if {${os.platform} == "darwin" && ${os.major} >= 10} {
    patchfiles-append patch-Makefile.in.diff
}
