# $Id: Portfile 45760 2009-01-21 14:34:28Z macsforever2000@macports.org $

PortSystem 1.0

name                        dcmtk
version                     3.5.4_p2
categories                  graphics
platforms                   darwin
maintainers                 uni-koblenz.de:guidolorenz \
                            openmaintainer
description                 The DICOM Toolkit.
long_description            DCMTK is a collection of libraries and applications implementing \
                            large parts of the DICOM standard. It includes software for examining, \
                            constructing and converting DICOM image files, handling offline \
                            media, sending and receiving images over a network connection, as \
                            well as demonstrative image storage and worklist servers.

homepage                    http://dicom.offis.de/dcmtk

master_sites                ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/dcmtk354/ \
                            http://dicom.offis.de/download/dcmtk/dcmtk354/
distname                    dcmtk-3.5.4

checksums                   md5 0afd971cdf976a5b336722ef2f68e6d7 \
                            sha1 169056874947083e68eb941fcd53faaebc862ae5 \
                            rmd160 d1558c9c68e53e0ea3b080fd2fb50b9d8e30eeba

depends_lib                 port:zlib \
                            port:tiff \
                            port:libpng \
                            port:libxml2

destroot.target-append      install-lib

# Apply changes made in ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/dcmtk354/patch/dcmtk-3.5.4_p2.tar.gz
patchfiles                  patch-dcmnet-apps-findscu.cc.diff \
                            patch-dcmnet-apps-movescu.cc.diff

platform darwin 9 {
	# See http://forum.dcmtk.org/viewtopic.php?t=1372
	
	patchfiles-append       patch-config-configure.in.diff
	
	post-patch {
		# Usually, we would system "cd ${worksrcpath}/config && ./autoall" here, but due to a
		# conflict with the MacPorts installation of autoconf, we must make sure that the
		# original autoconf distrubuted with Leopard (from /usr/bin) is used.
		system "cd ${worksrcpath}/config && /usr/bin/autoheader"
		system "cd ${worksrcpath}/config && /usr/bin/autoconf"
		system "cd ${worksrcpath}/config && /usr/bin/autoconf confmod.in > confmod"
	}
}

use_parallel_build          no
