svn commit: r316672 - in head: . graphics graphics/jpeg2ps graphics/jpeg2ps-a4 graphics/jpeg2ps-letter graphics/jpeg2ps/files print print/a2ps print/a2ps-a4 print/a2ps-letter print/c2ps print/c2ps-...

Hiroki Sato hrs at FreeBSD.org
Sat Apr 27 16:00:30 UTC 2013


Author: hrs
Date: Sat Apr 27 16:00:26 2013
New Revision: 316672
URL: http://svnweb.freebsd.org/changeset/ports/316672

Log:
  Add libpaper support to print/a2ps-*[1], print/c2ps-*, print/lprps-*,
  graphics/jpeg2ps-*, and merge the papersize-suffixed versions into
  single ones respectively as print/psutils did.
  
  Approved by:	dinoex (maintainer) [1]

Added:
  head/graphics/jpeg2ps/
     - copied from r316307, head/graphics/jpeg2ps-letter/
  head/graphics/jpeg2ps/files/
  head/graphics/jpeg2ps/files/patch-Makefile   (contents, props changed)
  head/graphics/jpeg2ps/files/patch-asc85ec.c   (contents, props changed)
  head/graphics/jpeg2ps/files/patch-jpeg2ps.c   (contents, props changed)
  head/print/a2ps/
     - copied from r316307, head/print/a2ps-letter/
  head/print/c2ps/
     - copied from r316307, head/print/c2ps-letter/
  head/print/c2ps/files/
  head/print/c2ps/files/patch-Makefile   (contents, props changed)
  head/print/c2ps/files/patch-c2ps.c   (contents, props changed)
  head/print/lprps/
     - copied from r316307, head/print/lprps-letter/
  head/print/lprps/files/patch-Makefile
     - copied, changed from r316307, head/print/lprps-letter/files/patch-aa
  head/print/lprps/files/patch-lprps.c
     - copied, changed from r316307, head/print/lprps-letter/files/patch-ab
  head/print/lprps/files/patch-psif.c   (contents, props changed)
  head/print/lprps/files/patch-psof.c
     - copied, changed from r316307, head/print/lprps-letter/files/patch-ac
  head/print/lprps/files/patch-psrev.c
     - copied, changed from r316307, head/print/lprps-letter/files/patch-ad
  head/print/lprps/files/patch-textps.c   (contents, props changed)
Deleted:
  head/graphics/jpeg2ps-a4/
  head/graphics/jpeg2ps-letter/
  head/print/a2ps-a4/
  head/print/a2ps-letter/
  head/print/c2ps-a4/
  head/print/c2ps-letter/
  head/print/lprps-a4/
  head/print/lprps-letter/
  head/print/lprps/files/patch-aa
  head/print/lprps/files/patch-ab
  head/print/lprps/files/patch-ac
  head/print/lprps/files/patch-ad
Modified:
  head/MOVED
  head/UPDATING
  head/graphics/Makefile
  head/graphics/jpeg2ps/Makefile
  head/graphics/jpeg2ps/pkg-descr
  head/print/Makefile
  head/print/a2ps/Makefile
  head/print/c2ps/Makefile
  head/print/foomatic-filters/Makefile
  head/print/lprps/Makefile
  head/print/xfce4-print/Makefile
  head/sysutils/LPRngTool/Makefile

Modified: head/MOVED
==============================================================================
--- head/MOVED	Sat Apr 27 15:57:16 2013	(r316671)
+++ head/MOVED	Sat Apr 27 16:00:26 2013	(r316672)
@@ -4226,3 +4226,11 @@ databases/mysql41-client||2013-04-26|Uns
 databases/mysql41-scripts||2013-04-26|Unsupported upstream since 2009-12-31
 databases/p5-DBD-mysql41||2013-04-26|Depends on databases/mysql41-server, which was removed
 security/gnupg-idea||2013-04-26|Removed
+print/c2ps-letter|print/c2ps|2013-04-27|Merged into print/c2ps
+print/c2ps-a4|print/c2ps|2013-04-27|Merged into print/c2ps
+print/lprps-letter|print/lprps|2013-04-27|Merged into print/lprps
+print/lprps-a4|print/lprps|2013-04-27|Merged into print/lprps
+graphics/jpeg2ps-letter|graphics/jpeg2ps|2013-04-27|Merged into graphics/jpeg2ps
+graphics/jpeg2ps-a4|graphics/jpeg2ps|2013-04-27|Merged into graphics/jpeg2ps
+print/a2ps-letter|print/a2ps|2013-04-27|Merged into print/a2ps
+print/a2ps-a4|print/a2ps|2013-04-27|Merged into print/a2ps

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sat Apr 27 15:57:16 2013	(r316671)
+++ head/UPDATING	Sat Apr 27 16:00:26 2013	(r316672)
@@ -5,6 +5,13 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20130427:
+  AFFECTS: users of print/a2ps-{a4,letter}, print/c2ps-{a4,letter}, print/lprps-{a4,letter}, or graphics/jpeg2ps-{a4,letter}
+  AUTHOR: hrs at FreeBSD.org
+
+  The affected ports have been converted to use libpaper for the default paper
+  size as print/psutils did.  For more detail, see 20130424 below.
+
 20130424:
   AFFECTS: users of print/psutils-a4 or print/psutils-letter
   AUTHOR: hrs at FreeBSD.org

Modified: head/graphics/Makefile
==============================================================================
--- head/graphics/Makefile	Sat Apr 27 15:57:16 2013	(r316671)
+++ head/graphics/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -399,8 +399,7 @@
     SUBDIR += jp2a
     SUBDIR += jpatch
     SUBDIR += jpeg
