# $Id: Portfile,v 1.1 2005/05/08 15:01:02 olegb Exp $

PortSystem 1.0
name		update-fonts-utils
version		1.0
categories	sysutils x11
maintainers	digdog@opendarwin.org
description	Compiles fonts.alias, fonts.dir, fonts.scale files for X font directories
long_description \
	update-fonts-utils is a custom collection of utilities that was written \
	by Branden Robinson for the Debian Project. This package contains three \
	scripts: update-fonts-alias, update-fonts-dir and update-fonts-scale. \
	Users can use these scripts to create fonts.dir, assemble fonts.alias, \
	fonts.scale files in the X font directory. 
homepage	http://necrotic.deadbeast.net/xsf/XFree86/NEWS.xhtml
platforms	darwin freebsd
master_sites	http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/
distfiles	update-fonts-alias update-fonts-dir update-fonts-scale \
		update-fonts-alias.8 update-fonts-dir.8 update-fonts-scale.8
checksums	update-fonts-alias md5 02a37f3fcf4220bd1fa90bc9739c72d8 \
		update-fonts-dir md5 5aa2601736a6c6f9c2c1b45320b513b5 \
		update-fonts-scale md5 11e3e9e0059f9cee9f13defc72201082 \
		update-fonts-alias.8 md5 93c4f30d25c065cb3c06d5ed104f2591 \
		update-fonts-dir.8 md5 25a24d102bab59262fa8cb49dd231573 \
		update-fonts-scale.8 md5 b421a934182fd56237a4c0fb8a1a4c38
extract.only

#	Please notes that update-fonts-{alias, scale} checks the .alias and .scale files in the
#	/etc/X11/fonts to reconstruct font.{alias, scale} by default. For DarwinPorts, we moved 
#	it to ${prefix}/etc/X11/fonts to follow the DarwinPorts filesystem hierarchy guideline.	
#	Reference: http://darwinports.opendarwin.org/docs/ch05.html

#	For X11 fonts Portfile maintainers: please make sure your .alias or .scale files were 
#	installed in ${prefix}/etc/X11/fonts, and run these script in post-install to update.

configure	{}
build		{}

destroot {
	set prefixPath ${destroot}${prefix}
	set sbinPath ${prefixPath}/sbin
	set man8Path ${prefixPath}/share/man/man8

	xinstall -m 755 ${distpath}/update-fonts-alias ${sbinPath}
	xinstall -m 755 ${distpath}/update-fonts-dir ${sbinPath}
	xinstall -m 755 ${distpath}/update-fonts-scale ${sbinPath}
	xinstall -m 644 ${distpath}/update-fonts-alias.8 ${man8Path}
	xinstall -m 644 ${distpath}/update-fonts-dir.8 ${man8Path}
	xinstall -m 644 ${distpath}/update-fonts-scale.8 ${man8Path}

	reinplace "s|/etc/X11/fonts|${prefix}/etc/X11/fonts|" \
		${sbinPath}/update-fonts-alias \
		${sbinPath}/update-fonts-scale \
		${man8Path}/update-fonts-alias.8 \
		${man8Path}/update-fonts-scale.8

	reinplace "s|/usr/lib/X11/fonts/|${prefix}/lib/X11/fonts/|" \
		${sbinPath}/update-fonts-alias \
		${sbinPath}/update-fonts-dir \
		${sbinPath}/update-fonts-scale \
		${man8Path}/update-fonts-alias.8 \
		${man8Path}/update-fonts-dir.8 \
		${man8Path}/update-fonts-scale.8
}


