# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem        1.0

name              gnucash-docs
version           2.2.0
revision	  0
categories        gnome x11
maintainers       nomaintainer
description       docs for gnucash
platforms	macosx
long_description  GnuCash is a personal and small-business \
		  financial-accounting software, freely licensed under the \
		  GNU GPL.  Designed to be easy to use, yet powerful and \
		  flexible, GnuCash allows you to track bank accounts, \
		  stocks, income and expenses. As quick and intuitive to \
		  use as a checkbook register, it is based on professional \
		  accounting principles to ensure balanced books and \
		  accurate reports. \
		  This package contains (1) the user manual and (2) the \
		  Tutorial And Concepts Guide.  Both are available through \
		  yelp, the gnome help browser, and an HTML copy is \
		  installed in ${prefix}/share/doc/gnucash.
homepage          http://www.gnucash.org/
master_sites      http://www.gnucash.org/pub/gnucash/sources/stable/
checksums	  md5 97a29e499baca1807a3944ae3c0ad61e
		  # gpg signature verified
depends_lib	  bin:scrollkeeper-config:rarian \
		  port:libxml2 \
		  bin:xsltproc:libxslt
depends_run	  bin:yelp:yelp

build.target	  all html

destroot {
	system "cd ${worksrcpath}; ${build.cmd} install prefix=${destroot}${prefix}"

	# Install HTML copies
	# Duplicate figures are removed, using symlinks instead.
	# If you update this, please check for additional localizations!

	file mkdir ${destpath}${prefix}/share/doc/gnucash/C
	file mkdir ${destpath}${prefix}/share/doc/gnucash/de_DE

	file copy ${portpath}/${filesdir}/index.html ${destpath}${prefix}/share/doc/gnucash

	file copy ${worksrcpath}/guide/C/gnucash-guide ${destpath}${prefix}/share/doc/gnucash/C
	system "rm -rf ${destpath}${prefix}/share/doc/gnucash/C/gnucash-guide/figures"
	system "ln -sf ${prefix}/share/gnome/help/gnucash/C/figures ${destpath}${prefix}/share/doc/gnucash/C/gnucash-guide/figures"

	file copy ${worksrcpath}/help/C/gnucash-help ${destpath}${prefix}/share/doc/gnucash/C
	system "rm -rf ${destpath}${prefix}/share/doc/gnucash/C/gnucash-help/figures"
	system "ln -sf ${prefix}/share/gnome/help/gnucash/C/figures ${destpath}${prefix}/share/doc/gnucash/C/gnucash-help/figures"

	file copy ${worksrcpath}/help/de_DE/gnucash-help ${destpath}${prefix}/share/doc/gnucash/de_DE
	file delete -force ${destpath}${prefix}/share/doc/gnucash/de_DE/gnucash-help/figures
	system "ln -sf ${prefix}/share/gnome/help/gnucash/de_DE/figures ${destpath}${prefix}/share/doc/gnucash/de_DE/gnucash-help/figures"
}

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
