# $Id: Portfile,v 1.6 2005/10/19 08:10:05 blb Exp $

PortSystem		1.0
name			cryptlib
version			3.1
revision		2
categories		devel security crypto
maintainers		blb@opendarwin.org
description		cryptlib is a powerful security toolkit (library)

long_description \
	cryptlib is a powerful security toolkit that allows even inexperienced \
	crypto programmers to easily add encryption and authentication services \
	to their software. The high-level interface provides anyone with the \
	ability to add strong security capabilities to an application in as \
	little as half an hour, without needing to know any of the low-level \
	details that make the encryption or authentication work.

platforms		darwin sunos

homepage		http://www.cs.auckland.ac.nz/~pgut001/cryptlib/
master_sites	ftp://ftp.franken.de/pub/crypt/cryptlib/
distname		cl31
use_zip			yes
checksums		md5 d732c7d527debbd01848c303e62efa13

worksrcdir		cryptlib
pre-extract {
	extract.pre_args-append		"-a"
	extract.post_args			"-d ${worksrcpath}"
}

patchfiles		patch-cert__certechk.c patch-cert__certedef.c \
                patch-device__dev_sys.c \
                patch-keyset__dbxdbms.c patch-keyset__dbxdca.c \
                patch-keyset__dbxpgp.c patch-keyset__dbxp15w.c \
                patch-cryptcfg.c patch-cryptkrn.c patch-cryptusr.c \
                patch-misc__net_http.c patch-misc__net_tcp.c \
                patch-misc__stream.c \
                patch-session__cmp_rd.c patch-session__scep.c \
                patch-session__ssh.c patch-makefile

use_configure	no

build.target	default shared
build.args		LIBDIR=${prefix}/lib

destroot {
	set drprefix	${destroot}/${prefix}
	file mkdir "${drprefix}/lib" "${drprefix}/include" \
		"${drprefix}/share/doc/${name}"
	xinstall -m 644 ${worksrcpath}/libcl.a ${worksrcpath}/${cryptlibDylib} \
		${drprefix}/lib
	system "ln -s ${cryptlibDylib} ${drprefix}/lib/${cryptlibDylibLink}"
	xinstall -m 644 ${worksrcpath}/cryptlib.h ${drprefix}/include
	xinstall -m 644 ${worksrcpath}/README ${drprefix}/share/doc/${name}/
	system "/bin/echo ${homepage} > ${drprefix}/share/doc/${name}/website"
}

platform darwin 7 {
	patchfiles-append		patch-makefile.darwin7
}

variant darwin {
	global cryptlibDylib cryptlibDylibLink
	set cryptlibDylib		libcl.3.1.dylib
	set cryptlibDylibLink	libcl.dylib
}

variant sunos {
	global cryptlibDylib cryptlibDylibLink
	patchfiles-append	patch-makefile.sunos
	set cryptlibDylib		libcl.so.3.1.0
	set cryptlibDylibLink	libcl.so
}