-    SUBDIR += jpeg2ps-a4
-    SUBDIR += jpeg2ps-letter
+    SUBDIR += jpeg2ps
     SUBDIR += jpeginfo
     SUBDIR += jpegoptim
     SUBDIR += jpg2pdf

Modified: head/graphics/jpeg2ps/Makefile
==============================================================================
--- head/graphics/jpeg2ps-letter/Makefile	Tue Apr 23 05:11:57 2013	(r316307)
+++ head/graphics/jpeg2ps/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,39 +1,34 @@
-# New ports collection makefile for:	jpeg2ps (letter)
-# Date created:		30 December 2000
-# Whom:			Lars Koeller <Lars.Koeller at Uni-Bielefeld.de>
-#
+# Created by: Lars Koeller <Lars.Koeller at Uni-Bielefeld.de>
 # $FreeBSD$
-#
 
 PORTNAME=	jpeg2ps
 PORTVERSION=	1.9
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics converters
 MASTER_SITES=	http://www.pdflib.com/fileadmin/pdflib/products/more/jpeg2ps/
-PKGNAMESUFFIX=	-${PAPERSIZE}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	hrs at FreeBSD.org
 COMMENT=	Converter for JPEG compressed images to PostScript Level 2
 
-MAKE_ARGS+=	CFLAGS="-c ${CFLAGS}" LD="${CC}"
+LIB_DEPENDS=	paper:${PORTSDIR}/print/libpaper
 
+OPTIONS_DEFINE=	DOCS
+CFLAGS=		-DLIBPAPER -I${LOCALBASE}/include
+LDADD=		-lm -lpaper -L${LOCALBASE}/lib
+MAKE_ARGS=	LDADD="${LDADD}"
 MAN1=		jpeg2ps.1
 PLIST_FILES=	bin/jpeg2ps
 
-PAPERSIZE?=	letter
+.include <bsd.port.options.mk>
 
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 PORTDOCS=	jpeg2ps.txt
 .endif
 
-.if ${PAPERSIZE} == a4
-CFLAGS+=	-DA4
-.endif
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/jpeg2ps ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/jpeg2ps.1 ${MANPREFIX}/man/man1
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/jpeg2ps.txt ${DOCSDIR}
 .endif

Added: head/graphics/jpeg2ps/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/jpeg2ps/files/patch-Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -0,0 +1,57 @@
+--- Makefile.orig	2002-02-04 20:39:21.000000000 +0900
++++ Makefile	2013-04-27 23:58:44.000000000 +0900
+@@ -14,15 +14,17 @@
+ # The following was reported to work for emx/gcc 0.9c fix04 under OS/2:
+ # make -f Makefile "CFLAGS=-c -DA4 -DDOS -O2" "LDFLAGS=-Zexe -s"
+ 
+-CFLAGS=-c -DA4
+-LD=cc
+-LDFLAGS=
++PREFIX?=	/usr/local
++LOCALBASE?=	/usr/local
++LD=	${CC}
++LDFLAGS?=
++LDADD?=
+ OBJ=o
+ EXE=
+ RM=rm -f
+ 
+ .c.$(OBJ) :
+-	$(CC) $(CFLAGS) $*.c
++	$(CC) $(CFLAGS) -c $*.c
+ 
+ all:	jpeg2ps$(EXE)
+ 
+@@ -30,7 +32,7 @@
+ # at the end of the next two lines below.
+ 
+ jpeg2ps$(EXE):	jpeg2ps.$(OBJ) readjpeg.$(OBJ) asc85ec.$(OBJ)
+-	$(LD) $(LDFLAGS) -o jpeg2ps$(EXE) jpeg2ps.$(OBJ) readjpeg.$(OBJ) asc85ec.$(OBJ)
++	$(LD) $(LDFLAGS) -o jpeg2ps$(EXE) jpeg2ps.$(OBJ) readjpeg.$(OBJ) asc85ec.$(OBJ) $(LDADD)
+ 
+ DISTFILES = \
+ 	jpeg2ps.c psimage.h readjpeg.c asc85ec.c getopt.c	\
+@@ -42,10 +44,10 @@
+ 
+ # Location where to install the binary. This is a suitable value for Linux
+ # (and possibly other unix-like) systems.
+-BINDIR = /usr/local/bin
++BINDIR?= ${PREFIX}/bin
+ 
+ # Location where to install the manual page.
+-MANDIR = /usr/local/man/man1
++MANDIR?= ${MAN1PREFIX}/man/man1
+ 
+ CONVFILES = \
+ 	jpeg2ps.c psimage.h readjpeg.c asc85ec.c getopt.c	\
+@@ -76,8 +78,8 @@
+ 	nesrin.eps
+ 
+ install: jpeg2ps$(EXE)
+-	cp jpeg2ps$(EXE) $(BINDIR)
+-	cp jpeg2ps.1 $(MANDIR)
++	${BSD_INSTALL_PROGRAM} jpeg2ps$(EXE) $(BINDIR)
++	${BSD_INSTALL_DATA} jpeg2ps.1 $(MANDIR)
+ 
+ uninstall:
+ 	rm -f $(BINDIR)/jpeg2ps$(EXE)

Added: head/graphics/jpeg2ps/files/patch-asc85ec.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/jpeg2ps/files/patch-asc85ec.c	Sat Apr 27 16:00:26 2013	(r316672)
@@ -0,0 +1,10 @@
+--- asc85ec.c.orig	2013-04-27 23:43:09.000000000 +0900
++++ asc85ec.c	2013-04-27 23:43:22.000000000 +0900
+@@ -2,6 +2,7 @@
+ /* (C) Thomas Merz 1994-2002 */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ 
+ /* try to identify Mac compilers */

