Package: xfstt
Version: 1.2.1
Author: Guillem Jover <guillem@hadrons.org>
Status: applied
Description:
 General package cleanup.

diff -Naurd xfstt-1.2.1/Makefile xfstt-1.2.1-patched/Makefile
--- xfstt-1.2.1/Makefile	Fri Mar 22 20:50:25 2002
+++ xfstt-1.2.1-patched/Makefile	Fri Jun  7 05:27:06 2002
@@ -1,18 +1,20 @@
-#MAXOPT = -O6 -fomit-frame-pointer -ffast-math
-MISCOPT =
-OPT = $(MISCOPT) $(MAXOPT)
+#
+# xfstt Makefile
+#
 
-CFLAGS = $(OPT) -DMAGNIFY=0 -DNDEBUG
-#CFLAGS = -fprofile-arcs -ftest-coverage -DMAGNIFY=0
-CFLAGS = -g -Wall -pedantic $(MISCOPT) -DMAGNIFY=0
-#CFLAGS = -O -Wall -pedantic -DDEBUG $(MISCOPT)
+OPTIMIZE_FLAGS = -O3 -fomit-frame-pointer -ffast-math
+PROFILE_FLAGS = -fprofile-arcs -ftest-coverage
+DEBUG_FLAGS = -g -DDEBUG
 
-LFLAGS = -L/usr/X11R6/lib -L/usr/openwin/lib/X11
-LFLAGS = -g -L/usr/X11R6/lib
+CFLAGS = -Wall -pedantic -DMAGNIFY=0 $(OPTIMIZE_FLAGS)
+LDFLAGS = -L/usr/X11R6/lib
 
 CC = c++
 LD = c++
 
+DIST_FILES = Makefile *.h *cpp *.txt *.sh *lsm *1x \
+ font.properties FAQ INSTALL CHANGES COPYING
+
 OBJS =	RAFile.o	\
 	TTFont.o	\
 	NameTable.o	\
@@ -38,22 +40,24 @@
 	RasterScale.o	\
 	RasterDraw.o
 
+.PHONY: all install clean dist
+
 all : xfstt
 
-install :
-	mkdir -p /usr/share/fonts/truetype ;	\
-	mkdir -p /var/cache/xfstt;			\
-	ln -s /DOS/windows/fonts /usr/share/fonts/truetype/winfonts ;	\
-	cp xfstt /usr/X11R6/bin/ ;	\
-	cp xfstt.1x /usr/X11R6/man/man1 ;\
-	xfstt --sync
+install : xfstt
+	install -d $(DESTDIR)/usr/X11R6/bin
+	install xfstt $(DESTDIR)/usr/X11R6/bin
+	install -d $(DESTDIR)/usr/X11R6/man/man1
+	install xfstt.1x $(DESTDIR)/usr/X11R6/man/man1
+	install -d $(DESTDIR)/usr/share/fonts/truetype
+	install -d $(DESTDIR)/var/cache/xfstt
 
 clean :
-	rm *.o;							\
-	rm xfstt showttf perftest patchttf
+	rm -f *.o
+	rm -f xfstt showttf perftest patchttf
 
 xfstt : $(OBJS) xfstt.o encoding.o
-	$(LD) -o $@ $(OBJS) xfstt.o encoding.o $(LFLAGS) -lm
+	$(LD) -o $@ $(OBJS) xfstt.o encoding.o $(LDFLAGS) -lm
 
 xfstt.o : xfstt.cpp xfstt.h ttf.h arch.h Makefile
 	$(CC) $(CFLAGS) -c $< -I/usr/X11R6/include/X11/fonts	\
@@ -63,23 +67,16 @@
 	$(CC) $(CFLAGS) -c $<
 
 showttf : $(OBJS) showttf.o ttf.h arch.h Makefile
-	$(LD) -o $@ $(OBJS) showttf.o $(LFLAGS) -lX11 -lm
+	$(LD) -o $@ $(OBJS) showttf.o $(LDFLAGS) -lX11 -lm
 
 perftest : $(OBJS) perftest.o ttf.h arch.h Makefile
-	$(LD) -o $@ $(OBJS) perftest.o $(LFLAGS) -lm
+	$(LD) -o $@ $(OBJS) perftest.o $(LDFLAGS) -lm
 
 patchttf : patchttf.cpp
 	$(CC) $(CFLAGS) -o $@ $<
 
-tgz:
-	cp xfstt.tgz xfstt.tgz.bak	;			\
-	tar cvf xfstt.tar Makefile *.h *cpp *.txt *.sh *lsm *1x &&\
-	tar rvf xfstt.tar font.properties FAQ INSTALL CHANGES COPYING &&\
-	gzip -9 xfstt.tar		&&			\
-	cp xfstt.tar.gz /dosd/source/xfstt.tgz &&		\
-	mv xfstt.tar.gz xfstt.tgz	;			\
-	sync;							\
-	ls -l /dosd/source/xfstt.tgz xfstt.tgz
+dist :
+	GZIP="-9" tar cvzf xfstt.tgz $(DIST_FILES)
 
 %.o : %.cpp ttf.h arch.h Makefile
 	$(CC) $(CFLAGS) -c $<
@@ -90,4 +87,3 @@
 .SUFFIXES: .cpp
 .cpp.o : ttf.h arch.h Makefile
 	$(CC) $(CFLAGS) -c $<
