From 02ba3b74b88dd3fffc1cc303cee4bae635cd4fe0 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Sun, 28 Mar 2004 14:04:12 +0000 Subject: [PATCH] Changed install directory of executable file and shared files. --- kagecgi/Makefile | 31 ++++++++++++++++++++++--------- kagecgi/README.en | 36 +++++++++++++++++++++--------------- kagecgi/kagecgi.c | 2 +- kagecgi/kagecgi.h | 4 ++-- 4 files changed, 46 insertions(+), 27 deletions(-) diff --git a/kagecgi/Makefile b/kagecgi/Makefile index df5839d..39330de 100755 --- a/kagecgi/Makefile +++ b/kagecgi/Makefile @@ -1,13 +1,12 @@ +# Makefile # -# -# CC=gcc -g -CC= gcc -Wall - -VERSION=0.0.1 -#for cygwin with glib gdk gtk -#CFLAGS= -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/include/glib-2.0/glib -I/usr/local/include/glib-2.0/gobject -I/usr/local/include/gtk-2.0 -I/usr/local/include/gtk-2.0/gtk -I/usr/local/include/gtk-2.0/gdk -I/usr/local/include/gtk-2.0/gdk-pixbuf -I/usr/local/lib/glib-2.0/include -I/usr/local/lib/gtk-2.0/include -I/usr/local/include/pango-1.0 -I/usr/local/include/atk-1.0 -#LIBS= -lpng -ldb -L/usr/local/lib -lglib-2.0 -lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -lpangowin32-1.0 -lgobject-2.0 -lgmodule-2.0 -lpangoft2-1.0 -lpango-1.0 -latk-1.0 -lgdk_pixbuf-2.0 +CC=gcc -Wall +INSTALL=install +WGET=wget +BINDIR=/usr/local/bin +SHAREDIR=/usr/local/share/kagecgi +DBURL=http://fonts.jp/kagedb/kagedb #for cygwin with glib #CFLAGS= -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/include/glib-2.0/glib -I/usr/local/lib/glib-2.0/include @@ -21,6 +20,8 @@ LIBS= -L/usr/local/lib -lpng -ldb -lglib-2.0 -L/usr/X11R6/lib -lX11 #CFLAGS= -I/sw/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include/ -I/sw/include/libpng/ -I/usr/include -I/usr/X11R6/include/ #LIBS= -L/sw/lib -lpng -lglib-2.0 -L/usr/lib -ldbm -L/usr/X11R6/lib -lX11 +all: kage.cgi + kage.cgi: kagecgi.o kagepng.o kagedf.o kagecd.o kageic.o kagepoly.o kagedb.o kageeg.o kagecomb.o kagechar.o kagetool.o $(CC) $(CFLAGS) -o kage.cgi kagecgi.o kagepng.o kagedf.o kagecd.o kageic.o kagepoly.o kagedb.o kageeg.o kagecomb.o kagechar.o kagetool.o $(LIBS) @@ -37,5 +38,17 @@ kagetool.o: kagetool.c kagepng.o: kagepng.c clean: - \rm -r -f *.o *~ *.exe *.cgi *.stackdump + \rm -r -f *.o *~ *.exe *.cgi *.stackdump kagedb + +install: kage.cgi + mkdir -p $(BINDIR) + $(INSTALL) -c -m 755 kage.cgi $(BINDIR) + mkdir -p $(SHAREDIR) + $(INSTALL) -c -m 644 error.png $(SHAREDIR) + +kagedb: + $(WGET) $(DBURL) + +database: kagedb + $(INSTALL) -c -m 644 kagedb $(SHAREDIR) diff --git a/kagecgi/README.en b/kagecgi/README.en index 92b99be..dba7588 100644 --- a/kagecgi/README.en +++ b/kagecgi/README.en @@ -1,4 +1,6 @@ -KAGE/cgi is a Kanji-glyph generating engine call from httpd server. +KAGE/cgi is a Kanji-glyph generating engine. + +It can use by command prompt and for executable cgi for httpd server. PREREQUISITES @@ -32,23 +34,33 @@ INSTALLING 1) Engine program -After running `make', `kage.cgi' will appear at current directory. - -Please copy the file to proper directory. + # make install -(Configure httpd for enable excuting .cgi files) + (by default, it will be installed as /usr/local/bin/kage.cgi) -2) Parts database + Also, if you need to use as cgi, copy/make symbolic link to proper directory. + (ex. % cp /usr/local/bin/kage.cgi /var/www/cgi-bin/) + +2) Parts database (wget is required) -Get database file. (URL `http://fonts.jp/kagedb/wiki') + # make database -Copy to proper directory describing at `kagecgi.h'(databeseFileName). + (by default, it will be installed as /usr/local/share/kagecgi/kagedb) TEST ==== -Call engine from a web browser like as `http://hoge.hoge/kage.cgi?u4e00'. +1) Run from command prompt + + - % kage.cgi u2ff0.u6c35.u6c38 > result.png + - % kage.cgi u4e08-k > result.png + - % kage.cgi 'u7389&shotai=gothic' > result.png + - % kage.cgi 'u4e5f&type=eps' > result.eps + +2) Run as cgi program + +Call engine by a web browser like as `http://hoge.hoge/cgi-bin/kage.cgi?u4e00'. Glyph will be appear (`ICHI (one)' : u4e00 in ISO/IEC 10646-1). @@ -58,12 +70,6 @@ Another examples: - kage.cgi?u7389&shotai=gothic (generate as Gothic glyph [Default: Mincho]) - kage.cgi?u4e5f&type=eps (generate as .eps file [Default: .png file]) -OR run by command prompt mode: - - % ./kage.cgi u2ff0.u6c35.u6c38 > result.png - - % ./kage.cgi u4e08-k > result.png - - % ./kage.cgi 'u7389&shotai=gothic' > result.png - - % ./kage.cgi 'u4e5f&type=eps' > result.eps - GETTING MORE INFORMATION ======================== diff --git a/kagecgi/kagecgi.c b/kagecgi/kagecgi.c index b96e2bf..d3f53d5 100755 --- a/kagecgi/kagecgi.c +++ b/kagecgi/kagecgi.c @@ -150,7 +150,7 @@ int main(int argc, char *argv[]){ closePng(pngWidth, pngHeight, kageCanvas); } else{ - err = fopen("error.png", "r"); + err = fopen(errorFileName, "r"); fread(errbuf, sizeof(char), errorFileSize, err); // printf("An error occurred.\r\n"); if(type != 1) fprintf(stdout, "Content-type: image/png\n\n"); diff --git a/kagecgi/kagecgi.h b/kagecgi/kagecgi.h index 9202cb2..b386755 100755 --- a/kagecgi/kagecgi.h +++ b/kagecgi/kagecgi.h @@ -9,9 +9,9 @@ // define for localhost environment #define errorFileSize 4009 -#define errorFileName "error.png" +#define errorFileName "/usr/local/share/kagecgi/error.png" #define pngFilePath "/var/www/fontsjp/v0.4/" -#define databaseFileName "../../kagedb/wiki" +#define databaseFileName "/usr/local/share/kagecgi/kagedb" #define kBaseline 188 #define pngWidth 200 -- 1.7.10.4