Update to cups-pdf-2.4.7 and include the cups-pdf email dispatch script.

With help from ajacoutot@.

ok jasper@
This commit is contained in:
bernd 2008-04-29 12:10:15 +00:00
parent 4cef9166f0
commit 9ea33ae747
8 changed files with 116 additions and 25 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.6 2007/09/15 21:36:44 merdely Exp $
# $OpenBSD: Makefile,v 1.7 2008/04/29 12:10:15 bernd Exp $
COMMENT= PDF backend for CUPS
DISTNAME= cups-pdf-2.4.2
PKGNAME= ${DISTNAME}p1
DISTNAME= cups-pdf-2.4.7
CATEGORIES= print
HOMEPAGE= http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
@ -19,22 +18,35 @@ PERMIT_DISTFILES_FTP= Yes
WANTLIB= c
RUN_DEPENDS= ::print/cups \
::print/ghostscript/gnu
::print/ghostscript/gnu \
::mail/p5-MIME-Lite \
::mail/p5-MIME-tools
NO_REGRESS= Yes
SUBST_VARS= TRUEPREFIX
do-build:
${CC} ${CFLAGS} -o ${WRKDIR}/bin/cups-pdf ${WRKDIR}/${DISTNAME}/src/cups-pdf.c
pre-install:
${SUBST_CMD} ${WRKBUILD}/extra/cups-pdf.conf
do-install:
${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/cups/backend
${INSTALL_DATA_DIR} ${PREFIX}/share/cups/model
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cups
${INSTALL_PROGRAM} ${WRKDIR}/bin/cups-pdf \
${PREFIX}/libexec/cups/backend/cups-pdf
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/extra/PostscriptColor.ppd \
${PREFIX}/share/cups/model/PostscriptColor.ppd
${INSTALL_SCRIPT} ${WRKBUILD}/contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch \
${PREFIX}/bin
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/extra/CUPS-PDF.ppd \
${PREFIX}/share/cups/model/
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/extra/cups-pdf.conf \
${PREFIX}/share/examples/cups/
${INSTALL_DATA} ${WRKBUILD}/contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch.conf \
${PREFIX}/share/examples/cups/
${INSTALL_DATA} ${WRKBUILD}/contrib/cups-pdf-dispatch-0.1/examples/cups-pdf-dispatch-ldap.conf \
${PREFIX}/share/examples/cups/
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (cups-pdf_2.4.2.tar.gz) = l7IaudyYZZv84X2pIe4nkA==
RMD160 (cups-pdf_2.4.2.tar.gz) = djEmjiCmzmzCVQEa+WmGUFl/Wwg=
SHA1 (cups-pdf_2.4.2.tar.gz) = P0XxcPhRsEwujV3Vz19JYKpSdOw=
SHA256 (cups-pdf_2.4.2.tar.gz) = HIYgGdC4HER3tzxG8TYTt3Bbx/x3ufZcxHotmguJhII=
SIZE (cups-pdf_2.4.2.tar.gz) = 33523
MD5 (cups-pdf_2.4.7.tar.gz) = Rvc1UzNoQt1nUh2hF7/Gfg==
RMD160 (cups-pdf_2.4.7.tar.gz) = 5CMuFfq7EE+zE9N6Z36jDvvf2dE=
SHA1 (cups-pdf_2.4.7.tar.gz) = 0BtP82cOCf5/nAMgfQ0f/8UqZzc=
SHA256 (cups-pdf_2.4.7.tar.gz) = EU0rHbSbNxJuL1lkBJs1ngvVrOGRoBk9pKdvYiLjFjQ=
SIZE (cups-pdf_2.4.7.tar.gz) = 34243

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-contrib_cups-pdf-dispatch-0_1_cups-pdf-dispatch,v 1.1 2008/04/29 12:10:15 bernd Exp $
The client's real username is useful to have.
--- contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch.orig Sat Apr 26 11:03:38 2008
+++ contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch Sat Apr 26 11:05:04 2008
@@ -129,7 +129,7 @@ sub hacked_encode_mimewords
### MAIN #######################################
-my( $filename, $username ) = @ARGV;
+my( $filename, $username, $remote_user ) = @ARGV;
my $file_basename = basename( $filename );
my $file_prettyname = $file_basename;
@@ -152,12 +152,12 @@ my $file_size;
}
my $file_link = sprintf( $LINK_FORMAT, $username, $file_basename );
-my $user_mailaddr = $GET_USER_MAILADDR_SUB->( $username );
+my $user_mailaddr = $GET_USER_MAILADDR_SUB->( $username, $remote_user );
unless( defined( $user_mailaddr ) ) {
warn "User $username has no e-mail address.\n";
exit 0
}
-my $user_realname = $GET_USER_REALNAME_SUB->( $username );
+my $user_realname = $GET_USER_REALNAME_SUB->( $username, $remote_user );
my $from_header = defined $FROM_REALNAME ?
hacked_encode_mimewords( $FROM_REALNAME ). '<'. $FROM_MAILADDR. '>' :

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-contrib_cups-pdf-dispatch-0_1_cups-pdf-dispatch_conf,v 1.1 2008/04/29 12:10:15 bernd Exp $
The client's real username is useful to have.
--- contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch.conf.orig Sat Apr 26 11:05:20 2008
+++ contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch.conf Sat Apr 26 11:06:08 2008
@@ -90,7 +90,7 @@
# $GET_USER_MAILADDR_SUB
# Reference to a function which converts username to e-mail address.
-# Arguments: username
+# Arguments: username, remote_user (useful if username doesn't exist locally)
# Returns: e-mail address
# $GET_USER_MAILADDR_SUB = sub{ $_[0]. '@'. hostname() };
# # (i.e. user@hostname)
@@ -98,7 +98,7 @@
# $GET_USER_REALNAME_SUB
# Reference to a function which converts username to user's realname (used
# when constructing To: header).
-# Arguments: username
+# Arguments: username, remote_user (useful if username doesn't exist locally)
# Returns: user's real name
# $GET_USER_REALNAME_SUB = sub{ (split( /,/, (getpwnam($_[0]))[6], 2 ))[0] };
# # (i.e. user's real name from gecos)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-extra_cups-pdf_conf,v 1.1 2008/04/29 12:10:15 bernd Exp $
--- extra/cups-pdf.conf.orig Sun Mar 23 22:37:20 2008
+++ extra/cups-pdf.conf Thu Apr 24 08:31:28 2008
@@ -241,7 +241,7 @@
## set this to an empty value to use no postprocessing
### Default: <empty>
-#PostProcessing
+#PostProcessing ${TRUEPREFIX}/bin/cups-pdf-dispatch
###########################################################################

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_cups-pdf_c,v 1.1.1.1 2006/10/03 14:21:42 mbalmer Exp $
--- src/cups-pdf.c.orig Sun May 14 14:51:17 2006
+++ src/cups-pdf.c Mon May 15 17:16:40 2006
@@ -146,11 +146,11 @@ void log_event(char type, char message[4
$OpenBSD: patch-src_cups-pdf_c,v 1.2 2008/04/29 12:10:15 bernd Exp $
--- src/cups-pdf.c.orig Sun Mar 23 22:47:57 2008
+++ src/cups-pdf.c Tue Apr 29 11:52:33 2008
@@ -161,11 +161,11 @@ static void log_event(short type, char message[], char
timestring[strlen(timestring)-1]='\0';
if (type == CPERROR)
@ -16,7 +16,7 @@ $OpenBSD: patch-src_cups-pdf_c,v 1.1.1.1 2006/10/03 14:21:42 mbalmer Exp $
if (detail != NULL) {
while (detail[strlen(detail)-1] == '\n')
detail[strlen(detail)-1]='\0';
@@ -568,7 +568,7 @@ int preparespoolfile(FILE *fpsrc, char *
@@ -593,7 +593,7 @@ static int preparespoolfile(FILE *fpsrc, char *spoolfi
}
else {
if (conf.label) {
@ -25,3 +25,12 @@ $OpenBSD: patch-src_cups-pdf_c,v 1.1.1.1 2006/10/03 14:21:42 mbalmer Exp $
snprintf(title, BUFSIZE, "job_%i-%s", job, buffer);
}
log_event(CPDEBUG, "title successfully retrieved", title);
@@ -807,7 +807,7 @@ int main(int argc, char *argv[]) {
log_event(CPDEBUG, "file mode set for user output", outfile);
if (strlen(conf.postprocessing)) {
- size=strlen(conf.postprocessing)+strlen(outfile)+strlen(passwd->pw_name)+strlen(argv[2])+3;
+ size=strlen(conf.postprocessing)+strlen(outfile)+strlen(passwd->pw_name)+strlen(argv[2])+4;
ppcall=calloc(size, sizeof(char));
if (ppcall == NULL)
log_event(CPERROR, "failed to allocate memory for postprocessing (non fatal)", NULL);

View File

@ -1,15 +1,15 @@
$OpenBSD: patch-src_cups-pdf_h,v 1.1.1.1 2006/10/03 14:21:42 mbalmer Exp $
--- src/cups-pdf.h.orig Sun May 14 14:51:10 2006
+++ src/cups-pdf.h Mon May 15 15:17:53 2006
@@ -67,9 +67,9 @@ struct {
void _set_defaults() {
$OpenBSD: patch-src_cups-pdf_h,v 1.2 2008/04/29 12:10:15 bernd Exp $
--- src/cups-pdf.h.orig Sun Mar 23 22:18:55 2008
+++ src/cups-pdf.h Thu Apr 24 08:15:07 2008
@@ -67,9 +67,9 @@ static struct {
static void _set_defaults() {
snprintf(conf.anondirname,BUFSIZE,"%s","/var/spool/cups-pdf/ANONYMOUS");
snprintf(conf.anonuser,BUFSIZE,"%s","nobody");
- snprintf(conf.ghostscript,BUFSIZE,"/usr/bin/gs");
+ snprintf(conf.ghostscript,BUFSIZE,"/usr/local/bin/gs");
snprintf(conf.gscall,BUFSIZE,"%s","%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=\"%s\" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c save pop -f %s");
snprintf(conf.gscall,BUFSIZE,"%s","%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=\"%s\" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f %s");
- snprintf(conf.grp,BUFSIZE,"%s","lp");
+ snprintf(conf.grp,BUFSIZE,"%s","_cups");
snprintf(conf.gstmp,BUFSIZE,"%s","/var/tmp");
snprintf(conf.gstmp,BUFSIZE,"%s","TMPDIR=/var/tmp");
snprintf(conf.log,BUFSIZE,"%s","/var/log/cups");
snprintf(conf.pdfver,BUFSIZE,"%s","1.4");

View File

@ -1,7 +1,11 @@
@comment $OpenBSD: PLIST,v 1.2 2007/07/03 23:37:25 jakemsr Exp $
@comment $OpenBSD: PLIST,v 1.3 2008/04/29 12:10:15 bernd Exp $
bin/cups-pdf-dispatch
@mode 0700
libexec/cups/backend/cups-pdf
@mode
share/cups/model/PostscriptColor.ppd
share/cups/model/CUPS-PDF.ppd
share/examples/cups/cups-pdf-dispatch-ldap.conf
share/examples/cups/cups-pdf-dispatch.conf
@sample ${SYSCONFDIR}/cups/cups-pdf-dispatch.conf
share/examples/cups/cups-pdf.conf
@sample ${SYSCONFDIR}/cups/cups-pdf.conf