diff --git a/print/cups-pdf/Makefile b/print/cups-pdf/Makefile index d0f25b29a44..b3cfc3cd53a 100644 --- a/print/cups-pdf/Makefile +++ b/print/cups-pdf/Makefile @@ -1,10 +1,9 @@ -# $OpenBSD: Makefile,v 1.15 2013/03/11 11:37:53 espie Exp $ +# $OpenBSD: Makefile,v 1.16 2017/07/22 20:41:10 ajacoutot Exp $ COMMENT= PDF backend for CUPS -DISTNAME= cups-pdf-2.6.1 +DISTNAME= cups-pdf-3.0.1 CATEGORIES= print -REVISION= 0 HOMEPAGE= http://www.cups-pdf.de/ MASTER_SITES= ${HOMEPAGE}src/ @@ -13,14 +12,12 @@ DISTFILES= ${DISTNAME:S/pdf-/pdf_/}.tar.gz # GPLv2+ PERMIT_PACKAGE_CDROM= Yes -WANTLIB += c +WANTLIB += c cups -RUN_DEPENDS= print/ghostscript/gnu \ - mail/p5-MIME-Lite \ - mail/p5-MIME-tools +RUN_DEPENDS= print/ghostscript/gnu # package is only useful if cups is installed -RUN_DEPENDS += print/cups +RUN_DEPENDS += print/cups NO_TEST= Yes @@ -29,24 +26,21 @@ pre-configure: ${WRKSRC}/src/cups-pdf.h do-build: - cd ${WRKDIR} && \ - ${CC} ${CFLAGS} -o bin/cups-pdf ${WRKDIR}/${DISTNAME}/src/cups-pdf.c + cd ${WRKSRC} && \ + ${CC} ${CFLAGS} -I${LOCALBASE}/include -L${LOCALBASE}/lib \ + -lcups -o cups-pdf src/cups-pdf.c 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 \ + ${INSTALL_DATA_DIR} ${PREFIX}/share/{doc,examples}/cups-pdf + ${INSTALL_PROGRAM} ${WRKBUILD}/cups-pdf \ ${PREFIX}/libexec/cups/backend/cups-pdf - ${INSTALL_SCRIPT} ${WRKBUILD}/contrib/cups-pdf-dispatch-0.1/cups-pdf-dispatch \ - ${PREFIX}/bin - ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/extra/CUPS-PDF.ppd \ + ${INSTALL_DATA} ${WRKSRC}/extra/cups-pdf.conf \ + ${PREFIX}/share/examples/cups-pdf/ + ${INSTALL_DATA} ${WRKSRC}/extra/*.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/ + ${INSTALL_DATA} ${WRKSRC}/README \ + ${PREFIX}/share/doc/cups-pdf/ .include diff --git a/print/cups-pdf/distinfo b/print/cups-pdf/distinfo index 24dfa68cfef..69f1adaba31 100644 --- a/print/cups-pdf/distinfo +++ b/print/cups-pdf/distinfo @@ -1,2 +1,2 @@ -SHA256 (cups-pdf_2.6.1.tar.gz) = BOF+tWPc7qBI4aQ17cvPUvqlKI+F6DkM1k1wLttnRfE= -SIZE (cups-pdf_2.6.1.tar.gz) = 33315 +SHA256 (cups-pdf_3.0.1.tar.gz) = c4Zp7f9/FGn+XkESAth/k7oltF8zKmI/tgfUnFmqlTE= +SIZE (cups-pdf_3.0.1.tar.gz) = 29754 diff --git a/print/cups-pdf/patches/patch-extra_cups-pdf_conf b/print/cups-pdf/patches/patch-extra_cups-pdf_conf index 7ab23709dda..ebfce38ec96 100644 --- a/print/cups-pdf/patches/patch-extra_cups-pdf_conf +++ b/print/cups-pdf/patches/patch-extra_cups-pdf_conf @@ -1,17 +1,18 @@ -$OpenBSD: patch-extra_cups-pdf_conf,v 1.4 2012/04/11 17:29:50 ajacoutot Exp $ ---- extra/cups-pdf.conf.orig Tue Oct 4 18:44:54 2011 -+++ extra/cups-pdf.conf Wed Apr 11 19:17:59 2012 -@@ -40,7 +40,7 @@ +$OpenBSD: patch-extra_cups-pdf_conf,v 1.5 2017/07/22 20:41:10 ajacoutot Exp $ +Index: extra/cups-pdf.conf +--- extra/cups-pdf.conf.orig ++++ extra/cups-pdf.conf +@@ -48,7 +48,7 @@ ## root_squash! ### Default: /var/spool/cups-pdf/${USER} -#Out /var/spool/cups-pdf/${USER} +Out ${HOME} - ### Key: AnonDirName + ### Key: AnonDirName (config) ## ABSOLUTE path for anonymously created PDF files -@@ -180,9 +180,9 @@ - ### Key: Grp +@@ -188,9 +188,9 @@ + ### Key: Grp (config) ## group cups-pdf is supposed to run as - this will also be the gid for all ## created directories and log files -### Default: lp @@ -20,9 +21,9 @@ $OpenBSD: patch-extra_cups-pdf_conf,v 1.4 2012/04/11 17:29:50 ajacoutot Exp $ -#Grp lp +#Grp _cups - - ########################################################################### -@@ -220,9 +220,9 @@ + ### Key: AllowUnsafeOptions (config) + ## DON'T CHANGE THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING +@@ -236,9 +236,9 @@ ## location of GhostScript binary (gs) ## MacOSX: for using pstopdf (recommended) set this to /usr/bin/pstopdf ## or its proper location on your system @@ -32,9 +33,9 @@ $OpenBSD: patch-extra_cups-pdf_conf,v 1.4 2012/04/11 17:29:50 ajacoutot Exp $ -#GhostScript /usr/bin/gs +#GhostScript ${LOCALBASE}/bin/gs - ### Key: GSTmp + ### Key: GSTmp (config) ## location of temporary files during GhostScript operation -@@ -253,7 +253,7 @@ +@@ -269,7 +269,7 @@ ## set this to an empty value to use no postprocessing ### Default: diff --git a/print/cups-pdf/patches/patch-src_cups-pdf_h b/print/cups-pdf/patches/patch-src_cups-pdf_h index c5398bcd476..ba096566b9f 100644 --- a/print/cups-pdf/patches/patch-src_cups-pdf_h +++ b/print/cups-pdf/patches/patch-src_cups-pdf_h @@ -1,24 +1,25 @@ -$OpenBSD: patch-src_cups-pdf_h,v 1.4 2012/04/11 17:29:50 ajacoutot Exp $ ---- src/cups-pdf.h.orig Tue Oct 4 18:45:10 2011 -+++ src/cups-pdf.h Wed Apr 11 19:16:36 2012 -@@ -19,7 +19,7 @@ +$OpenBSD: patch-src_cups-pdf_h,v 1.5 2017/07/22 20:41:10 ajacoutot Exp $ +Index: src/cups-pdf.h +--- src/cups-pdf.h.orig ++++ src/cups-pdf.h +@@ -18,7 +18,7 @@ / they are reasonable for most systems. */ /* location of the configuration file */ --#define CPCONFIG "/etc/cups/cups-pdf.conf" -+#define CPCONFIG "${SYSCONFDIR}/cups/cups-pdf.conf" +-#define CP_CONFIG_PATH "/etc/cups" ++#define CP_CONFIG_PATH "${SYSCONFDIR}/cups" - -@@ -69,9 +69,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,"${LOCALBASE}/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 .setpdfwrite -f %s"); -- snprintf(conf.grp,BUFSIZE,"%s","lp"); -+ snprintf(conf.grp,BUFSIZE,"%s","_cups"); - snprintf(conf.gstmp,BUFSIZE,"%s","TMPDIR=/var/tmp"); - snprintf(conf.log,BUFSIZE,"%s","/var/log/cups"); - snprintf(conf.pdfver,BUFSIZE,"%s","1.4"); + /* --- DO NOT EDIT BELOW THIS LINE --- */ +@@ -57,9 +57,9 @@ struct { + } configData[] = { + { "AnonDirName", SEC_CONF|SEC_PPD, { "/var/spool/cups-pdf/ANONYMOUS" } }, + { "AnonUser", SEC_CONF|SEC_PPD, { "nobody" } }, +- { "GhostScript", SEC_CONF|SEC_PPD, { "/usr/bin/gs" } }, ++ { "GhostScript", SEC_CONF|SEC_PPD, { "${LOCALBASE}/bin/gs" } }, + { "GSCall", SEC_CONF|SEC_PPD, { "%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=\"%s\" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f %s" } }, +- { "Grp", SEC_CONF|SEC_PPD, { "lp" } }, ++ { "Grp", SEC_CONF|SEC_PPD, { "_cups" } }, + { "GSTmp", SEC_CONF|SEC_PPD, { "TMPDIR=/var/tmp" } }, + { "Log", SEC_CONF|SEC_PPD, { "/var/log/cups" } }, + { "PDFVer", SEC_CONF|SEC_PPD|SEC_LPOPT, { "1.4" } }, diff --git a/print/cups-pdf/pkg/PLIST b/print/cups-pdf/pkg/PLIST index 4ecdadefbd5..8c4583df20b 100644 --- a/print/cups-pdf/pkg/PLIST +++ b/print/cups-pdf/pkg/PLIST @@ -1,13 +1,13 @@ -@comment $OpenBSD: PLIST,v 1.5 2012/04/11 17:29:50 ajacoutot Exp $ -bin/cups-pdf-dispatch +@comment $OpenBSD: PLIST,v 1.6 2017/07/22 20:41:10 ajacoutot Exp $ +@extraunexec rm -rf /var/spool/cups-pdf/ @mode 0700 @bin libexec/cups/backend/cups-pdf @mode -share/cups/model/CUPS-PDF.ppd +share/cups/model/CUPS-PDF_noopt.ppd +share/cups/model/CUPS-PDF_opt.ppd +share/doc/cups-pdf/ +share/doc/cups-pdf/README share/doc/pkg-readmes/${FULLPKGNAME} -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 +share/examples/cups-pdf/ +share/examples/cups-pdf/cups-pdf.conf @sample ${SYSCONFDIR}/cups/cups-pdf.conf -@extraunexec rm -rf /var/spool/cups-pdf/ diff --git a/print/cups-pdf/pkg/README b/print/cups-pdf/pkg/README index 1a93f1aea19..6fc06c805ce 100644 --- a/print/cups-pdf/pkg/README +++ b/print/cups-pdf/pkg/README @@ -1,10 +1,13 @@ -$OpenBSD: README,v 1.1 2012/04/11 17:29:50 ajacoutot Exp $ +$OpenBSD: README,v 1.2 2017/07/22 20:41:10 ajacoutot Exp $ +----------------------------------------------------------------------- | Running ${FULLPKGNAME} on OpenBSD +----------------------------------------------------------------------- A PDF printer can be added using the following command: - # lpadmin -p pdfprinter -v cups-pdf:/ -m CUPS-PDF.ppd -E + # lpadmin -p pdfprinter -v cups-pdf:/ -m CUPS-PDF_opt.ppd -E Print outputs (i.e. PDF) will be stored under the user's home directory. + +Additional information can be found in: + ${PREFIX}/share/doc/cups-pdf/README