Added: head/graphics/jpeg2ps/files/patch-jpeg2ps.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/jpeg2ps/files/patch-jpeg2ps.c	Sat Apr 27 16:00:26 2013	(r316672)
@@ -0,0 +1,107 @@
+--- jpeg2ps.c.orig	2013-04-27 23:19:06.000000000 +0900
++++ jpeg2ps.c	2013-04-27 23:32:17.000000000 +0900
+@@ -73,6 +73,13 @@
+ static char buffer[BUFFERSIZE];
+ static char *ColorSpaceNames[] = {"", "Gray", "", "RGB", "CMYK" };
+ 
++#ifdef LIBPAPER
++#include <math.h>
++#include <paper.h>
++
++int PageWidth  = 595;           /* page width A4 */
++int PageHeight = 842;           /* page height A4 */
++#else
+ /* Array of known page sizes including name, width, and height */
+ 
+ typedef struct { const char *name; int width; int height; } PageSize_s;
+@@ -104,6 +111,7 @@
+ int PageWidth  = 612;           /* page width letter */
+ int PageHeight = 792;           /* page height letter */
+ #endif
++#endif
+ 
+ static void 
+ JPEGtoPS(imagedata *JPEG, FILE *PSfile) {
+@@ -294,16 +302,39 @@
+   fprintf(stderr, "-b        binary mode: output 8 bit data (default: 7 bit with ASCII85)\n");
+   fprintf(stderr, "-h        hex mode: output 7 bit data in ASCIIHex encoding\n");
+   fprintf(stderr, "-o <name> output file name\n");
++#ifdef LIBPAPER
++  fprintf(stderr, "-p <size> page size name. Known names can be displayed "
++                  "by paperconf -a command.\n");
++#else
+   fprintf(stderr, "-p <size> page size name. Known names are:\n");
+   fprintf(stderr, "          a0, a1, a2, a3, a4, a5, a6, b5, letter, legal, ledger, p11x17\n");
++#endif
+   fprintf(stderr, "-q        quiet mode: suppress all informational messages\n");
+   fprintf(stderr, "-r <dpi>  resolution value (dots per inch)\n");
+   fprintf(stderr, "          0 means use value given in file, if any (disables autorotate)\n");
+   exit(1);
+ }
+ 
++#ifdef LIBPAPER
++const struct paper *findpaper(char *name)
++{
++	const struct paper *pp;
++
++	paperinit();
++	for (pp = paperfirst(); pp; pp = papernext(pp)) {
++		if (strcmp(name, papername(pp)) == 0)
++			return (pp);
++	}
++	return (NULL);
++}
++#endif
++
+ int
+ main(int argc, char ** argv) {
++#ifdef LIBPAPER
++  const struct paper *pp;
++  char *name = NULL;
++#endif
+   imagedata image;
+   FILE *outfile;
+ 
+@@ -346,6 +377,9 @@
+ 	  } 
+ 	  break;
+       case 'p':
++#ifdef LIBPAPER
++	  name = strdup(optarg);
++#else
+ 	  for(pagesizeindex=0; pagesizeindex < PAGESIZELIST; pagesizeindex++)
+ 	    if (!strcmp((const char *) optarg, PageSizes[pagesizeindex].name)) {
+ 		PageHeight = PageSizes[pagesizeindex].height;
+@@ -356,6 +390,7 @@
+ 		fprintf(stderr, "Error: Unknown page size %s.\n", optarg);
+ 		exit(-3);
+ 	  }
++#endif
+ 	  break;
+       case 'q':
+           quiet = TRUE;
+@@ -371,9 +406,24 @@
+ 	  usage();
+     }
+ 
++#ifdef LIBPAPER
++  if (name == NULL) {
++	name = (char *)systempapername();
++	if (name == NULL)
++		name = (char *)defaultpapername();
++  }
++  if ((pp = findpaper(name)) != NULL) {
++	PageHeight = round(paperpsheight(pp));
++	PageWidth = round(paperpswidth(pp));
++  } else {
++	fprintf(stderr, "Error: Unknown page size %s.\n", name);
++	exit(-3);
++  }
++#else
+   if (pagesizeindex != -1 && ! quiet)	/* page size user option given */
+       fprintf(stderr, "Note: Using %s page size.\n",
+ 		    PageSizes[pagesizeindex].name);
++#endif
+ 
+   if (optind == argc)	/* filename missing */
+     usage();

Modified: head/graphics/jpeg2ps/pkg-descr
==============================================================================
--- head/graphics/jpeg2ps-letter/pkg-descr	Tue Apr 23 05:11:57 2013	(r316307)
+++ head/graphics/jpeg2ps/pkg-descr	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,5 +1,3 @@
-Purpose of jpeg2ps
-==================
 jpeg2ps converts JPEG files to PostScript Level 2 or 3 EPS. In fact, jpeg2ps
 is not really a converter but a "wrapper": it reads the image parameters
 (width, height, number of color components) in a JPEG file, writes the

Modified: head/print/Makefile
==============================================================================
--- head/print/Makefile	Sat Apr 27 15:57:16 2013	(r316671)
+++ head/print/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -4,9 +4,7 @@
     COMMENT = Desktop publishing
 
     SUBDIR += a2pdf
-    SUBDIR += a2ps-a4
-    SUBDIR += a2ps-letter
-    SUBDIR += a2ps-letterdj
+    SUBDIR += a2ps
     SUBDIR += abc2mtex
     SUBDIR += abcm2ps
     SUBDIR += abntex
@@ -26,8 +24,7 @@
     SUBDIR += biblio-py
     SUBDIR += bibview
     SUBDIR += bophook
