summaryrefslogtreecommitdiff
path: root/print/cups/Makefile
blob: 722bd352ff544e2c4aca06ce9403ec878b8bae8f (plain)
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
# $NetBSD: Makefile,v 1.30 2001/05/26 16:32:37 jlam Exp $

DISTNAME=		cups-${VERS}-source
PKGNAME=		cups-${VERS}
VERS=			1.1.8
WRKSRC=			${WRKDIR}/cups-${VERS}
CATEGORIES=		print
MASTER_SITES=		ftp://ftp.easysw.com/pub/cups/${VERS}/ \
			ftp://ftp2.easysw.com/pub/cups/${VERS}/ \
			ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/${VERS}/ \
			ftp://ftp.mpg.goe.ni.schule.de/pub/internet/printing/cups/${VERS}/ \
			ftp://ftp.ntua.gr/pub/gnu/cups/${VERS}/ \
			ftp://ftp.fisek.com.tr/pub/cups/${VERS}/
EXTRACT_SUFX=		.tar.bz2

MAINTAINER=		jlam@netbsd.org
HOMEPAGE=		http://www.cups.org/
COMMENT=		Common UNIX Printing System

CONFLICTS+=		LPRng-[0-9]* LPRng-core-[0-9]*

USE_GMAKE=		# defined
USE_LIBTOOL=		# defined
GNU_CONFIGURE=		# defined
CONFIGURE_ARGS+=	--sysconfdir=/etc
CONFIGURE_ARGS+=	--localstatedir=/var
CONFIGURE_ARGS+=	--with-docdir=${PREFIX}/share/doc/html/cups
CONFIGURE_ARGS+=	--enable-libtool-unsupported="${LIBTOOL}"

USE_SSL=		# defined
CONFIGURE_ARGS+=	--enable-ssl

.include "../../mk/bsd.prefs.mk"
.include "../../devel/zlib/buildlink.mk"
.include "../../graphics/jpeg/buildlink.mk"
.include "../../graphics/png/buildlink.mk"
.include "../../graphics/tiff/buildlink.mk"

.if defined(USE_PAM)
.include "../../security/PAM/buildlink.mk"
CONFIGURE_ARGS+=	--enable-pam
PLIST_SRC=		${PKGDIR}/PLIST.pam
PLIST_SRC+=		${PKGDIR}/PLIST
.else
CONFIGURE_ARGS+=	--disable-pam
PLIST_SRC=		${PKGDIR}/PLIST
.endif

CFLAGS+=		-I${BUILDLINK_INCDIR}
CXXFLAGS+=		-I${BUILDLINK_INCDIR}
LDFLAGS+=		-L${BUILDLINK_LIBDIR}

# CUPS_USER	username of the CUPS administrator
# CUPS_GROUP	group of the CUPS administrator
#
CUPS_USER?=		lp
CUPS_GROUP?=		sys

BUILD_DEFS+=		CUPS_USER CUPS_GROUP

.if ${OPSYS} == "NetBSD"
.if exists(/usr/sbin/user)
ADDUSER=		/usr/sbin/useradd
ADDGROUP=		/usr/sbin/groupadd
.else
DEPENDS+=		user>=20000313:../../sysutils/user
ADDUSER=		${LOCALBASE}/sbin/useradd
ADDGROUP=		${LOCALBASE}/sbin/groupadd
.endif
.elif ${OPSYS} == "SunOS"
ADDUSER=		useradd
ADDGROUP=		groupadd
.endif

DEINSTALL_FILE=		${WRKDIR}/DEINSTALL
INSTALL_FILE=		${WRKDIR}/INSTALL

DOCDIR=			${PREFIX}/share/doc/cups
EGDIR=			${PREFIX}/share/examples/cups

post-extract:
	cd ${WRKSRC}/conf; ${MV} -f cupsd.conf cupsd.conf.in

pre-configure: ${BUILDLINK_TARGETS}

post-build:
	${SED}	-e "s|@CUPS_USER@|${CUPS_USER}|g"			\
		-e "s|@CUPS_GROUP@|${CUPS_GROUP}|g"			\
		${WRKSRC}/conf/cupsd.conf.in > ${WRKSRC}/conf/cupsd.conf
	${SED}	-e "s|@PREFIX@|${PREFIX}|g"				\
		${FILESDIR}/cups.pam > ${WRKDIR}/cups.pam

pre-install:
	${SED}	-e "s|@CUPS_USER@|${CUPS_USER}|g"			\
		-e "s|@CUPS_GROUP@|${CUPS_GROUP}|g"			\
		-e "s|@CAT@|${CAT}|g"					\
		-e "s|@RM@|${RM}|g"					\
		-e "s|@RMDIR@|${RMDIR}|g"				\
		-e "s|@TRUE@|${TRUE}|g"					\
		${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
	${SED}	-e "s|@CUPS_USER@|${CUPS_USER}|g"			\
		-e "s|@CUPS_GROUP@|${CUPS_GROUP}|g"			\
		-e "s|@ADDUSER@|${ADDUSER}|g"				\
		-e "s|@ADDGROUP@|${ADDGROUP}|g"				\
		-e "s|@CAT@|${CAT}|g"					\
		-e "s|@CHGRP@|${CHGRP}|g"				\
		-e "s|@CHMOD@|${CHMOD}|g"				\
		-e "s|@CHOWN@|${CHOWN}|g"				\
		-e "s|@CP@|${CP}|g"					\
		-e "s|@GREP@|${GREP}|g"					\
		-e "s|@MKDIR@|${MKDIR}|g"				\
		-e "s|@RM@|${RM}|g"					\
		-e "s|@TOUCH@|${TOUCH}|g"				\
		${PKGDIR}/INSTALL > ${INSTALL_FILE}
	PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} PRE-INSTALL

post-install:
	${INSTALL_DATA_DIR} ${DOCDIR}
	for file in ENCRYPTION.txt LICENSE.txt README.txt; do		\
		${INSTALL_DATA} ${WRKSRC}/$${file} ${DOCDIR}/$${file};	\
	done
	${INSTALL_DATA_DIR} ${EGDIR}
	cd ${WRKSRC}/conf; ${INSTALL_DATA} *.conf mime.* ${EGDIR}
.if defined(USE_PAM)
	${INSTALL_DATA} ${WRKDIR}/cups.pam ${EGDIR}
.endif
	PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL

.include "../../mk/bsd.pkg.mk"