-
diff -Naurd xfstt-1.2.1/debian/conffiles xfstt-1.2.1-patched/debian/conffiles
--- xfstt-1.2.1/debian/conffiles	Mon Jan 18 01:03:52 1999
+++ xfstt-1.2.1-patched/debian/conffiles	Thu Jan  1 01:00:00 1970
@@ -1 +0,0 @@
-/etc/init.d/xfstt
diff -Naurd xfstt-1.2.1/debian/postrm xfstt-1.2.1-patched/debian/postrm
--- xfstt-1.2.1/debian/postrm	Mon Apr  8 13:41:37 2002
+++ xfstt-1.2.1-patched/debian/postrm	Thu Jan  1 01:00:00 1970
@@ -1,13 +0,0 @@
-#!/bin/sh
-# Automatically added by dh_installinit
-if [ "$1" = "purge" ] ; then
-	update-rc.d xfstt remove >/dev/null
-	rm -rf /var/cache/xfstt/
-fi
-
-if [ "$1" = "remove" ] ; then
-        rm -rf /var/cache/xfstt/
-fi
-
-# End automatically added section
-#DEBHELPER#
diff -Naurd xfstt-1.2.1/debian/rules xfstt-1.2.1-patched/debian/rules
--- xfstt-1.2.1/debian/rules	Sun Mar  3 18:57:50 2002
+++ xfstt-1.2.1-patched/debian/rules	Fri Jun  7 05:25:44 2002
@@ -6,6 +6,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+export DH_COMPAT=3
+
 build: build-stamp
 build-stamp:
 	dh_testdir
@@ -25,7 +27,7 @@
 	dh_testroot
 	dh_clean -k
 	dh_installdirs
-	install xfstt debian/tmp/usr/X11R6/bin
+	-$(MAKE) install DESTDIR=debian/xfstt
 	touch install-stamp
 
 # Build architecture-independent files here.
@@ -38,10 +40,10 @@
 	dh_testroot
 	dh_installdocs
 	dh_installexamples
-	dh_installmenu
+#	dh_installmenu
 	dh_installinit
-	dh_installcron
-	dh_installmanpages
+#	dh_installcron
+	dh_installman
 	dh_installchangelogs 
 	dh_strip
 	dh_compress
diff -Naurd xfstt-1.2.1/xfstt.cpp xfstt-1.2.1-patched/xfstt.cpp
--- xfstt-1.2.1/xfstt.cpp	Fri Mar 23 03:35:27 2001
+++ xfstt-1.2.1-patched/xfstt.cpp	Fri Jun  7 05:07:31 2002
@@ -4,6 +4,8 @@
 
 //#define DEBUG 1
 
+const char version[] = "1.2.1";
+
 // the unstrap limit is set to 10500 characters in order to limit
 // getextent replies to (10500|255)*24Bytes < 256kBytes;
 // if you are sure your X11 server doesn't request more
@@ -73,6 +75,7 @@
 char* fontdir = TTFONTDIR;
 char* cachedir = TTCACHEDIR;
 int defaultres = 0;
+const int default_port = 7101;
 
 uid_t newuid = (uid_t)(-2);
 gid_t newgid = (uid_t)(-2);
@@ -85,7 +88,7 @@
 
 static void usage( int verbose)
 {
-	printf( "Xfstt 1.1, X font server for TT fonts\n");
+	printf( "Xfstt %s, X font server for TT fonts\n", version);
 	printf( "Usage: xfstt [[--gslist]--sync][--port portno][--unstrap]"
 		"[--user username]\n"
 		"\t\t[--dir ttfdir][--encoding list_of_encodings]"
@@ -94,7 +97,7 @@
 		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--port     change port number from default %i\n", default_port);
 	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");
@@ -103,10 +106,10 @@
 	printf( "\t--user     Username that children should run as\n");
 	printf( "\t--daemon   run in the background\n");
 	printf( "\t--inetd    run as inetd service\n");
-	printf( "\n\tattach to X Server by \"xset fp+ unix/:7101\"\n");
-	printf( "\t\tor \"xset fp+ inet/127.0.0.1:7101\"\n");
-	printf( "\tdetach from X Server by \"xset -fp unix/:7101\"\n");
-	printf( "\t\tor \"xset -fp inet/127.0.0.1:7101\"\n");
+	printf( "\n\tattach to X Server by \"xset fp+ unix/:%i\"\n", default_port);
+	printf( "\t\tor \"xset fp+ inet/127.0.0.1:%i\"\n", default_port);
+	printf( "\tdetach from X Server by \"xset -fp unix/:%u\"\n", default_port);
+	printf( "\t\tor \"xset -fp inet/127.0.0.1:%i\"\n", default_port);
 } 
 
 static int ttSyncDir( FILE* infoFile, FILE* nameFile, char* ttdir, int gslist)
@@ -1557,7 +1560,7 @@
 {
 	int multiConnection = 1;
 	int inetdConnection = 0;
-	int portno = 7101;          // this is the default port
+	int portno = default_port;
 	int gslist = 0;
 
 	Encoding::getDefault( encodings, MAXENC);
@@ -1575,7 +1578,7 @@
 				portno = xatoi( argv[++i]);
 			if( !portno) {
 				fputs( "Illegal port number!\n", stderr);
-				portno = 7101;
+				portno = default_port;
 			}
 		} else if( !strcmp( argv[i], "--res")) {
 			if( i <= argc)
