* Add --notcp option, to only listen on unix domain socket, not TCP socket.

* Add rc.d startup script
 * Update pkg name to xfstt-1.1nb1

Code based on FreeBSD port,
submitted by Martti Kuparinen <martti.kuparinen@iki.fi> in PR 12201
This commit is contained in:
hubertf 2001-02-18 04:34:15 +00:00
parent 627f75a3d4
commit b5c468d2d3
5 changed files with 104 additions and 8 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.2 2001/02/17 17:07:08 wiz Exp $
# $NetBSD: Makefile,v 1.3 2001/02/18 04:34:15 hubertf Exp $
#
DISTNAME= xfstt-1.1
PKGNAME= ${DISTNAME}nb1
CATEGORIES= x11 net
MASTER_SITES= ${MASTER_SITE_SUNSITE:=X11/fonts/}
@ -28,5 +29,10 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/CHANGES ${PREFIX}/share/doc/xfstt
${INSTALL_DATA} ${WRKSRC}/INSTALL ${PREFIX}/share/doc/xfstt
${INSTALL_DATA} ${WRKSRC}/THANKS.txt ${PREFIX}/share/doc/xfstt
${SED} -e "/%%PREFIX%%/s##${PREFIX}#g" ${FILESDIR}/xfstt.sh \
> ${PREFIX}/etc/rc.d/xfstt
${CHMOD} 755 ${PREFIX}/etc/rc.d/xfstt
$(INSTALL_DATA_DIR) $(PREFIX)/lib/X11/fonts/TrueType
${ECHO} belongs to xfstt pkg >$(PREFIX)/lib/X11/fonts/TrueType/.keepme
.include "../../mk/bsd.pkg.mk"

View file

@ -1,6 +1,7 @@
$NetBSD: patch-sum,v 1.1.1.1 2000/09/04 15:49:36 kim Exp $
$NetBSD: patch-sum,v 1.2 2001/02/18 04:34:16 hubertf Exp $
MD5 (patch-aa) = e27932befb06ebac0ddcd13dae861ba4
MD5 (patch-ab) = f079ec00254b8fbbdf4d988806f8aa26
MD5 (patch-ac) = 4a59d52d4fb92793eeba8ee58565631e
MD5 (patch-ad) = d0a74f515833105a7ef80a7a88a44424
MD5 (patch-ad) = 068375cd1a98418f1abd1a1e3db2014f
MD5 (patch-ae) = e38285d8fa570a04232eee8a877d09b2

View file

