# $Id: Portfile 40634 2008-10-09 06:21:04Z jmr@macports.org $

PortSystem			1.0
name				tcp_wrappers
version				7.6
revision			1
categories			net
maintainers			nomaintainer
description			Security wrappers for TCP services
long_description \
	TCP Wrappers provides tiny daemon wrapper programs that can be installed \
	without any changes to existing software or to existing configuration \
	files.  The wrappers report the name of the client host and of the \
	requested service\; the wrappers do not exchange information with the \
	client or server applications, and impose no overhead on the actual \
	conversation between the client and server applications.

homepage			ftp://ftp.porcupine.org/pub/security/
master_sites		${homepage}

platforms			sunos
checksums			md5 e6fa25f71226d090f34de3f6b122fb5a
distname			${name}_${version}

worksrcdir			${distname}

use_configure		no

post-extract {
	system "cd ${worksrcpath} && chmod -R u+w ."
	set tcpwFiles	{ Makefile hosts_access.3 hosts_access.5 hosts_access.c \
					tcpd.8 tcpdchk.8 tcpdmatch.8 }
	foreach modThis $tcpwFiles {
		reinplace s#/etc/hosts.\[allow|deny\]#${prefix}&#g ${worksrcpath}/${modThis}
	}
}

build.args			prefix=${prefix}

destroot {
	xinstall -m 755 -W ${worksrcpath} safe_finger tcpd tcpdchk tcpdmatch \
		try-from ${destroot}${prefix}/sbin
	xinstall -m 644 -W ${worksrcpath} hosts_access.3 \
		${destroot}${prefix}/share/man/man3
	xinstall -m 644 -W ${worksrcpath} hosts_access.5 hosts_options.5 \
		${destroot}${prefix}/share/man/man5
	xinstall -m 644 -W ${worksrcpath} tcpd.8 tcpdchk.8 tcpdmatch.8 \
		${destroot}${prefix}/share/man/man8
	xinstall -m 644 -W ${worksrcpath} libwrap.a ${destroot}${prefix}/lib
	xinstall -m 644 -W ${worksrcpath} tcpd.h ${destroot}${prefix}/include
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath} BLURB DISCLAIMER README README.NIS \
		${destroot}${prefix}/share/doc/${name}
}

platform sunos {
	build.args-append		REAL_DAEMON_DIR=/usr/sbin
	if { ![variant_isset suncc] } {
		build.args-append	CC=gcc
	}
	build.target			sunos5
}

# This is basically just a marker...
variant suncc {}

