From a1234f77d78fddcbe5970055b8cc807ad154a7b0 Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 26 Feb 2020 20:37:25 +0000 Subject: [PATCH] print/cups-pdf: Update to 3.0.1 Changelog: https://www.cups-pdf.de/changelog.shtml - Sort variables & improve style. - Prefix some local variables with an underscore. - Change the way PDF versions are handled (although the whole mechanism of changing a configuration file via custom port variables should probably be deprecated). --- print/cups-pdf/Makefile | 57 +++++++++++++++++++++------------------- print/cups-pdf/distinfo | 5 ++-- print/cups-pdf/pkg-plist | 5 ++-- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/print/cups-pdf/Makefile b/print/cups-pdf/Makefile index 8f9b6fd8e7ad..2bcda7b8193e 100644 --- a/print/cups-pdf/Makefile +++ b/print/cups-pdf/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= cups-pdf -PORTVERSION= 2.6.1 -PORTREVISION= 4 +DISTVERSION= 3.0.1 CATEGORIES= print MASTER_SITES= http://www.cups-pdf.de/src/ \ http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/ @@ -15,42 +14,43 @@ COMMENT= Virtual printer for CUPS to produce PDF files LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING +LIB_DEPENDS= libcups.so:print/cups RUN_DEPENDS= ${LOCALBASE}/sbin/cupsd:print/cups +USES= ghostscript:run localbase + +LIBS+= -lcups + +ETCDIR= ${PREFIX}/etc/cups + WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} -USES= ghostscript:run - OPTIONS_DEFINE= DOCS -SUBST_CMD= -e "s,\#GhostScript /usr/bin/gs,GhostScript ${LOCALBASE}/bin/gs," \ +_SUBST_CMD= -e "s,\#GhostScript /usr/bin/gs,GhostScript ${LOCALBASE}/bin/gs," \ -e 's,\#GSTmp /var/tmp,GSTmp /tmp,' \ -e 's,\#Grp lp,Grp daemon,' \ -e 's,\#Spool /var/spool/cups-pdf/SPOOL,Spool /var/spool/cups-pdf,' +_PDF_VERSIONS= 1.2 1.3 1.4 1.5 + .include .ifdef(PDF_VERSION) -.if ${PDF_VERSION} == 1.2 -.elif ${PDF_VERSION} == 1.3 -.elif ${PDF_VERSION} == 1.4 -.elif ${PDF_VERSION} == 1.5 -.else +.if "${_PDF_VERSIONS:M${PDF_VERSION}}" == "" BROKEN= Unsupported PDF-Version selected: ${PDF_VERSION} .endif -SUBST_CMD+= -e "s,\#PDFVer 1.4,PDFVer ${PDF_VERSION}," +_SUBST_CMD+= -e "s,\#PDFVer 1.4,PDFVer ${PDF_VERSION}," .endif .ifdef(HOME_SUBDIR) -SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out $${HOME}/${HOME_SUBDIR},' -.else -.ifdef(OUTPUT_DIRECTORY) -SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out ${OUTPUT_DIRECTORY},' -.endif +_SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out $${HOME}/${HOME_SUBDIR},' +.elifdef(OUTPUT_DIRECTORY) +_SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out ${OUTPUT_DIRECTORY},' .endif .ifdef(LOG_DIRECTORY) -SUBST_CMD+= -e "s,\#Log /var/log/cups,Log ${LOG_DIRECTORY}," +_SUBST_CMD+= -e "s,\#Log /var/log/cups,Log ${LOG_DIRECTORY}," .endif pre-everything:: @@ -61,7 +61,7 @@ pre-everything:: @${ECHO_MSG} "" .endif .if !defined(PDF_VERSION) - @${ECHO_MSG} "PDF_VERSION=1.2|1.3|1.4|1.5 PDF-version of PDF-files produced" + @${ECHO_MSG} "PDF_VERSION=${_PDF_VERSIONS:S/ /|/Wg} PDF-version of PDF-files produced" .endif .if !defined(HOME_SUBDIR) @${ECHO_MSG} "HOME_SUBDIR= Place produced PDF-files in the" @@ -76,25 +76,28 @@ pre-everything:: .endif post-configure: - @${REINPLACE_CMD} ${SUBST_CMD} ${WRKSRC}/extra/cups-pdf.conf + @${REINPLACE_CMD} ${_SUBST_CMD} ${WRKSRC}/extra/cups-pdf.conf @${REINPLACE_CMD} -e \ - 's,CPCONFIG "/etc/cups/cups-pdf.conf",CPCONFIG "${PREFIX}/etc/cups/cups-pdf.conf",' \ + 's,CPCONFIG "/etc/cups/cups-pdf.conf",CPCONFIG "${ETCDIR}/cups-pdf.conf",' \ ${WRKSRC}/src/cups-pdf.h do-build: - cd ${WRKSRC}/src && ${CC} ${CFLAGS} ${LDFLAGS} -o cups-pdf cups-pdf.c + (cd ${WRKSRC}/src && \ + ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} -o cups-pdf cups-pdf.c) do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/cups/backend - ${INSTALL_PROGRAM} ${WRKSRC}/src/cups-pdf ${STAGEDIR}${PREFIX}/libexec/cups/backend + ${INSTALL_PROGRAM} ${WRKSRC}/src/cups-pdf \ + ${STAGEDIR}${PREFIX}/libexec/cups/backend/ @${MKDIR} ${STAGEDIR}${PREFIX}/share/cups/model - ${INSTALL_DATA} ${WRKSRC}/extra/CUPS-PDF.ppd \ - ${STAGEDIR}${PREFIX}/share/cups/model/CUPS-PDF.ppd - @${MKDIR} ${STAGEDIR}${PREFIX}/etc/cups + ${INSTALL_DATA} ${WRKSRC}/extra/CUPS-PDF_opt.ppd \ + ${WRKSRC}/extra/CUPS-PDF_noopt.ppd \ + ${STAGEDIR}${PREFIX}/share/cups/model/ + @${MKDIR} ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${WRKSRC}/extra/cups-pdf.conf \ - ${STAGEDIR}${PREFIX}/etc/cups/cups-pdf.conf.sample + ${STAGEDIR}${ETCDIR}/cups-pdf.conf.sample -do-install-DOCS-on: +post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}/ diff --git a/print/cups-pdf/distinfo b/print/cups-pdf/distinfo index 8f12cb428f34..81dc7a582374 100644 --- a/print/cups-pdf/distinfo +++ b/print/cups-pdf/distinfo @@ -1,2 +1,3 @@ -SHA256 (cups-pdf_2.6.1.tar.gz) = 04e17eb563dceea048e1a435edcbcf52faa5288f85e8390cd64d702edb6745f1 -SIZE (cups-pdf_2.6.1.tar.gz) = 33315 +TIMESTAMP = 1582725313 +SHA256 (cups-pdf_3.0.1.tar.gz) = 738669edff7f1469fe5e411202d87f93ba25b45f332a623fb607d49c59aa9531 +SIZE (cups-pdf_3.0.1.tar.gz) = 29754 diff --git a/print/cups-pdf/pkg-plist b/print/cups-pdf/pkg-plist index 63651d811e69..35c0ed28db6f 100644 --- a/print/cups-pdf/pkg-plist +++ b/print/cups-pdf/pkg-plist @@ -1,6 +1,7 @@ +@sample %%ETCDIR%%/cups-pdf.conf.sample @mode 0700 libexec/cups/backend/cups-pdf @mode -share/cups/model/CUPS-PDF.ppd -@sample etc/cups/cups-pdf.conf.sample +share/cups/model/CUPS-PDF_opt.ppd +share/cups/model/CUPS-PDF_noopt.ppd %%PORTDOCS%%%%DOCSDIR%%/README