Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2005 19:34:08 +0200 (CEST)
From:      Zahemszky Gabor <gabor@zahemszky.hu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/87397: incorrect use of PAPERSIZE make variable in some ports
Message-ID:  <200510131734.j9DHY8cF023908@zahemszky.hu>
Resent-Message-ID: <200510131840.j9DIeIJH038790@freefall.freebsd.org>

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

>Number:         87397
>Category:       ports
>Synopsis:       incorrect use of PAPERSIZE make variable in some ports
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 13 18:40:18 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Zahemszky Gabor
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD zahemszky.hu 5.4-STABLE FreeBSD 5.4-STABLE #0: Wed Sep 28 20:30:48 CEST 2005 root@Picasso.Zahemszky.HU:/usr/obj/usr/src/sys/PICASSO i386

	
>Description:

There are so many ports, which use some make variables to set a paper size. Eg:
ghostscript, mpage, psutils, teTex, dvips, etc.  Most of them use the
PAPERSIZE variable, but there are other variables. I think, it would be
better to use a general mechanism to do that.

>How-To-Repeat:
	egrep -R -e A4 -e PAPERSIZE -e PAGESIZE /usr/ports
>Fix:

I think, the correct method would be to all of them use a general variable, so:

a)
in print/ghostscript-{afpl,gpl,gnu}/Makefile, change these lines:
.if defined(A4)
into
.if ( defined(PAPERSIZE) && ${PAPERSIZE} == "a4" )
(and in the pre-everything:: rule, too).

b)
In the freshly committed print/lpr-wrapper port, there is a similar problem,
as in the ghostscript ports. It uses the A4 variable.  So the needed change
is the same as in ghostscript, change the:

.if defined(A4)
line into:
.if ( defined(PAPERSIZE) && ${PAPERSIZE} == "a4" )

c)
In print/mpage/Makefile, change the comment in the beginning, and add the
next line:
PAGESIZE?= ${PAPERSIZE}

d)
There is a hidden PAPERSIZE dependency in print/xfce4-print. In it, there
are these lines:

.if defined(WITH_LETTER)
CONFIGURE_ARGS+=--enable-letter
BUILD_DEPENDS+= a2ps:${PORTSDIR}/print/a2ps-letter
RUN_DEPENDS+=   a2ps:${PORTSDIR}/print/a2ps-letter
.else
CONFIGURE_ARGS+=--disable-letter
BUILD_DEPENDS+= a2ps:${PORTSDIR}/print/a2ps-a4
RUN_DEPENDS+=   a2ps:${PORTSDIR}/print/a2ps-a4
.endif

It would be better to use the next:

.if ( defined( PAPERSIZE ) && ${PAPERSIZE} == "a4" )
CONFIGURE_ARGS+=--disable-letter
BUILD_DEPENDS+= a2ps:${PORTSDIR}/print/a2ps-a4
RUN_DEPENDS+=   a2ps:${PORTSDIR}/print/a2ps-a4
.else
CONFIGURE_ARGS+=--enable-letter
BUILD_DEPENDS+= a2ps:${PORTSDIR}/print/a2ps-letter
RUN_DEPENDS+=   a2ps:${PORTSDIR}/print/a2ps-letter
.endif

In this way, if the user set the PAPERSIZE variable to a (in xfce4-print)
not-supported size (legal, letterdj, a3, etc), she get the US standard size
(and in the case of letterdj, it's more correct, than a4 would be)

===

I think, the best method would be to change all of these ports at the same
time - maybe with a comment in /usr/ports/UPDATING(?).
I hope, I found all of the paper size dependency in the ports.
>Release-Note:
>Audit-Trail:
>Unformatted:



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