-    SUBDIR += c2ps-a4
-    SUBDIR += c2ps-letter
+    SUBDIR += c2ps
     SUBDIR += catdvi
     SUBDIR += cdlabelgen
     SUBDIR += cjk-lyx
@@ -174,8 +171,7 @@
     SUBDIR += linux-f10-cups-libs
     SUBDIR += lout
     SUBDIR += lpr-wrapper
-    SUBDIR += lprps-a4
-    SUBDIR += lprps-letter
+    SUBDIR += lprps
     SUBDIR += lyx
     SUBDIR += lyx16
     SUBDIR += magicfilter

Modified: head/print/a2ps/Makefile
==============================================================================
--- head/print/a2ps-letter/Makefile	Tue Apr 23 05:11:57 2013	(r316307)
+++ head/print/a2ps/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,53 +1,42 @@
-# Created by:	Chuck Robey (chuckr at freebsd.org)
+# Created by: Chuck Robey <chuckr at freebsd.org>
 # $FreeBSD$
 
 PORTNAME=	a2ps
 PORTVERSION=	4.13b
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	print
 MASTER_SITES=	${MASTER_SITE_GNU} \
 		${MASTER_SITE_LOCAL:S/$/:i18n/}
 MASTER_SITE_SUBDIR=	${PORTNAME} hrs/a2ps/:i18n
-PKGNAMESUFFIX=	-${PAPERSIZE:L}${PKGNAMESUFFIX2}
 
 MAINTAINER=	dinoex at FreeBSD.org
 COMMENT=	Formats an ASCII file for printing on a postscript printer
 
 LICENSE=	GPLv2
 
+LIB_DEPENDS=	paper:${PORTSDIR}/print/libpaper
+
 USE_PERL5=	yes
 USE_CSTD=	gnu89
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
-MAN1=		a2ps.1 ogonkify.1 card.1 psmandup.1 fixps.1 pdiff.1 psset.1 texi2dvi4a2ps.1
+MAN1=		a2ps.1 ogonkify.1 card.1 psmandup.1 fixps.1 pdiff.1 psset.1 \
+		texi2dvi4a2ps.1
 INFO=		a2ps ogonkify regex
 WRKSRC=		${WRKDIR}/${PORTNAME}-4.13
 I18N_PACKAGE=	i18n-fonts-0.1
 PORTSCOUT=	skipv:4.14
 
-PAPERSIZE?=	letter
-PAPERSIZECNF=	${PAPERSIZE:S/l/L/:S/a/A/}
 STRIP=
-CONFIGURE_ARGS=	--with-medium=${PAPERSIZECNF} --sharedstatedir=${PREFIX}/share --sysconfdir=${PREFIX}/etc --datadir=${PREFIX}/share --localstatedir=${PREFIX}/share
-
-.if ${PAPERSIZE:L} != a4 && ${PAPERSIZE} != letter && ${PAPERSIZE} != letterdj
-.BEGIN:
-	@${ECHO_CMD}
-	@${ECHO_CMD} "PAPERSIZE incorrect value: ${PAPERSIZE}."
-	@${ECHO_CMD}
-	@${ECHO_CMD} "Must specify PAPERSIZE as one of a4, letter, or letterdj."
-	@${ECHO_CMD} "letterdj allows a slightly larger margins for DeskJets."
-	@${FALSE}
-.endif
+CONFIGURE_ARGS=	--with-medium=libpaper --sharedstatedir=${PREFIX}/share \
+	--sysconfdir=${PREFIX}/etc --datadir=${PREFIX}/share \
+	--localstatedir=${PREFIX}/share
+CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib"
+MAKE_JOBS_SAFE=	yes
 
+PAPERSIZE?=
 .if ${PAPERSIZE:L} == a4
-CONFLICTS?=	a2ps-letter-4.* a2ps-letterdj-4.*
-.else
-.if ${PAPERSIZE:L} == letter
-CONFLICTS?=	a2ps-a4-4.* a2ps-letterdj-4.*
-.else
-CONFLICTS?=	a2ps-a4-4.* a2ps-letter-4.*
-.endif
+RUN_DEPENDS+=	${LOCALBASE}/etc/papersize:${PORTSDIR}/print/papersize-default-a4
 .endif
 
 OPTIONS_DEFINE=NLS I18N EMACS
@@ -58,8 +47,8 @@ I18N_DESC=Enable I18N support
 
 .include <bsd.port.options.mk>
 
-.if !defined(WITHOUT_NLS)
-USE_GETTEXT=	yes
+.if ${PORT_OPTIONS:MNLS}
+USES+=		gettext
 PLIST_SUB+=	NLS=""
 .else
 CONFIGURE_ARGS+=	--disable-nls
