PortSystem 1.0

name			brs
version			4.03
revision		1
categories		textproc
platforms		darwin
maintainers		nomaintainer
description		An interactive King James Bible
long_description	Bible Retrieval System (BRS) consists of a textual \
			database of the Authorized ("King James") Version of the Old and \
			New Testaments, a set of libraries for finding and retrieving \
			text, and a program ("bible") which uses the libraries to retrieve \
			Bible passages given references on the command line or from \
			standard input.

homepage		http://mirrors.playboy.com/misc/
master_sites	http://mirrors.playboy.com/misc/:bib \
				http://www.unknown.nu/ports/:bib \
				ftp://mirrors.playboy.com/misc/:bib \
				freebsd:bib \
				http://www.ibiblio.org/pub/packages/irc/eggdrop/users/bass/:egg
distfiles		bible.data.tar.bz2:bib bible.tar.bz2:bib bible_brs.tcl.gz:egg
checksums		bible.data.tar.bz2 md5 03eac0c7922a8190a5077ac65746c30b \
				bible.tar.bz2 md5 09ac9fe31a9ada1bcb91a16275243761 \
				bible_brs.tcl.gz md5 1bcbd7305dd6fe872d2c2087d7bd9790
use_bzip2		yes
patchfiles		patch-Makefile patch-bible.1 patch-brl.c patch-tsl.c

extract.mkdir	yes
post-extract {
	system -W ${worksrcpath} "gzip -dc < ${distpath}/bible_brs.tcl.gz > bible_brs.tcl"
}
extract.only	bible.data.tar.bz2 bible.tar.bz2

post-patch {
	reinplace "s|__PREFIX__|${prefix}|g" \
		${worksrcpath}/brl.c ${worksrcpath}/bible.1
	reinplace "s|/usr/home/users/bass/eggdrop/bible|${prefix}/bin/bible|g" \
		${worksrcpath}/bible_brs.tcl
}

use_configure	no

build.target
build.env		PREFIX=${prefix} \
			CC=${configure.cc} \
			"CFLAGS=${configure.cflags} ${configure.cc_archflags} -std=gnu89 -Wno-error=return-type" \
			"LDFLAGS=${configure.ldflags} ${configure.ld_archflags}"

destroot.destdir	DEST=${destroot}${prefix}
post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/eggdrop/scripts
	xinstall -m 644 ${worksrcpath}/bible_brs.tcl \
		${destroot}${prefix}/share/eggdrop/scripts/
}
