ports/55317: Fixes and enhancements for print/muttprint

Glenn Johnson gjohnson at srrc.ars.usda.gov
Wed Aug 6 18:30:06 UTC 2003


>Number:         55317
>Category:       ports
>Synopsis:       Fixes and enhancements for print/muttprint
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 06 11:30:03 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Glenn Johnson
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD node1.cluster.srrc.usda.gov 5.1-CURRENT FreeBSD 5.1-CURRENT #20: Mon Aug 4 10:42:53 CDT 2003 root at node1.cluster.srrc.usda.gov:/usr/obj/usr/src/sys/CLUSTER-FW i386


	
>Description:
        The attached patch fixes a couple of problems and adds some
        enhancements to the print/muttprint port.

	The following is fixed:
        - Muttprint will now look in the proper place for its global
	  configuration file.
        - Can now use the paper size set by default without having to
	  get it from a configuration file.
	
	The following enhancements were added:
        - Since PAPERSIZE is defined in the Makefile, use it for setting
	  the default paper size, for both the 'letter' and 'A4' cases.
        - Add a 'WITH_CUPS' knob to have muttprint use CUPS by default.
	  Added appropriate patches for this to work.
        - Add echoed messages to tell the installer about the PAPERSIZE
	  and WITH_CUPS knobs.

        The following changes were made to the port structure to quiet
        'portlint -A':
        - Use DOCSDIR macro in pkg-plist.
        - Use SITE_PERL to specify location to look for perl
	  dependencies.
>How-To-Repeat:
	
>Fix:

	

--- muttprint begins here ---
diff -ruN muttprint.orig/Makefile muttprint/Makefile
--- muttprint.orig/Makefile	Wed Aug  6 11:00:43 2003
+++ muttprint/Makefile	Wed Aug  6 13:10:38 2003
@@ -7,6 +7,7 @@
 
 PORTNAME=	muttprint
 PORTVERSION=	0.71
+PORTREVISION=	1
 CATEGORIES=	print mail
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	muttprint
@@ -14,16 +15,16 @@
 MAINTAINER=	obraun at FreeBSD.org
 COMMENT=	Utility to print mail for most any mail client
 
-.if !defined(PAPERSIZE)
-PAPERSIZE=	letter
-.endif
-
 RUN_DEPENDS=	latex:${PORTSDIR}/print/teTeX \
 		psnup:${PORTSDIR}/print/psutils-${PAPERSIZE} \
 		uncompface:${PORTSDIR}/mail/faces \
 		convert:${PORTSDIR}/graphics/ImageMagick \
