Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 2003 06:35:04 +0100 (CET)
From:      "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/48292: new port: print/epsonepl "Printer filter for EPSON EPL-5700L etc"
Message-ID:  <200302150535.h1F5Z43a035880@terrorfish.uni.stoert.net>

next in thread | raw e-mail | index | archive | help

>Number:         48292
>Category:       ports
>Synopsis:       new port: print/epsonepl "Printer filter for EPSON EPL-5700L etc"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 14 21:40:10 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Simon 'corecode' Schubert
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD terrorfish.uni.stoert.net 5.0-CURRENT FreeBSD 5.0-CURRENT #48: Fri Feb 14 18:49:52 CET 2003 corecode@terrorfish.uni.stoert.net:/usr/obj/athlon/usr/src/sys/TERRORFISH i386


	
>Description:
This is a printer filter for the EPSON EPL-5700L, EPL-5800L and EPL-5900L
budget models of EPSON's laser printers.

This port also provides a driver for apsfilter.

WWW: http://epsonepl.sourceforge.net/

- Simon 'corecode' Schubert
	
>How-To-Repeat:
	
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	epsonepl
#	epsonepl/Makefile
#	epsonepl/distinfo
#	epsonepl/pkg-descr
#	epsonepl/pkg-plist
#	epsonepl/files
#	epsonepl/files/patch-ps2epl
#	epsonepl/files/patch-ijs_server_epsonepl.c
#	epsonepl/files/Makefile
#	epsonepl/files/epsonepl.conf.sample
#	epsonepl/files/epsonepl.apsfilter
#	epsonepl/pkg-message
#
echo c - epsonepl
mkdir -p epsonepl > /dev/null 2>&1
echo x - epsonepl/Makefile
sed 's/^X//' >epsonepl/Makefile << 'END-of-epsonepl/Makefile'
X# New ports collection makefile for:	epsonepl
X# Date created:		14 February 2003
X# Whom:			Simon 'corecode' Schubert <corecode@corecode.ath.cx>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	epsonepl
XPORTVERSION=	0.2.2
XCATEGORIES=	print
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
XDISTNAME=	${PORTNAME}ijs-${PORTVERSION}
XEXTRACT_SUFX=	.tgz
X
XMAINTAINER=	corecode@corecode.ath.cx
XCOMMENT=	"Printer filter for EPSON EPL-5700L etc"
X
XLIB_DEPENDS=	ijs.1:${PORTSDIR}/print/libijs
XRUN_DEPENDS=	gs:${PORTSDIR}/print/ghostscript-gnu
X
XMAKEFILE=	${FILESDIR}/Makefile
X
Xpost-extract:
X	@cd ${WRKSRC} && ${LS} ijs* | ${GREP} -v ${PORTNAME} | ${XARGS} ${RM}
X
Xpost-install:
X	@${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf.sample ${PREFIX}/etc
X	@${MKDIR} ${DATADIR}
X	@${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.apsfilter ${DATADIR}
X	@${SED} -e 's#%%PREFIX%%#${PREFIX}#' ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-epsonepl/Makefile
echo x - epsonepl/distinfo
sed 's/^X//' >epsonepl/distinfo << 'END-of-epsonepl/distinfo'
XMD5 (epsoneplijs-0.2.2.tgz) = bc4a146ed84573b9f12a5a05916d74ae
END-of-epsonepl/distinfo
echo x - epsonepl/pkg-descr
sed 's/^X//' >epsonepl/pkg-descr << 'END-of-epsonepl/pkg-descr'
XThis is a printer filter for the EPSON EPL-5700L, EPL-5800L and EPL-5900L
Xbudget models of EPSON's laser printers.
X
XThis port also provides a driver for apsfilter.
X
XWWW: http://epsonepl.sourceforge.net/
X
X- Simon 'corecode' Schubert
END-of-epsonepl/pkg-descr
echo x - epsonepl/pkg-plist
sed 's/^X//' >epsonepl/pkg-plist << 'END-of-epsonepl/pkg-plist'
Xbin/ijs_server_epsonepl
Xbin/ps2epl
Xetc/epsonepl.conf.sample
Xshare/epsonepl/epsonepl.apsfilter
X@dirrm share/epsonepl
END-of-epsonepl/pkg-plist
echo c - epsonepl/files
mkdir -p epsonepl/files > /dev/null 2>&1
echo x - epsonepl/files/patch-ps2epl
sed 's/^X//' >epsonepl/files/patch-ps2epl << 'END-of-epsonepl/files/patch-ps2epl'
X--- ps2epl.orig	Wed Jan 29 11:19:06 2003
X+++ ps2epl	Fri Feb 14 23:33:46 2003
X@@ -1,11 +1,105 @@
X #!/bin/sh
X 
X+parse() {
X+if [ ! -r "$1" ]; then
X+	echo "${BASENAME}: Can't read config file '$1'!" >&2
X+	exit 1
X+fi
X+sed -e 's/#.*//;
X+	/^[[:space:]]*$/d;
X+	s/^[[:space:]]*//;
X+	s/[[:space:]]*$//;
X+	s/^\([^[:space:]=]*\)[[:space:]=]*\(.*\)/\1 \2/' "$1" |
X+while read var value
X+do
X+	case `echo ${var} | tr '[[:upper:]]' '[[:lower:]]'` in
X+	model)
X+		case "${value}" in
X+		EPL5[789]00L)
X+			echo "MODEL='${value}'"
X+			;;
X+		*)
X+			echo "${BASENAME}: Unknown model '${value}'!" >&2
X+			exit 1
X+			;;
X+		esac
X+		;;
X+	papersize)
X+		echo "PAPERSIZE='${value}'"
X+		;;
X+	dpi)
X+		case "${value}" in
X+		300|Class600|600|Class1200)
X+			echo "DPI='${value}'"
X+			;;
X+		*)
X+			echo "${BASENAME}: Unknown resolution '${value}'!" >&2
X+			exit 1
X+			;;
X+		esac
X+		;;
X+	ritech)
X+		case "${value}" in
X+		on|off)
X+			echo "RITECH='${value}'"
X+			;;
X+		*)
X+			echo "${BASENAME}: Unknown ritech setting '${value}'!" >&2
X+			exit 1
X+			;;
X+		esac
X+		;;
X+	density)
X+		case "${value}" in
X+		[12345])
X+			echo "DENSITY='${value}'"
X+			;;
X+		*)
X+			echo "${BASENAME}: Unknown density setting '${value}'!" >&2
X+			exit 1
X+			;;
X+		esac
X+		;;
X+	tonersave)
X+		case "${value}" in
X+		on|off)
X+			echo "TONERSAVE='${value}'"
X+			;;
X+		*)
X+			echo "${BASENAME}: Unknown tonersave setting '${value}'!" >&2
X+			exit 1
X+			;;
X+		esac
X+		;;
X+	*)
X+		echo "${BASENAME}: Unknown setting '${var}=${value}'!" >&2
X+		exit 1
X+		;;
X+	esac
X+done
X+}
X+
X+BASENAME=`basename $0`
X+PREFIX=`dirname $0`
X+PREFIX=${PREFIX%/bin}
X+CONFIGFILE=${PREFIX}/etc/epsonepl.conf
X+
X+case "$1" in
X+-f?*)
X+	CONFIGFILE=${1#-f}
X+	;;
X+esac
X+
X+settings=`parse "${CONFIGFILE}"` || exit 1
X+eval "${settings}"
X 
X IJSPARMS=""
X 
X-# Start of printer selection part #########################################
X+if [ -z "${MODEL}" ]; then
X+	echo "${BASENAME}: You must specify a model!" >&2
X+	exit 1
X+fi
X 
X-MODEL=EPL5700L
X   # possible values: EPL5700L, EPL5800L, EPL5900L
X   # default: none, you have to specify a printer!
X 
X@@ -14,7 +108,10 @@
X 
X # Start of paper size selection part ######################################
X 
X-PAPERSIZE=a4
X+if [ -z "${PAPERSIZE}" ]; then
X+	echo "${BASENAME}: You must specify a papersize!" >&2
X+	exit 1
X+fi
X   # possible values: a4, letter, legal ...
X   #                  The full list is available in the Use.htm file of
X   #                  the ghostscript documentation (see appendix).
X@@ -25,25 +122,29 @@
X 
X # Start of options part ###################################################
X 
X-DPI=600
X+if [ -n "${DPI}" ]; then
X   # possible values: 300, Class600, 600, Class1200
X   # default: 600
X   IJSPARMS="EplDpi=$DPI"
X+fi
X 
X-RITECH=on
X+if [ -n "${RITECH}" ]; then
X   # possible values: on, off
X   # default: on
X-  IJSPARMS="$IJSPARMS,EplRitech=$RITECH"
X+  IJSPARMS="$IJSPARMS${IJSPARMS:+,}EplRitech=$RITECH"
X+fi
X 
X-DENSITY=3
X+if [ -n "${DENSITY}" ]; then
X   # possible values: 1, 2, 3, 4, 5
X   # default: 3
X-  IJSPARMS="$IJSPARMS,EplDensity=$DENSITY"
X+  IJSPARMS="$IJSPARMS${IJSPARMS:+,}EplDensity=$DENSITY"
X+fi
X 
X-TONERSAVE=off
X+if [ -n "${TONERSAVE}" ]; then
X   # possible values: on, off
X   # default: off
X-  IJSPARMS="$IJSPARMS,EplTonerSave=$TONERSAVE"
X+  IJSPARMS="$IJSPARMS${IJSPARMS:+,}EplTonerSave=$TONERSAVE"
X+fi
X 
X ##################################################### End of options part #
X 
X@@ -63,7 +164,7 @@
X done
X 
X if [ $# -lt 1 -o $# -gt 2 ]; then
X-	echo "Usage: `basename $0` [options...] (input.[e]ps|-) [output.epl|-]" 1>&2
X+	echo "Usage: ${BASENAME} [-f<config>] [options...] (input.[e]ps|-) [output.epl|-]" 1>&2
X 	exit 1
X fi
X 
X@@ -81,19 +182,11 @@
X 	outfile="$2"
X fi
X 
X-echo
X-echo -e "***** Printer: \"$MODEL\" *****"
X-echo
X-echo -e "***** Paper Size: \"$PAPERSIZE\" *****"
X-echo
X-echo -e "***** using parameters: \"$IJSPARMS\" *****"
X-echo
X-
X exec gs -sPAPERSIZE=$PAPERSIZE -dFIXEDMEDIA \
X -sProcessColorModel=DeviceGray -dBitsPerSample=1 \
X -sDEVICE=ijs -sIjsServer=ijs_server_epsonepl \
X -sDeviceManufacturer=Epson -sDeviceModel=$MODEL \
X -sIjsParams="$IJSPARMS" \
X -dIjsUseOutputFD \
X--dNOPAUSE -dSAFER -dBATCH \
X--sOutputFile=$outfile $infile
X+-dQUIET -dNOPAUSE -dSAFER -dBATCH \
X+-sOutputFile="$outfile" "$infile"
END-of-epsonepl/files/patch-ps2epl
echo x - epsonepl/files/patch-ijs_server_epsonepl.c
sed 's/^X//' >epsonepl/files/patch-ijs_server_epsonepl.c << 'END-of-epsonepl/files/patch-ijs_server_epsonepl.c'
X--- ijs_server_epsonepl.c.orig	Wed Jan 22 23:10:24 2003
X+++ ijs_server_epsonepl.c	Fri Feb 14 16:47:16 2003
X@@ -34,7 +34,6 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <string.h>
X-#include <malloc.h>
X #include "ijs.h"
X #include "ijs_server.h"
X 
X@@ -541,7 +540,9 @@
X 
X   /* Check options */
X 
X+#ifdef EPL_DEBUG
X   fprintf(stderr, "settings:\n");
X+#endif
X 
X   if (epl_job_info->outfile == NULL)
X     {
X@@ -596,7 +597,10 @@
X       fprintf(stderr, "Unknown Printer %s, aborting!\n", s);
X       return 1;
X     }
X+
X+#ifdef EPL_DEBUG
X   fprintf(stderr, "  Using protocol for %s\n",printername[epl_job_info->model]);
X+#endif
X 
X 
X   /* PaperSize */
X@@ -622,7 +626,9 @@
X           fprintf(stderr, "Unparsable PaperSize %s, aborting!", s);
X           return 1;
X 	}
X+#ifdef EPL_DEBUG
X       fprintf(stderr, "  Papersize is %s inches\n", s);
X+#endif
X     }
X 
X 
X@@ -659,7 +665,10 @@
X       fprintf(stderr, "Unknown EplDpi value %s, aborting!\n", s);
X       return 1;
X     }
X+
X+#ifdef EPL_DEBUG
X   fprintf(stderr, "  Printing at DPI %s\n", s);
X+#endif
X 
X   /* EplRitech */
X   s = find_param(pl, "EplRitech");
X@@ -681,7 +690,10 @@
X       fprintf(stderr, "Unknown EplRitech value %s, aborting!\n", s);
X       return 1;
X     }
X+
X+#ifdef EPD_DEBUG
X   fprintf(stderr, "  Ritech is %s\n", s);
X+#endif
X 
X   /* EplDensity */
X   s = find_param(pl, "EplDensity");
X@@ -715,7 +727,10 @@
X       fprintf(stderr, "Unknown EplDensity value %s, aborting!\n", s);
X       return 1;
X     }
X+
X+#ifdef EPL_DEBUG
X   fprintf(stderr, "  Density is %s\n", s);
X+#endif
X 
X   /* EplTonerSave */
X   s = find_param(pl, "EplTonerSave");
X@@ -737,7 +752,10 @@
X       fprintf(stderr, "Unknown EplTonerSave value %s, aborting!\n", s);
X       return 1;
X     }
X+
X+#ifdef EPL_DEBUG
X   fprintf(stderr, "  TonerSave is %s\n", s);
X+#endif
X 
X   /* Number of channels */
X   if (ph.bps != 1)
X@@ -758,11 +776,13 @@
X   /* BitMap Size */
X   epl_job_info->pixel_h = ph.width;
X   epl_job_info->pixel_v = ph.height;
X+#ifdef DEBUG
X   fprintf(stderr, "  Bitmap size %ix%i (%gx%g in)\n",
X           epl_job_info->pixel_h,
X 	  epl_job_info->pixel_v,
X 	  (double)epl_job_info->pixel_h / epl_job_info->dpi_h,
X 	  (double)epl_job_info->pixel_v / epl_job_info->dpi_v);
X+#endif
X 
X   /* Dpi of the bitmap */
X   if (ph.xres != (double)epl_job_info->dpi_h
X@@ -811,7 +831,7 @@
X   fprintf(stderr, "Try to allocate %i byte of memory for job info\n",sizeof(EPL_job_info));
X #endif
X   
X-  epl_job_info = (EPL_job_info *)malloc(sizeof(EPL_job_info));
X+  epl_job_info = (EPL_job_info *)calloc(1, sizeof(EPL_job_info));
X   
X   if (epl_job_info == NULL) {
X #ifdef EPL_DEBUG
X@@ -833,7 +853,9 @@
X       int i_stripe;
X       typ_stream *stream;
X       
X+#ifdef EPL_DEBUG
X       fprintf (stderr, "getting page header\n");
X+#endif
X       
X       status = ijs_server_get_page_header (ctx, &ph);
X       
X@@ -852,9 +874,10 @@
X 	  break;
X 	}
X       
X+#ifdef EPL_DEBUG
X       fprintf (stderr, "got page header, width %d x height %d\n",
X 	       ph.width, ph.height);
X-      
X+
X       /* Before starting, dump IJS parameters */
X 
X       for (curs = pl; curs != NULL; curs = curs->next)
X@@ -863,6 +886,7 @@
X 	  fwrite (curs->value, 1, curs->value_size, stderr);
X 	  fputs ("\n", stderr);
X 	}
X+#endif
X 
X       /* Convert parameters to internal format */
X 
END-of-epsonepl/files/patch-ijs_server_epsonepl.c
echo x - epsonepl/files/Makefile
sed 's/^X//' >epsonepl/files/Makefile << 'END-of-epsonepl/files/Makefile'
XDESTDIR=	${PREFIX}
XBINDIR=	/bin
X
XCFLAGS+=	-I${LOCALBASE}/include/ijs
XLDADD=	-L${LOCALBASE}/lib -lijs
X
XPROG=	ijs_server_epsonepl
XSRCS=	ijs_server_epsonepl.c epl_compress.c epl_job_footer.c epl_job_header.c \
X	epl_page_footer.c epl_page_header.c epl_print_stripe.c
X
XSCRIPTS=	ps2epl
XNOMAN=	yes
X
X.include <bsd.prog.mk>
END-of-epsonepl/files/Makefile
echo x - epsonepl/files/epsonepl.conf.sample
sed 's/^X//' >epsonepl/files/epsonepl.conf.sample << 'END-of-epsonepl/files/epsonepl.conf.sample'
X# sample config file for epsonepl
X# a hash sign starts a comment and counts as whitespace
X#
X# settings must be in the form of:
X# [whitespace]<variable><whitespace_or_=><value>[whitespace]
X#
X# variable	allowed values			mandatory	default
X# -----------------------------------------------------------------------
X# model		EPL5700L EPL5800L EPL5900L	yes		-
X# papersize	see gs config			yes		-
X# dpi		300 Class600 600 Class1200	no		600
X# ritech	on off				no		on
X# density	1 2 3 4 5			no		3
X# tonersave	on off				no		off
X#
X# you can specify ps2epl to use another config file by spefifying
X# -f<config> as the _first_ parameter, e.g.:
X# ps2epl -f/path/to/my/config [other options and files]
X#
Xmodel		EPL5700L
Xpapersize	a4
Xdpi		Class600
Xritech		on
Xdensity		3
Xtonersave	off
END-of-epsonepl/files/epsonepl.conf.sample
echo x - epsonepl/files/epsonepl.apsfilter
sed 's/^X//' >epsonepl/files/epsonepl.apsfilter << 'END-of-epsonepl/files/epsonepl.apsfilter'
X# apsfilter epson EPL5[789]00L driver
X# just copy to ${LOCALBASE}/share/apsfilter/driver/epsonepl and add this line to
X# ${LOCALBASE}/share/apsfilter/driver/MAPPING:
X# +--------------------------------------+
X# | epsonepl:EPL5700L:EPL5800L:EPL5900L: |
X# +--------------------------------------+
X
Xcase "$QUALITY" in
X	draft)	params="EplDpi=300,EplRitech=off,EplTonerSave=on" RESOLUTION=300x300 ;;
X	low)	params="EplDpi=300,EplRitech=off,EplTonerSave=off" RESOLUTION=300x300 ;;
X	medium)	params="EplDpi=Class600,EplRitech=on,EplTonerSave=off" RESOLUTION=600x300 ;;
X	high)	params="EplDpi=600,EplRitech=off,EplTonerSave=off" RESOLUTION=600x600 ;;
X	photo)	params="EplDpi=Class1200,EplRitech=on,EplTonerSave=off" RESOLUTION=1200x600 ;;
Xesac
X
XGS_FEATURES="$GS_FEATURES -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sIjsServer=ijs_server_epsonepl -dIjsUseOutputFD -sIjsParams='$params,EplDensity=3' -sDeviceManufacturer=Epson -sDeviceModel=$(echo $PRINTER | sed 's#.*/##')"
XPRINTER=ijs
END-of-epsonepl/files/epsonepl.apsfilter
echo x - epsonepl/pkg-message
sed 's/^X//' >epsonepl/pkg-message << 'END-of-epsonepl/pkg-message'
X-------------------------------------------------------------------------
X
XYou need to copy and customize 
X%%PREFIX%%/etc/epsonepl.conf[.sample]
X
XIf you're using apsfilter then have a look 
Xat %%PREFIX%%/share/epsonepl/epsonepl.apsfilter
X
X-------------------------------------------------------------------------
END-of-epsonepl/pkg-message
exit

	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302150535.h1F5Z43a035880>