# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# $Id: Portfile 92921 2012-05-10 21:02:01Z and.damore@macports.org $
# vim: set fileencoding=utf-8 tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab filetype=tcl :

PortSystem	    1.0
PortGroup       qt4 1.0

name		    sigil
conflicts	    tidy
version		    0.5.3
platforms	    darwin
categories	    editors
maintainers	    openmaintainer krischik
description	    Sigil, the ePub editor
long_description					\
    Sigil is a multi-platform WYSIWYG ebook editor. It	\
    is designed to edit books in ePub format

homepage	    http://code.google.com/p/sigil
master_sites	    googlecode
distfiles	    Sigil-${version}-Code.zip
worksrcdir	    build 
use_parallel_build  yes
universal_variant   no

checksums           md5     83c1a5608a2ec59a83c86ccc1429b5cc \
                    sha1    e43861b2979f11e2abefedad454623e2685c781f \
                    rmd160  cb400fec5b2453a2cd076c1821e2962df7d011c8

depends_build-append bin:cmake:cmake \
		    bin:gmake:gmake

extract.mkdir	    yes
extract.suffix      .zip
extract.cmd         unzip
extract.pre_args    -q
extract.post_args   "-d ${workpath}/Sigil-${version}-Code"

configure.cmd	    "cmake"
configure.args	    "-G \"Unix Makefiles\" ${workpath}/Sigil-${version}-Code"

build.cmd	    "gmake"
build.args	    ""
build.target	    "Sigil"

pre-configure {
	reinplace "s|ppc;i386|${configure.build_arch}|g" ${workpath}/Sigil-${version}-Code/CMakeLists.txt
	file mkdir ${worksrcpath}
}

destroot {
    xinstall -d ${destroot}${applications_dir}

    copy					\
	${worksrcpath}/bin/Sigil.app		\
	${destroot}${applications_dir}
}