-		${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Date/Parse.pm:${PORTSDIR}/devel/p5-TimeDate \
-		${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp
+		${SITE_PERL}/Date/Parse.pm:${PORTSDIR}/devel/p5-TimeDate \
+		${SITE_PERL}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp
+.if defined(WITH_CUPS)
+RUN_DEPENDS+=	cupstestppd:${PORTSDIR}/print/cups-lpr \
+		espgs:${PORTSDIR}/print/cups-pstoraster
+.endif
 
 USE_REINPLACE=	yes
 REINPLACE_ARGS=	-i ""
@@ -33,10 +34,26 @@
 MAN1=		muttprint.1
 MANCOMPRESSED=	yes
 
+.if !defined(PAPERSIZE)
+PAPERSIZE=	letter
+.endif
+
+.if defined(WITH_CUPS)
+PRINT_COMMAND=CUPS
+.else
+PRINT_COMMAND=lpr -P$$PRINTER
+.endif
+
 .if !defined(NOPORTDOCS)
 INSTALL_TARGET=install-with-doc
 .endif
 
+pre-everything::
+	@${ECHO}
+	@${ECHO} Set PAPERSIZE=A4 if you need that paper size.
+	@${ECHO} Set WITH_CUPS=yes if you want to use CUPS.
+	@${ECHO}
+
 post-patch:
 	@${RM} -f ${WRKSRC}/pics/*.orig
 	@${GUNZIP_CMD} ${WRKSRC}/doc/manpages/*/muttprint.1.gz
@@ -47,6 +64,19 @@
 		s|/usr/lib|${PREFIX}/lib|g' \
 			${WRKSRC}/doc/manpages/*/muttprint.1 \
 			${WRKSRC}/doc/manual/*/manual-*/*.html
+.if ${PAPERSIZE}==a4
+	@${REINPLACE_CMD} 's|%%PAPERSIZE%%|${PAPERSIZE:U}|' \
+		${WRKSRC}/muttprint
+.else
+	@${REINPLACE_CMD} 's|%%PAPERSIZE%%|${PAPERSIZE}|' \
+		${WRKSRC}/muttprint
+.endif
+	@${REINPLACE_CMD} 's|%%PRINT_COMMAND%%|${PRINT_COMMAND}| ; \
+		s|%%PREFIX%%|${PREFIX}|' \
+		${WRKSRC}/muttprint
+.if defined(WITH_CUPS)
+	@${REINPLACE_CMD} 's|lpr $$CUPS_OPTIONS|${PREFIX}/bin/lpr $$CUPS_OPTIONS|' ${WRKSRC}/muttprint
+.endif
 	@${GZIP_CMD} ${WRKSRC}/doc/manpages/*/muttprint.1
 
 .include <bsd.port.mk>
diff -ruN muttprint.orig/files/patch-ab muttprint/files/patch-ab
--- muttprint.orig/files/patch-ab	Wed Aug  6 11:00:43 2003
+++ muttprint/files/patch-ab	Wed Aug  6 12:30:30 2003
@@ -1,6 +1,35 @@
---- muttprint.orig	Sat Apr 26 19:18:18 2003
-+++ muttprint	Sat Apr 26 23:36:53 2003
-@@ -189,8 +189,8 @@
+
+$FreeBSD$
+
+--- muttprint.orig	Tue May 27 14:11:31 2003
++++ muttprint	Wed Aug  6 12:28:31 2003
+@@ -79,13 +79,13 @@
+ ######## 'private' Variablen für den Rest
+ %Config = (
+ 	PRINTER			=> 	'',
+-	PRINT_COMMAND	=>	'lpr -P$PRINTER',
++	PRINT_COMMAND	=>	'%%PRINT_COMMAND%%',
+ 	PENGUIN			=>	'on',
+ 	DUPLEX			=>	'off',
+ 	SPEED			=>	'30',
+ 	PAPERSAVE		=>	'off',
+ 	FONT			=>	'Latex',
+-	PAPER			=>	'A4',
++	PAPER			=>	'%%PAPERSIZE%%',
+ 	DEBUG			=>	'1',
+ 	REM_SIG			=>	'off',
+ 	REM_QUOTE		=>	'off',
+@@ -182,16 +182,16 @@
+ 	}
+ }
+ 
+-$Config{PAPER} = getPaperConfig ();
+-readConfig ("/etc/Muttprintrc", "$ENV{HOME}/.muttprintrc");
++#$Config{PAPER} = getPaperConfig ();
++readConfig ("%%PREFIX%%/etc/Muttprintrc", "$ENV{HOME}/.muttprintrc");
+ 
+ 
+ @print = readOpts ();
  
  if ($Config{'PENGUIN'} eq "on") {
  	my $sharedir = findCommonDir("share");
@@ -11,3 +40,12 @@
  			: "off";
  }
  
+@@ -1671,7 +1671,7 @@
+ Options:
+ 
+ PLEASE NOTICE: These options override the corresponding settings in 
+-~/.muttprintrc and /etc/Muttprintrc.
++~/.muttprintrc and %%PREFIX%%/etc/Muttprintrc.
+ 
+ -h, --help
+        This help.
diff -ruN muttprint.orig/pkg-plist muttprint/pkg-plist
--- muttprint.orig/pkg-plist	Wed Aug  6 11:00:43 2003
+++ muttprint/pkg-plist	Wed Aug  6 11:09:32 2003
@@ -1,48 +1,48 @@
 bin/muttprint
-%%PORTDOCS%%share/doc/muttprint/CHANGES
-%%PORTDOCS%%share/doc/muttprint/COPYING
-%%PORTDOCS%%share/doc/muttprint/INSTALL
-%%PORTDOCS%%share/doc/muttprint/README
-%%PORTDOCS%%share/doc/muttprint/README.es
-%%PORTDOCS%%share/doc/muttprint/README.Gnus
-%%PORTDOCS%%share/doc/muttprint/README.Latex
-%%PORTDOCS%%share/doc/muttprint/README.translations
-%%PORTDOCS%%share/doc/muttprint/manual-de/muttprint.html
-%%PORTDOCS%%share/doc/muttprint/manual-de/x15.html
-%%PORTDOCS%%share/doc/muttprint/manual-de/x23.html
-%%PORTDOCS%%share/doc/muttprint/manual-de/x196.html
-%%PORTDOCS%%share/doc/muttprint/manual-de/x703.html
-%%PORTDOCS%%share/doc/muttprint/manual-de.pdf
-%%PORTDOCS%%share/doc/muttprint/manual-en/muttprint.html
-%%PORTDOCS%%share/doc/muttprint/manual-en/x15.html
-%%PORTDOCS%%share/doc/muttprint/manual-en/x23.html
-%%PORTDOCS%%share/doc/muttprint/manual-en/x195.html
-%%PORTDOCS%%share/doc/muttprint/manual-en/x706.html
-%%PORTDOCS%%share/doc/muttprint/manual-en.pdf
-%%PORTDOCS%%share/doc/muttprint/manual-es/muttprint.html
-%%PORTDOCS%%share/doc/muttprint/manual-es/x15.html
-%%PORTDOCS%%share/doc/muttprint/manual-es/x23.html
-%%PORTDOCS%%share/doc/muttprint/manual-es/x191.html
-%%PORTDOCS%%share/doc/muttprint/manual-es/x650.html
-%%PORTDOCS%%share/doc/muttprint/manual-es.pdf
-%%PORTDOCS%%share/doc/muttprint/manual-it/muttprint.html
-%%PORTDOCS%%share/doc/muttprint/manual-it/x15.html
-%%PORTDOCS%%share/doc/muttprint/manual-it/x23.html
-%%PORTDOCS%%share/doc/muttprint/manual-it/x194.html
-%%PORTDOCS%%share/doc/muttprint/manual-it/x683.html
-%%PORTDOCS%%share/doc/muttprint/manual-it.pdf
-%%PORTDOCS%%share/doc/muttprint/manual-sl/muttprint.html
-%%PORTDOCS%%share/doc/muttprint/manual-sl/x15.html
-%%PORTDOCS%%share/doc/muttprint/manual-sl/x195.html
-%%PORTDOCS%%share/doc/muttprint/manual-sl/x23.html
-%%PORTDOCS%%share/doc/muttprint/manual-sl/x700.html
-%%PORTDOCS%%share/doc/muttprint/manual-sl.pdf
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-de
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-en
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-es
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-fr
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-it
-%%PORTDOCS%%share/doc/muttprint/sample-muttprintrc-si
+%%PORTDOCS%%%%DOCSDIR%%/CHANGES
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/README.es
+%%PORTDOCS%%%%DOCSDIR%%/README.Gnus
+%%PORTDOCS%%%%DOCSDIR%%/README.Latex
+%%PORTDOCS%%%%DOCSDIR%%/README.translations
+%%PORTDOCS%%%%DOCSDIR%%/manual-de/muttprint.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-de/x15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-de/x23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-de/x196.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-de/x703.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-de.pdf
+%%PORTDOCS%%%%DOCSDIR%%/manual-en/muttprint.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-en/x15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-en/x23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-en/x195.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-en/x706.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-en.pdf
+%%PORTDOCS%%%%DOCSDIR%%/manual-es/muttprint.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-es/x15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-es/x23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-es/x191.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-es/x650.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-es.pdf
+%%PORTDOCS%%%%DOCSDIR%%/manual-it/muttprint.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-it/x15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-it/x23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-it/x194.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-it/x683.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-it.pdf
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl/muttprint.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl/x15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl/x195.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl/x23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl/x700.html
+%%PORTDOCS%%%%DOCSDIR%%/manual-sl.pdf
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-de
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-en
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-es
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-fr
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-it
+%%PORTDOCS%%%%DOCSDIR%%/sample-muttprintrc-si
 share/muttprint/BabyTuX.eps
 share/muttprint/BabyTuX_color.eps
 share/muttprint/Beastie.eps
@@ -64,9 +64,9 @@
 share/muttprint/translations/translation-sv.pl
 @dirrm share/muttprint/translations
 @dirrm share/muttprint
-%%PORTDOCS%%@dirrm share/doc/muttprint/manual-de
-%%PORTDOCS%%@dirrm share/doc/muttprint/manual-en
-%%PORTDOCS%%@dirrm share/doc/muttprint/manual-es
-%%PORTDOCS%%@dirrm share/doc/muttprint/manual-it
-%%PORTDOCS%%@dirrm share/doc/muttprint/manual-sl
-%%PORTDOCS%%@dirrm share/doc/muttprint
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual-de
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual-en
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual-es
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual-it
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual-sl
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
--- muttprint ends here ---


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



More information about the freebsd-ports-bugs mailing list