1 |
# Created by: Mark Reidel <ports@mark.reidel.info> |
2 |
# $FreeBSD: head/print/cups-pdf/Makefile 410825 2016-03-11 11:53:42Z tijl $ |
3 |
# $MidnightBSD$ |
4 |
|
5 |
PORTNAME= cups-pdf |
6 |
PORTVERSION= 2.6.1 |
7 |
PORTREVISION= 3 |
8 |
CATEGORIES= print |
9 |
MASTER_SITES= http://www.cups-pdf.de/src/ \ |
10 |
http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/ |
11 |
DISTNAME= ${PORTNAME}_${PORTVERSION} |
12 |
|
13 |
MAINTAINER= ports@MidnightBSD.org |
14 |
COMMENT= Virtual printer for CUPS to produce PDF files |
15 |
|
16 |
LICENSE= gpl2 |
17 |
LICENSE_FILE= ${WRKSRC}/COPYING |
18 |
|
19 |
RUN_DEPENDS= ${LOCALBASE}/sbin/cupsd:${PORTSDIR}/print/cups |
20 |
|
21 |
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} |
22 |
|
23 |
USES= ghostscript:run |
24 |
|
25 |
OPTIONS_DEFINE= DOCS |
26 |
OPTIONS_DEFAULT= DOCS |
27 |
|
28 |
.include <bsd.mport.options.mk> |
29 |
|
30 |
SUBST_CMD= -e "s,\#GhostScript /usr/bin/gs,GhostScript ${LOCALBASE}/bin/gs," \ |
31 |
-e 's,\#GSTmp /var/tmp,GSTmp /tmp,' \ |
32 |
-e 's,\#Grp lp,Grp daemon,' \ |
33 |
-e 's,\#Spool /var/spool/cups-pdf/SPOOL,Spool /var/spool/cups-pdf,' |
34 |
|
35 |
.ifdef(PDF_VERSION) |
36 |
.if ${PDF_VERSION} == 1.2 |
37 |
.elif ${PDF_VERSION} == 1.3 |
38 |
.elif ${PDF_VERSION} == 1.4 |
39 |
.elif ${PDF_VERSION} == 1.5 |
40 |
.else |
41 |
BROKEN= Unsupported PDF-Version selected: ${PDF_VERSION} |
42 |
.endif |
43 |
SUBST_CMD+= -e "s,\#PDFVer 1.4,PDFVer ${PDF_VERSION}," |
44 |
.endif |
45 |
|
46 |
.ifdef(HOME_SUBDIR) |
47 |
SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out $${HOME}/${HOME_SUBDIR},' |
48 |
.else |
49 |
.ifdef(OUTPUT_DIRECTORY) |
50 |
SUBST_CMD+= -e 's,\#Out /var/spool/cups-pdf/$${USER},Out ${OUTPUT_DIRECTORY},' |
51 |
.endif |
52 |
.endif |
53 |
|
54 |
.ifdef(LOG_DIRECTORY) |
55 |
SUBST_CMD+= -e "s,\#Log /var/log/cups,Log ${LOG_DIRECTORY}," |
56 |
.endif |
57 |
|
58 |
pre-everything:: |
59 |
.if !defined(PDF_VERSION) || !defined(HOME_SUBDIR) || \ |
60 |
!defined(OUTPUT_DIRECTORY) || !defined(LOG_DIRECTORY) |
61 |
@${ECHO_MSG} "" |
62 |
@${ECHO_MSG} "You may use the following build options:" |
63 |
@${ECHO_MSG} "" |
64 |
.endif |
65 |
.if !defined(PDF_VERSION) |
66 |
@${ECHO_MSG} "PDF_VERSION=1.2|1.3|1.4|1.5 PDF-version of PDF-files produced" |
67 |
.endif |
68 |
.if !defined(HOME_SUBDIR) |
69 |
@${ECHO_MSG} "HOME_SUBDIR=<subdir> Place produced PDF-files in the" |
70 |
@${ECHO_MSG} " directory ~/<subdir>/" |
71 |
.endif |
72 |
.if !defined(OUTPUT_DIRECTORY) |
73 |
@${ECHO_MSG} "OUTPUT_DIRECTORY=<dir> Place produced PDF-files in the" |
74 |
@${ECHO_MSG} " directory <dir>/" |
75 |
.endif |
76 |
.if !defined(LOG_DIRECTORY) |
77 |
@${ECHO_MSG} "LOG_DIRECTORY=<dir> Place logfile into <dir>/cups-pdf_log" |
78 |
.endif |
79 |
|
80 |
post-configure: |
81 |
@${REINPLACE_CMD} ${SUBST_CMD} ${WRKSRC}/extra/cups-pdf.conf |
82 |
@${REINPLACE_CMD} -e \ |
83 |
's,CPCONFIG "/etc/cups/cups-pdf.conf",CPCONFIG "${PREFIX}/etc/cups/cups-pdf.conf",' \ |
84 |
${WRKSRC}/src/cups-pdf.h |
85 |
|
86 |
do-build: |
87 |
cd ${WRKSRC}/src; ${CC} ${CFLAGS} -o cups-pdf cups-pdf.c |
88 |
|
89 |
do-install: |
90 |
${MKDIR} ${STAGEDIR}${PREFIX}/libexec/cups/backend |
91 |
${INSTALL} ${WRKSRC}/src/cups-pdf ${STAGEDIR}${PREFIX}/libexec/cups/backend |
92 |
${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/cups/backend/cups-pdf |
93 |
${MKDIR} ${STAGEDIR}${PREFIX}/share/cups/model |
94 |
${INSTALL_DATA} ${WRKSRC}/extra/CUPS-PDF.ppd \ |
95 |
${STAGEDIR}${PREFIX}/share/cups/model/CUPS-PDF.ppd |
96 |
${MKDIR} ${STAGEDIR}${PREFIX}/etc/cups |
97 |
${MKDIR} ${STAGEDIR}${DOCSDIR} |
98 |
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}/ |
99 |
|
100 |
post-install: |
101 |
${INSTALL_DATA} ${WRKSRC}/extra/cups-pdf.conf \ |
102 |
${STAGEDIR}${PREFIX}/etc/cups/cups-pdf.conf.sample |
103 |
|
104 |
.include <bsd.port.mk> |