@ -1,7 +1,7 @@
$NetBSD: patch-ad,v 1.1.1.1 2000/09/04 15:49:36 kim Exp $
$NetBSD: patch-ad,v 1.2 2001/02/18 04:34:17 hubertf Exp $
--- xfstt.cpp.orig Sat Dec 11 13:23:45 1999
+++ xfstt.cpp Sun Sep 3 09:32:56 2000
--- xfstt.cpp.orig Sat Dec 11 19:23:45 1999
+++ xfstt.cpp
@@ -11,8 +11,8 @@
#define UNSTRAPLIMIT 10500U
@ -13,7 +13,31 @@ $NetBSD: patch-ad,v 1.1.1.1 2000/09/04 15:49:36 kim Exp $
#define TTINFO_LEAF "ttinfo.dir"
#define TTNAME_LEAF "ttname.dir"
@@ -470,10 +470,12 @@
@@ -73,6 +73,7 @@
char* fontdir = TTFONTDIR;
char* cachedir = TTCACHEDIR;
int defaultres = 0;
+int NoTCP = 0;
uid_t newuid = (uid_t)(-2);
gid_t newgid = (uid_t)(-2);
@@ -89,12 +90,14 @@
printf( "Usage: xfstt [[--gslist]--sync][--port portno][--unstrap]"
"[--user username]\n"
"\t\t[--dir ttfdir][--encoding list_of_encodings]"
- "[--daemon][--inetd]\n\n");
+ "[--daemon][--inetd]\n"
+ "\t\t[--notcp]\n\n");
if( !verbose)
return;
printf( "\t--sync put ttf-fonts in \"%s\" in database\n", fontdir);
printf( "\t--gslist print ghostscript style ttf fontlist\n ");
printf( "\t--port change port number from default 7101\n");
+ printf( "\t--notcp don't open TCP socket, use unix domain only\n");
printf( "\t--dir use other font directory than "TTFONTDIR"\n");
printf( "\t--cache use other font cache directory than "TTCACHEDIR"\n");
printf( "\t--res force default resolution to this value\n");
@@ -470,10 +473,12 @@
raster->getFontExtent( &xfs->fe);
int used = (xfs->fe.bitmaps + xfs->fe.bmplen) - xfs->fe.buffer;
@ -28,3 +52,40 @@ $NetBSD: patch-ad,v 1.1.1.1 2000/09/04 15:49:36 kim Exp $
xfs->fid = 0; //###
xfs = 0;
}
@@ -652,7 +657,7 @@
listen( sd_unix, 1); // only one connection
}
- if( !sd_inet) {
+ if( !NoTCP && !sd_inet) {
// prepare inet connection
sd_inet = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -668,7 +673,8 @@
fd_set sdlist;
FD_ZERO( &sdlist);
FD_SET( sd_unix, &sdlist);
- FD_SET( sd_inet, &sdlist);
+ if( !NoTCP )
+ FD_SET( sd_inet, &sdlist);
int maxsd = (sd_inet > sd_unix) ? sd_inet : sd_unix;
select( maxsd+1, &sdlist, 0L, 0L, 0L);
@@ -676,7 +682,7 @@
unsigned int saLength = sizeof(struct sockaddr);
if( FD_ISSET( sd_unix, &sdlist))
sd = accept( sd_unix, (struct sockaddr*)&s_unix, &saLength);
- else if( FD_ISSET( sd_inet, &sdlist))
+ else if( !NoTCP && FD_ISSET( sd_inet, &sdlist))
sd = accept( sd_inet, (struct sockaddr*)&s_inet, &saLength);
dprintf2( "accept( saLength = %d) = %d\n", saLength, sd);
@@ -1604,6 +1610,8 @@
inetdConnection = 1;
} else if( !strcmp( argv[i], "--multi")) {
multiConnection = 1;
+ } else if( !strcmp( argv[i], "--notcp")) {
+ NoTCP = 1;
} else if( !strcmp( argv[i], "--once")) {
multiConnection = 0;
} else if( !strcmp( argv[i], "--unstrap")) {

View file

@ -0,0 +1,25 @@
--- xfstt.1x.orig Tue Jul 13 05:07:15 1999
+++ xfstt.1x Sat Nov 18 16:08:20 2000
@@ -3,7 +3,7 @@
xfstt \- X11 font server for *ttf fonts
.SH SYNOPSIS
.B xfstt
-[--port n] [--dir dirname] [--unstrap]
+[--port n] [--notcp] [--dir dirname] [--unstrap]
[--multi] [--once] [--user username]
[[--gslist] --sync]
[--res resolution] [--encoding list]
@@ -43,9 +43,12 @@
Change the port number for xfstt's font services.
This version of Xfstt defaults to --port 7101.
.TP
+.I "\-\-notcp"
+Don't open TCP socket, use unix domain only.
+.TP
.I "\-\-dir name"
Change xfstt's font directory.
-The default is --dir /usr/share/fonts/truetype.
+The default is --dir /usr/X11R6/lib/X11/fonts/TrueType.
.TP
.I "\-\-res value"
Force the resolution for underspecified fonts to value (typically 96 or 120).

View file

@ -1,8 +1,11 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2000/09/04 15:49:36 kim Exp $
@comment $NetBSD: PLIST,v 1.2 2001/02/18 04:34:17 hubertf Exp $
bin/xfstt
etc/rc.d/xfstt
man/man1/xfstt.1
share/doc/xfstt/FAQ
share/doc/xfstt/CHANGES
share/doc/xfstt/INSTALL
share/doc/xfstt/THANKS.txt
lib/X11/fonts/TrueType/.keepme
@dirrm lib/X11/fonts/TrueType
@dirrm share/doc/xfstt