blob: d7b3aa034e40f7eed7d5274fc290a0d17925c01d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
# Created by: Alan Eldridge <alane@geeksrus.net>
# $FreeBSD$
PORTNAME= cups
PORTVERSION= 1.7.2
DISTVERSIONSUFFIX= -source
#PORTREVISION= defined further
CATEGORIES= print
MASTER_SITES= http://www.cups.org/software/${DISTVERSION}/ \
EASYSW/${PORTNAME}/${DISTVERSION}
PKGNAMESUFFIX= ${CUPS_SUFFIX}${PKGNAMESUFFIX2}
MAINTAINER= ports@FreeBSD.org
COMMENT= Common UNIX Printing System: ${COMMENT2}
LICENSE= GPLv2
CONFLICTS= LPRng-[0-9]*
UNIQUENAME= ${PORTNAME}${PKGNAMESUFFIX}
USES+= gmake pkgconfig tar:bzip2
DESTDIRNAME= DSTROOT
GNU_CONFIGURE= yes
CFLAGS+= ${PTHREAD_CFLAGS}
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
DSOFLAGS= -Wl,-rpath,${PREFIX}/lib -L${PREFIX}/lib ${LDFLAGS}
CONFIGURE_ENV= DSOFLAGS="${DSOFLAGS}"
CONFIGURE_ARGS+= --localstatedir=/var \
--disable-gssapi \
--with-cups-user=${USERS} \
--with-cups-group=${GROUPS} \
--with-system-groups=${CUPSSYSGRP} \
--with-docdir=${DOCSDIR} \
--with-menudir=${DESKTOPDIR} \
--with-domainsocket=${CUPS_SOCKET} \
--with-cachedir=${CUPS_CACHEDIR} \
--with-pam-module="unix" \
--enable-ssl
CUPS_CACHEDIR?= /var/db/cups
CUPS_SPOOLDIR= /var/spool/cups
CUPS_SOCKET?= /var/run/cups.sock
CUPS_PDFTOPS?= ${LOCALBASE}/libexec/xpdf/pdftops
WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}
CUPSSYSGRP= wheel
# GROUPS/USERS does not work here
GROUPS= cups
USERS= cups
# UNIQUENAME must be set before bsd.port.pre.mk so OPTIONSFILE can be included
.if defined(CUPS_CLIENT)
PORTREVISION= 0
LICENSE= LGPL21
CUPS_SUFFIX= -client
OPTIONS_DEFINE= GNUTLS
.elif defined(CUPS_IMAGE)
PORTREVISION= 0
CUPS_SUFFIX= -image
LICENSE= LGPL21
OPTIONS_DEFINE= GNUTLS
.else
PORTREVISION= 1
CUPS_SUFFIX= -base
OPTIONS_DEFINE= GNUTLS LIBPAPER PHP PYTHON PAM DBUS LIBUSB XDG_OPEN AVAHI MDNSRESPONDER ICONS
OPTIONS_DEFAULT= LIBPAPER MDNSRESPONDER ICONS
NO_OPTIONS_SORT= yes
.endif
ICONS_DESC= Desktop icons
LIBUSB_DESC= USB support
XDG_OPEN_DESC= Build with XDG_OPEN as browser
.include <bsd.port.options.mk>
.if defined(CUPS_CLIENT)
COMMENT2= Library cups
INSTALL_WRKSRC= ${WRKSRC}/cups
PLIST= ${MASTERDIR}/pkg-plist.client
USES+= iconv
LDFLAGS+= ${ICONV_LIB}
USE_LDCONFIG= yes
PKGMESSAGE= ${NONEXISTENT}
DESCR= ${MASTERDIR}/pkg-descr.client
.elif defined(CUPS_IMAGE)
LIB_DEPENDS+= libcups.so:${PORTSDIR}/${PKGCATEGORY}/cups-client \
libjpeg.so:${PORTSDIR}/graphics/jpeg \
libpng15.so:${PORTSDIR}/graphics/png \
libtiff.so:${PORTSDIR}/graphics/tiff
# force build if old cups is installed.
BUILD_DEPENDS+= cups-client${PKGNAMESUFFIX2}>=${PORTVERSION}:${PORTSDIR}/${PKGCATEGORY}/cups-client
COMMENT2= Library cupsimage
INSTALL_WRKSRC= ${WRKSRC}/filter
PLIST= ${MASTERDIR}/pkg-plist.image
USE_LDCONFIG= yes
PKGMESSAGE= ${NONEXISTENT}
DESCR= ${MASTERDIR}/pkg-descr.image
.else
LIB_DEPENDS+= libcups.so:${PORTSDIR}/${PKGCATEGORY}/cups-client \
libcupsimage.so:${PORTSDIR}/${PKGCATEGORY}/cups-image
# force build if old cups is installed.
BUILD_DEPENDS+= cups-client${PKGNAMESUFFIX2}>=${PORTVERSION}:${PORTSDIR}/${PKGCATEGORY}/cups-client
BUILD_DEPENDS+= cups-image${PKGNAMESUFFIX2}>=${PORTVERSION}:${PORTSDIR}/${PKGCATEGORY}/cups-image
COMMENT2= Server
USE_RC_SUBR= cupsd
PLIST_SUB+= CACHEDIR="${CUPS_CACHEDIR}"
.if ${ARCH} == "ia64"
BROKEN= stack-protector not supported on ia64
.endif
.endif
.if defined(CUPS_OVERWRITE_BASE)
PLIST_SUB+= OVERWRITE=""
CONFIGURE_ARGS+= --with-printcap=/etc/printcap
.else
PLIST_SUB+= OVERWRITE="@comment "
CONFIGURE_ARGS+= --with-printcap=${PREFIX}/etc/printcap
.endif
.if ${PORT_OPTIONS:MGNUTLS}
CONFIGURE_ARGS+= --disable-openssl --enable-gnutls
LIB_DEPENDS+= libgcrypt.so:${PORTSDIR}/security/libgcrypt \
libgnutls.so:${PORTSDIR}/security/gnutls
.else
CONFIGURE_ARGS+= --disable-gnutls --enable-openssl
WITH_OPENSSL_HACK7= yes
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MPHP}
CONFIGURE_ARGS+= --with-php
USE_PHP= yes
USE_PHP_BUILD= yes
PLIST_SUB+= PHP=""
.else
CONFIGURE_ARGS+= --without-php
PLIST_SUB+= PHP="@comment "
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MPYTHON}
CONFIGURE_ARGS+= --with-python
USE_PYTHON= yes
.include "${PORTSDIR}/Mk/bsd.python.mk"
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MLIBPAPER}
CONFIGURE_ARGS+= --enable-libpaper
LIB_DEPENDS+= libpaper.so:${PORTSDIR}/print/libpaper
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MMDNSRESPONDER}
.if ${PORT_OPTIONS:MAVAHI}
IGNORE= You must select one and only one option to build for Zeroconf
.endif
LIB_DEPENDS+= libdns_sd.so:${PORTSDIR}/net/mDNSResponder
CONFIGURE_ARGS+= --with-dnssd-includes=${LOCALBASE}/include
PLIST_SUB+= MDNSRESPONDER="" DNSSD="@comment "
.elif !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MAVAHI}
CONFIGURE_ARGS+= --enable-avahi
LIB_DEPENDS+= libavahi-client.so:${PORTSDIR}/net/avahi-app
PLIST_SUB+= MDNSRESPONDER="@comment " DNSSD=""
.else
CONFIGURE_ARGS+= --disable-dnssd
CONFIGURE_ARGS+= --disable-avahi
PLIST_SUB+= MDNSRESPONDER="@comment " DNSSD="@comment "
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MPAM}
CONFIGURE_ARGS+= --enable-pam
PLIST_SUB+= WITH_PAMD=""
.else
CONFIGURE_ARGS+= --disable-pam
PLIST_SUB+= WITH_PAMD="@comment "
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MDBUS}
LIB_DEPENDS+= libdbus-1.so:${PORTSDIR}/devel/dbus
CONFIGURE_ARGS+= --enable-dbus
PLIST_SUB+= WITH_DBUS=""
.else
CONFIGURE_ARGS+= --disable-dbus
PLIST_SUB+= WITH_DBUS="@comment "
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MXDG_OPEN}
RUN_DEPENDS+= xdg-open:${PORTSDIR}/devel/xdg-utils
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MLIBUSB}
CPPFLAGS+= -I/usr/include
LDFLAGS+= -L/usr/lib
CONFIGURE_ARGS+= --enable-libusb
.else
CONFIGURE_ARGS+= --disable-libusb
.endif
.if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MICONS}
INSTALLS_ICONS= yes
CONFIGURE_ARGS+= --with-icondir=${PREFIX}/share/icons
PLIST_SUB+= WITH_ICONS=""
.else
PLIST_SUB+= WITH_ICONS="@comment "
.endif
CONFIGURE_ARGS+= LIBS="-lssp_nonshared"
.if ! defined(CUPS_CLIENT) && ! defined(CUPS_IMAGE)
SUB_FILES+= ulpt-cupsd.conf ulpt-cupsd.sh
.endif
post-patch:
.if ${ARCH} == "amd64"
@${REINPLACE_CMD} -e 's|@PIEFLAGS@||' ${WRKSRC}/Makedefs.in
.endif
.if ${PORT_OPTIONS:MMDNSRESPONDER}
@${REINPLACE_CMD} -e 's|Darwin|FreeBSD|' \
${WRKSRC}/backend/Makefile
.endif
.if ${PORT_OPTIONS:MXDG_OPEN}
@${REINPLACE_CMD} -e 's|htmlview|xdg-open|' ${WRKSRC}/desktop/cups.desktop.in
.endif
@${REINPLACE_CMD} -e '/SILENT/d' ${WRKSRC}/Makedefs.in
@${REINPLACE_CMD} -e 's|/etc/cups|${LOCALBASE}/etc/cups|g' ${WRKSRC}/man/*.man*
@${REINPLACE_CMD} -e 's|-lpthreads.*;|${PTHREAD_LIBS};|g' \
-e 's|/private/etc/pam.d|${LOCALBASE}/etc/pam.d|' \
-e 's|-D_LARGEFILE64_SOURCE||g' \
${WRKSRC}/${CONFIGURE_SCRIPT}
.if defined(CUPS_CLIENT)
@${REINPLACE_CMD} \
-e 's|cups test|cups|' \
-e 's|cups filter |cups |' \
-e 's|driver ppdc scheduler||' \
-e 's|$$.PHPDIR. $$.FONTS.||' \
${WRKSRC}/Makefile
.elif defined(CUPS_IMAGE)
@${REINPLACE_CMD} \
-e 's|cups test||' \
-e 's|cups filter |filter |' \
-e 's|driver ppdc scheduler||' \
-e 's|$$.PHPDIR. $$.FONTS.||' \
${WRKSRC}/Makefile
.else
@${REINPLACE_CMD} \
-e 's|cups test|test|' \
-e 's|cups filter driver|driver|' \
-e '/cd cups/d' \
-e 's|$$.INSTALL_SCRIPT. cups-config|echo skip: cups-config|' \
${WRKSRC}/Makefile
@${REINPLACE_CMD} \
-e 's|cups-config.$$.MAN1EXT. ||' \
${WRKSRC}/man/Makefile
.endif
.if ! ${PORT_OPTIONS:MLIBUSB}
@${REINPLACE_CMD} -e 's|xyes -o $$uname != Darwin||' ${WRKSRC}/configure
.endif
post-configure:
.if defined(CUPS_CLIENT)
@${REINPLACE_CMD} \
-e 's|filter .* templates||' \
${WRKSRC}/Makedefs
.elif defined(CUPS_IMAGE)
@${REINPLACE_CMD} \
-e 's|filter .* templates|filter|' \
${WRKSRC}/Makedefs
.else
@${REINPLACE_CMD} \
-e 's|filter backend|backend|' \
${WRKSRC}/Makedefs
.endif
.if !defined(CUPS_CLIENT)
pre-build:
${CP} -p ${LOCALBASE}/lib/libcups.a ${WRKSRC}/cups/
${CP} -p ${LOCALBASE}/lib/libcups.so ${WRKSRC}/cups/
${CP} -p ${LOCALBASE}/lib/libcups.so.2 ${WRKSRC}/cups/
.if !defined(CUPS_IMAGE)
${CP} -p ${LOCALBASE}/lib/libcupsimage.so ${WRKSRC}/filter/
${CP} -p ${LOCALBASE}/lib/libcupsimage.so.2 ${WRKSRC}/filter/
.endif
.endif
post-install:
.if defined(CUPS_CLIENT)
${INSTALL_SCRIPT} ${WRKSRC}/cups-config ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/cups/libcups.a ${STAGEDIR}${PREFIX}/lib
${INSTALL_MAN} ${WRKSRC}/man/cups-config.man ${STAGEDIR}${PREFIX}/man/man1/cups-config.1
.elif defined(CUPS_IMAGE)
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcupsimage.so.2
.else
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcupscgi.so.1
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcupsppdc.so.1
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcupsmime.so.1
.if ${PORT_OPTIONS:MGHOSTSCRIPT} || ${PORT_OPTIONS:MXPDF}
${INSTALL_PROGRAM} ${WRKSRC}/filter/pdftops ${STAGEDIR}${PREFIX}/libexec/cups/filter/
.endif
${LN} -sf lpr ${STAGEDIR}${PREFIX}/bin/lpr-cups
${MKDIR} ${STAGEDIR}${ETCDIR}/
.for f in cupsd.conf mime.convs mime.types snmp.conf
test -f ${STAGEDIR}${ETCDIR}/${f} && ${RM} -f ${STAGEDIR}${ETCDIR}/${f} || ${TRUE}
${INSTALL_DATA} ${WRKSRC}/conf/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor
@${MV} ${STAGEDIR}${ETCDIR}/cups-files.conf ${STAGEDIR}${ETCDIR}/cups-files.conf.sample
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKDIR}/ulpt-cupsd.conf ${STAGEDIR}${EXAMPLESDIR}/
${INSTALL_SCRIPT} ${WRKDIR}/ulpt-cupsd.sh ${STAGEDIR}${PREFIX}/sbin/
.endif
.include <bsd.port.mk>
|