@@ -80,13 +69,15 @@ DISTFILES=	${DISTNAME}${EXTRACT_SUFX} ${
 PLIST_SUB+=	WITHI18N=""
 
 pre-configure:
-	@cd ${WRKDIR}/${I18N_PACKAGE}/afm && ${ECHO} *.afm > afms.lst && \
-	${MV} *.afm ${WRKSRC}/afm && cd ../fonts && \
-	${MV} *.pfb ${WRKSRC}/fonts
+	cd ${WRKDIR}/${I18N_PACKAGE}/afm && \
+		${ECHO_CMD} *.afm > afms.lst && \
+		${MV} *.afm ${WRKSRC}/afm
+	cd ${WRKDIR}/${I18N_PACKAGE}/fonts && \
+		${MV} *.pfb ${WRKSRC}/fonts
 
 post-configure:
-	@cd ${WRKSRC}/fonts && { ${ECHO} ''; \
-	${ECHO} "pfb_fonts =" *.pfb; } >> Makefile && \
+	@cd ${WRKSRC}/fonts && { ${ECHO_CMD} ''; \
+	${ECHO_CMD} "pfb_fonts =" *.pfb; } >> Makefile && \
 	${REINPLACE_CMD} 's,^\(fonts_DATA = .*\),\1 $$(pfb_fonts),' Makefile
 	@cd ${WRKSRC}/afm && { ${ECHO} ''; \
 	${ECHO} "i18n_afms =" `cat ${WRKDIR}/${I18N_PACKAGE}/afm/afms.lst`; } >> Makefile && \
@@ -104,7 +95,8 @@ post-install:
 	${LN} -sf ${PREFIX}/share/emacs/site-lisp/a2ps.el \
 		  ${PREFIX}/lib/xemacs/site-lisp/a2ps.el
 .endif
-	(cd ${WRKSRC}/doc; ${MAKE} install)
+	cd ${WRKSRC}/doc && \
+		${SETENV} ${MAKE_ENV} ${MAKE} ${.MAKEFLAGS} ${INSTALL_TARGET}
 	${RM} -f ${PREFIX}/lib/liba2ps.la
 
 .include <bsd.port.mk>

Modified: head/print/c2ps/Makefile
==============================================================================
--- head/print/c2ps-letter/Makefile	Tue Apr 23 05:11:57 2013	(r316307)
+++ head/print/c2ps/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,35 +1,20 @@
-# New ports collection makefile for:   c2ps (letter)
-# Date created:        19 March 1997
-# Whom:                Matthew Hunt <mph at pobox.com>
-#
+# Created by: Matthew Hunt <mph at pobox.com>
 # $FreeBSD$
-#
 
-PORTNAME=	c2ps-${PAPERSIZE}
+PORTNAME=	c2ps
 PORTVERSION=	4.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	print
 MASTER_SITES=	http://www.cs.technion.ac.il/users/c2ps/
 DISTNAME=	c2ps-${PORTVERSION}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	hrs at FreeBSD.org
 COMMENT=	A PostScript pretty-printer for C source
 
-MAKE_ARGS=	CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${PREFIX}" \
-		DEFAULT_PAPER_TYPE="${PS}"
-
+CFLAGS+=	-g -I${LOCALBASE}/include
 MAN1=		c2ps.1
 PLIST_FILES=	bin/c2ps
 
-PAPERSIZE?=	letter
-PS!=		echo ${PAPERSIZE} | awk '{print toupper($$1)}'
-.if ${PAPERSIZE:L} != a4 && ${PAPERSIZE:L} != letter
-.BEGIN:
-	@${ECHO_MSG} "Invalid value for PAPERSIZE: \"${PAPERSIZE}\""
-	@${ECHO_MSG} "Possible values are:  a4, and letter."
-	@${FALSE}
-.endif
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/c2ps ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/c2ps.1 ${MANPREFIX}/man/man1

Added: head/print/c2ps/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/c2ps/files/patch-Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -0,0 +1,47 @@
+--- Makefile.orig	1997-05-16 00:50:56.000000000 +0900
++++ Makefile	2013-04-27 18:57:47.000000000 +0900
+@@ -2,12 +2,12 @@
+ # Last modified: Sat Apr 19 1997
+ 
+ RM	= 	rm -f
+-CC	=	gcc
+-CCFLAGS =       -O
++CC?	=	gcc
++CCFLAGS?=       -O
+ 
+-PREFIX	=	/usr/local
++PREFIX?=	/usr/local
+ BIN	=	$(PREFIX)/bin
+-MAN	=	$(PREFIX)/man/man1
++MAN	=	${MAN1PREFIX}/man/man1
+ 
+ # you may predefine some of the default settings
+ DEFAULT_FONT	= \"Courier\"
+@@ -31,23 +31,20 @@
+  -DSTRINGS=$(STRINGS_FONT) -DPREPROC=$(PREPROC_FONT)\
+  -DKEYWORD=$(KEYWORD_FONT) -DTYPE=$(TYPE_FONT)\
+  -DLNUMBER=$(LNUMBER_FONT) -DFUNCTION=$(FUNCTION_FONT)\
+- -DDIM=$(COMMENT_DIMMING_DEGREE)\
+- -D$(DEFAULT_PAPER_TYPE)
++ -DDIM=$(COMMENT_DIMMING_DEGREE)
+ 
+ all:		compile
+ 
+ install:	bininstall maninstall
+ 
+ bininstall:	c2ps
+-	install -m 755 c2ps $(BIN)
++	${BSD_INSTALL_PROGRAM} c2ps $(BIN)
+ 
+ maninstall:	c2ps.1
+-	install -m 644 c2ps.1 $(MAN)
++	${BSD_INSTALL_DATA} c2ps.1 $(MAN)
+ 
+ compile:	c2ps.c
+-	$(CC) $(PREP_OPTIONS) $(CCFLAGS) -o c2ps c2ps.c
++	$(CC) $(PREP_OPTIONS) $(CFLAGS) -o c2ps c2ps.c -L${LOCALBASE}/lib -lm -lpaper
+ 
+ clean:
+ 	$(RM) c2ps *.o core *~
+-
+-

Added: head/print/c2ps/files/patch-c2ps.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/print/c2ps/files/patch-c2ps.c	Sat Apr 27 16:00:26 2013	(r316672)
@@ -0,0 +1,346 @@
+--- c2ps.c.orig	1997-05-19 21:43:04.000000000 +0900
++++ c2ps.c	2013-04-27 18:55:52.000000000 +0900
+@@ -45,7 +45,6 @@
+ 
+ 
+ 

+-#line 2 "c2ps.c"
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+@@ -1641,9 +1640,7 @@
+ #define yymore() (yy_more_flag = 1)
+ #define YY_MORE_ADJ yy_more_len
+ char *yytext;
+-#line 1 "l1.m"
+ #define INITIAL 0
+-#line 2 "l1.m"
+ #define VERSION "4.0"
+ 
+ #ifndef DEFAULT
+@@ -1673,11 +1670,6 @@
+ #ifndef DIM
+ #define DIM 0.75
+ #endif
+-#ifdef LETTER
+-#define LETTER 1
+-#else
+-#define LETTER 0
+-#endif
+ 
+ #define ISO "\n"\
+ "%%%%BeginProlog								\n"\
+@@ -1829,6 +1821,14 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
++#include <math.h>
++#include <paper.h>
++
++struct {
++	char *name;
++	int width, height;
++} pspec;
++
+ FILE* out;			/* output stream */
+ 
+ struct fun {			/* strucure to hold info about fun id definition */
+@@ -1845,7 +1845,6 @@
+ unsigned line_cut = 0;		/* global: cut long lines */
+ unsigned ppl = 1;		/* global: columns per page */
+ unsigned lpp = 0;		/* global: lines per page */
+-unsigned letter = LETTER;	/* global: use letter paper type */
+ unsigned frame = 0;		/* global: draw frame around each column */
+ unsigned iso = 1;		/* global: support ISO Latin 1 encoding */
+ unsigned last_modified = 1;	/* global: print the time when file was last modified */
+@@ -1929,7 +1928,6 @@
+ 
+ #define dont_highlight 4
+ 
+-#line 1892 "c2ps.c"
+ 
+ /* Macros after this point can all be overridden by user definitions in
+  * section 1.
+@@ -2079,9 +2077,7 @@
+ 	register char *yy_cp, *yy_bp;
+ 	register int yy_act;
+ 
+-#line 301 "l1.m"
+ 
+-#line 2044 "c2ps.c"
+ 
+ 	if ( yy_init )
+ 		{
+@@ -2197,21 +2193,18 @@
+ 	{ /* beginning of action switch */
+ case 1:
+ YY_RULE_SETUP
+-#line 302 "l1.m"
+ {
+                         PString(yytext);
+                 }
+ 	YY_BREAK
+ case 2:
+ YY_RULE_SETUP
+-#line 305 "l1.m"
+ {
+                         NextLine();
+                 }
+ 	YY_BREAK
+ case 3:
+ YY_RULE_SETUP
+-#line 308 "l1.m"
+ { /*'*/
+ 			PFlush();
+                         fprintf(out, "cf fst\n");
+@@ -2221,7 +2214,6 @@
+ 	YY_BREAK
+ case 4:
+ YY_RULE_SETUP
+-#line 314 "l1.m"
+ {
+                         PFlush();
+ 			while (1)
+@@ -2244,7 +2236,6 @@
+ 	YY_BREAK
+ case 5:
+ YY_RULE_SETUP
+-#line 333 "l1.m"
+ {
+ 			c = yytext;
+ 			if (adjust_comments)
+@@ -2267,12 +2258,10 @@
+ 	YY_BREAK
+ case 6:
+ YY_RULE_SETUP
+-#line 352 "l1.m"
+ {	yymore();		}
+ 	YY_BREAK
+ case 7:
+ YY_RULE_SETUP
+-#line 353 "l1.m"
+ {
+ 			c = yytext;
+                         if (adjust_comments && comment_many_lines++)
+@@ -2290,12 +2279,10 @@
+ yy_c_buf_p = yy_cp = yy_bp + 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 364 "l1.m"
+ {	yymore();		}
+ 	YY_BREAK
+ case 9:
+ YY_RULE_SETUP
+-#line 366 "l1.m"
+ {
+ 			PFlush();
+ 			while (1)
+@@ -2316,7 +2303,6 @@
+ 	YY_BREAK
+ case 10:
+ YY_RULE_SETUP
+-#line 383 "l1.m"
+ {
+                         PFlush();
+ 			while (1)
+@@ -2411,7 +2397,6 @@
+ 	YY_BREAK
+ case 11:
+ YY_RULE_SETUP
+-#line 474 "l1.m"
+ {
+                         PFill("\\");
+ 			PFlush();
+@@ -2423,7 +2408,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 479 "l1.m"
+ {
+ 			PFlush();
+                         BEGIN((nesting <= 0) ? nnested : INITIAL);
+@@ -2431,7 +2415,6 @@
+ 	YY_BREAK
+ case 13:
+ YY_RULE_SETUP
+-#line 483 "l1.m"
+ {
+ 			if (pd > 0 &&
+ 			    prep_touch[pd - 1] &&
+@@ -2489,7 +2472,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 534 "l1.m"
+ {
+ 			PFill(yytext);
+ 			PFlush();
+@@ -2503,7 +2485,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 541 "l1.m"
+ {
+ 			PFlush();
+                         fprintf(out, "cf fty\n");
+@@ -2516,7 +2497,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 547 "l1.m"
+ {
+ 			PFill(yytext);
+ 			PFlush();
+@@ -2530,7 +2510,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 554 "l1.m"
+ {
+ 			PFlush();
+                         fprintf(out, "cf %s\n", (ext) ? "fty" : "fdf");
+@@ -2543,7 +2522,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 560 "l1.m"
+ {
+ 			PFill(yytext);
+ 			PFlush();
+@@ -2557,7 +2535,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 567 "l1.m"
+ {
+ 			PFlush();
+                         fprintf(out, "cf fke\n");
+@@ -2570,7 +2547,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 573 "l1.m"
+ {
+ 			PFill(yytext);
+ 			PFlush();
+@@ -2584,7 +2560,6 @@
+ yy_c_buf_p = yy_cp -= 1;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 580 "l1.m"
+ {
+ 			PFlush();
+                         fprintf(out, "cf %s\n", (ext) ? "fke" : "fdf");
+@@ -2594,7 +2569,6 @@
+ 	YY_BREAK
+ case 22:
+ YY_RULE_SETUP
+-#line 586 "l1.m"
+ {
+ 			PFlush();
+ 			if (! (pd > 0 &&
+@@ -2604,17 +2578,14 @@
+ 	YY_BREAK
+ case 23:
+ YY_RULE_SETUP
+-#line 592 "l1.m"
+ {
+                         PFill(yytext);
+ 		}
+ 	YY_BREAK
+ case 24:
+ YY_RULE_SETUP
+-#line 595 "l1.m"
+ ECHO;
+ 	YY_BREAK
+-#line 2577 "c2ps.c"
+ 			case YY_STATE_EOF(INITIAL):
+ 			case YY_STATE_EOF(comm):
+ 			case YY_STATE_EOF(preps):
+@@ -3479,7 +3450,6 @@
+ 	return 0;
+ 	}
+ #endif
+-#line 595 "l1.m"
+ 
+ 
+ #ifdef YY_USE_PROTOS
+@@ -3680,7 +3650,7 @@
+ 	      page / ppl + 1, total_page / ppl +1);
+       if (page > 0 && comment)
+ 	fprintf(out, "setgray\n");
+-      if (letter)
++      if (strncasecmp(pspec.name, "letter", 7) == 0)
+ 	fprintf(out, "0.93 0.93 scale 31 8 translate\n");
+       switch(ppl)
+ 	{
+@@ -3917,6 +3887,34 @@
+   return 1;
+ }
+ 
++void getpaper(char *name)
++{
++	const struct paper *pp;
++
++	if (name == NULL) {
++		name = (char *)systempapername();
++		if (name == NULL)
++			name = (char *)defaultpapername();
++	}
++
++	/* Support only A4 or letter. */
++	if (strncasecmp(name, "a4", 3) != 0 &&
++	    strncasecmp(name, "letter", 7) != 0) {
++		fprintf(stderr, "Unsupported paper size: %s.  "
++		    "A4 size will be used instead.\n", name);
++		name = "a4";
++	}
++
++	paperinit();
++	for (pp = paperfirst(); pp; pp = papernext(pp)) {
++		if (strcmp(name, papername(pp)) == 0) {
++			pspec.name = strdup(name);
++			pspec.width = round(paperpswidth(pp));
++			pspec.height = round(paperpsheight(pp));
++		}
++	}
++}
++
+ #define REENCODE(font) fprintf(out,"/%s /%s-iso isovec ReEncode\n",font,font)
+ 
+ #ifdef YY_USE_PROTOS
+@@ -3937,6 +3935,7 @@
+   char *lnumber = NULL;
+   char *function = NULL;
+   char *nonlatin = NULL;
++  char *pflag = NULL;
+ 
+   out = stdout;
+   first = NULL;
+@@ -3984,7 +3983,7 @@
+ 					      argv[i]);
+ 				      exit(0);
+ 				    }                                           break;
+-			case 'p': if (!strcmp(argv[i], "Letter")) letter = 1;	break;
++			case 'p': DUP(pflag,      argv[i]);			break;
+ 			case 't': tab = abs(atoi (argv[i])); 			break;
+ 			case 'F': DUP(dftfont,    argv[i]);		        break;
+ 			case 'P': DUP(preproc,    argv[i]);		        break;
+@@ -4078,6 +4077,8 @@
+       nonlatin_text = 1;
+     }
+ 
++  getpaper(pflag);
++
+   fprintf(out, "%%!PS-Adobe-2.0\n%%%%Creator: c2ps version %s\n", VERSION);
+   fprintf(out, "%%%%Orientation: %s\n", (ppl == 2) ? "Landscape" : "Portrait");
+   fprintf(out, "%%%%Pages: (atend)\n");
+@@ -4089,7 +4090,7 @@
+     fprintf(out, " %s %s %s %s %s %s",
+ 	    keyword, strings, type, preproc, comment, function);
+   fprintf(out, "\n%%%%DocumentMedia: %s\n%%%%EndComments\n\n",
+-	    (letter) ? "Letter 612 792" : "A4 595 842");
++	    (strncasecmp(pspec.name, "letter", 7) == 0) ? "Letter 612 792" : "A4 595 842");
+   if (iso)
+     {
+       fprintf(out, ISO);

Modified: head/print/foomatic-filters/Makefile
==============================================================================
--- head/print/foomatic-filters/Makefile	Sat Apr 27 15:57:16 2013	(r316671)
+++ head/print/foomatic-filters/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -3,7 +3,7 @@
 
 PORTNAME=	foomatic-filters
 PORTVERSION=	4.0.7
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	print
 MASTER_SITES=	http://www.openprinting.org/download/foomatic/
 
@@ -28,15 +28,12 @@ CONFIGURE_ENV=	ac_cv_path_A2PS=${LOCALBA
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
 
-OPTIONS_DEFINE=	CUPS_IMAGE MPAGE
-OPTIONS_SINGLE=	A2PS ENSCRIPT
-OPTIONS_SINGLE_A2PS=	A2PS_A4 A2PS_LETTER A2PS_LETTERDJ
+OPTIONS_DEFINE=	A2PS CUPS_IMAGE MPAGE
+OPTIONS_SINGLE=	ENSCRIPT
 OPTIONS_SINGLE_ENSCRIPT=	ENSCRIPT_A4 ENSCRIPT_LETTER ENSCRIPT_LETTERDJ
-OPTIONS_DEFAULT=	CUPS_IMAGE A2PS_A4 ENSCRIPT_A4 MPAGE
+OPTIONS_DEFAULT=	CUPS_IMAGE A2PS ENSCRIPT_A4 MPAGE
 CUPS_IMAGE_DESC=	Install cups image utilities
-A2PS_A4_DESC=		Install a2ps convertor (A4)
-A2PS_LETTER_DESC=	Install a2ps convertor (letter)
-A2PS_LETTERDJ_DESC=	Install a2ps convertor (letterdj)
+A2PS_DESC=		Install a2ps convertor
 ENSCRIPT_A4_DESC=	Install enscript convertor (A4)
 ENSCRIPT_LETTER_DESC=	Install enscript convertor (letter)
 ENSCRIPT_LETTERDJ_DESC=	Install enscript convertor (letterdj)
@@ -50,18 +47,10 @@ MAN1=		foomatic-rip.1
 RUN_DEPENDS+=	${LOCALBASE}/lib/libcupsimage.so:${PORTSDIR}/print/cups-image
 .endif
 
-.if ${PORT_OPTIONS:MA2PS_A4}
+.if ${PORT_OPTIONS:MA2PS}
 RUN_DEPENDS+=	a2ps:${PORTSDIR}/print/a2ps-a4
 .endif
 
-.if ${PORT_OPTIONS:MA2PS_LETTER}
-RUN_DEPENDS+=	a2ps:${PORTSDIR}/print/a2ps-letter
-.endif
-
-.if ${PORT_OPTIONS:MA2PS-LETTERDJ}
-RUN_DEPENDS+=	a2ps:${PORTSDIR}/print/a2ps-letterdj
-.endif
-
 .if ${PORT_OPTIONS:MENSCRIPT_A4}
 RUN_DEPENDS+=	enscript:${PORTSDIR}/print/enscript-a4
 .endif

Modified: head/print/lprps/Makefile
==============================================================================
--- head/print/lprps-letter/Makefile	Tue Apr 23 05:11:57 2013	(r316307)
+++ head/print/lprps/Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,40 +1,21 @@
-# ex:ts=8
-# Ports collection makefile for:  lprps (letter)
-# Date created:			  Sat Aug 3, 1996
-# Whom:				  David O'Brien (obrien at cs.ucdavis.edu)
-#
+# Created by: David O'Brien <obrien at FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	lprps
 PORTVERSION=	2.5
 CATEGORIES=	print
 MASTER_SITES=	ftp://ftp.jclark.com/pub/lprps/
-PKGNAMESUFFIX=	-${PAPERSIZE}
 EXTRACT_SUFX=	.tar.Z
 
-MAINTAINER=	ports at FreeBSD.org
-COMMENT=	PostScript printer filter package supporting a bidirectional serial channel
+MAINTAINER=	hrs at FreeBSD.org
+COMMENT=	PostScript printer filter supporting a bidirectional serial channel
 
-MAKE_FLAGS?=	PAPERSIZE=${PS} -f
-PORTDOCS=	INSTALL
+LIB_DEPENDS=	paper:${PORTSDIR}/print/libpaper
 
+PORTDOCS=	INSTALL
 MAN1=		psrev.1 textps.1
 MAN8=		lprps.8 psif.8 psof.8
 
-PAPERSIZE?=	letter
-PS=		${PAPERSIZE:U}
-
-.if ${PAPERSIZE} != a4 && ${PAPERSIZE} != letter
-.BEGIN:
-	@${ECHO_MSG} "Error: invalid value for PAPERSIZE: \"${PAPERSIZE}\""
-	@${ECHO_MSG} "Possible values are:  a4 or letter"
-	@${FALSE}
-.endif
-
-post-patch:
-	${REINPLACE_CMD} -e 's/^\(CC[^g]*\)cc$$/\1${CC}/' ${WRKSRC}/Makefile
-
 do-install:
 	${MKDIR} ${DATADIR}
 	cd ${WRKSRC} && \
@@ -53,8 +34,5 @@ post-install:
 	${MKDIR} ${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
 .endif
-	@${ECHO_MSG} ""
-	@${ECHO_MSG} Now edit your /etc/printcap
-	@${ECHO_MSG} ""
 
 .include <bsd.port.mk>

Copied and modified: head/print/lprps/files/patch-Makefile (from r316307, head/print/lprps-letter/files/patch-aa)
==============================================================================
--- head/print/lprps-letter/files/patch-aa	Tue Apr 23 05:11:57 2013	(r316307, copy source)
+++ head/print/lprps/files/patch-Makefile	Sat Apr 27 16:00:26 2013	(r316672)
@@ -1,12 +1,12 @@
---- Makefile.orig	Wed Sep 11 03:08:08 1996
-+++ Makefile	Wed Sep 11 03:11:29 1996
+--- Makefile.orig	1993-02-22 21:45:50.000000000 +0900
++++ Makefile	2013-04-27 22:53:50.000000000 +0900
 @@ -3,21 +3,21 @@
  # Define IIg to enable a workaround for a bug in the serial
  # driver of the Laserwriter IIf and IIg; this requires the POSIX
  # tcdrain() function.  (I haven't tested this personally.)
 -DEFINES=-DA4 #-DIIg
 -PREFIX=/usr/local
-+DEFINES=-D$(PAPERSIZE)
++DEFINES=
  # Where to install public executables.
  BINDIR=$(PREFIX)/bin
  # Where to install private executables.
@@ -27,3 +27,33 @@
  # Filter to convert text to PostScript.  You can use your own instead.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-ports-head mailing list