summaryrefslogtreecommitdiff
path: root/x11/xlockmore/Makefile
blob: b6d0d5c2a24868e0562df5bb1865fbe4cc5663ba (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
# New ports collection makefile for:	xlockmore
# Date created:		9 November 1994
# Whom:			smace
#
# $FreeBSD$
#

PORTNAME=	xlockmore
PORTVERSION=	5.24
CATEGORIES?=	x11
MASTER_SITES=	ftp://ftp.tux.org/pub/tux/bagleyd/xlockmore/ \
		http://www.tux.org/~bagleyd/latest/

MAINTAINER?=	ports@FreeBSD.org
COMMENT=	Like XLock session locker/screen saver, but just more

USE_BZIP2=	yes
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--without-gl --without-motif --without-sx \
		--without-editres --without-dtsaver --without-rplay \
		--without-nas --without-gtk --without-esound
.if defined(MAKE_KERBEROS4)
CONFIGURE_ARGS+=--enable-kerberos4
KRB4LIB=	-lcom_err -lcrypto
.endif
.if defined(KRB5_HOME) && exists(${KRB5_HOME})
CONFIGURE_ARGS+=--enable-kerberos5
CFLAGS+=	-I${KRB5_HOME}/include
KRB5LIB=	-L${KRB5_HOME}/lib
.endif
USE_GNOME=	#
USE_X_PREFIX=	yes
USE_XPM=	yes

MAN1=		xlock.1
PLIST_FILES=	bin/xlock lib/X11/app-defaults/XLock

OPTIONS=MESAGL			"Enable Mesa 3D (for GL modes)"		off \
	MB			"Enable Xmb function series"		off \
	SYSLOG			"Enable syslog logging"			off \
	DISABLE_ALLOW_ROOT	"Allows users to turn off allowroot"	off \
	NICE_ONLY		"Enable only low cpu modes"		off \
	BLANK_ONLY		"Enable blank mode only (boring)"	off \
	PAM			"Enable PAM authentication support"	off \
	BAD_PAM			"Xlock will ask PAM with root rights"	off \
	GTK2			"Build Gtk2 graphical shell"		off \
	XLOCK_GROUP		"Allow xlock group to logout"		off \
	TIME_BOMB		"Allow autologout"			off \
	CUSTOMIZATION		"Allow tune through resource file"	off

.include <bsd.port.pre.mk>

.if ${ARCH} == amd64
WITH_MESAGL=	no
.else
WITH_MESAGL?=	yes
.endif
.if ${WITH_MESAGL} == yes
CONFIGURE_ARGS+=	--with-mesa
MESALIB=${PTHREAD_LIBS}
USE_GL=	yes
.else
CONFIGURE_ARGS+=	--without-mesa --without-opengl
.endif

.if defined(WITH_NICE_ONLY)
CONFIGURE_ARGS+=	--enable-nice-only
.endif

.if defined(WITH_BAD_PAM)
CONFIGURE_ARGS+=	--enable-bad-pam
.endif

.if defined(WITH_PAM)
CONFIGURE_ARGS+=	--enable-pam
.if defined(WITH_XLOCK_GROUP)
BROKEN=			PAM and xlock group simultaneously breaks the build
.endif
.endif

.if defined(WITH_NICE_ONLY)
CONFIGURE_ARGS+=	--enable-nice-only
.endif

.if defined(WITH_BLANK_ONLY)
CONFIGURE_ARGS+=	--enable-blank-only
.endif

.if defined(WITH_MB)
CONFIGURE_ARGS+=	--enable-use-mb
.endif

.if defined(XLOCKMORE_LANG)
CONFIGURE_ARGS+=	--with-lang=${XLOCKMORE_LANG}
.endif

.if defined(WITH_SYSLOG)
CONFIGURE_ARGS+=	--enable-syslog
.endif

.if defined(WITH_GTK2)
CONFIGURE_ARGS+=	--with-gtk2
USE_GNOME+=	gtk20
PLIST_FILES+=	bin/xglock share/xlock/xglockrc
PLIST_DIRS+=	share/xlock
.else
CONFIGURE_ARGS+=	--without-gtk2
.endif

.if defined(WITH_XLOCK_GROUP)
CONFIGURE_ARGS+=	--enable-xlock-group
.if defined(WITH_PAM)
BROKEN=			PAM and xlock group simultaneously breaks the build
.endif
.endif

.if defined(WITH_TIME_BOMB)
CONFIGURE_ARGS+=	--enable-bomb
.else
CONFIGURE_ARGS+=	--disable-bomb
.endif

.if defined(WITH_CUSTOMIZATION)
CONFIGURE_ARGS+=	--enable-customization
.endif

CONFIGURE_ENV+=		XLOCKLIBS="${KRB5LIB} ${KRB4LIB} ${MESALIB}"

.if defined(WITH_DISABLE_ALLOW_ROOT)
CONFIGURE_ARGS+=	--disable-allow-root
.endif

.if defined(WITH_PAM) && !defined (WITH_BAD_PAM)
pre-extract:
	@${ECHO}
	@${ECHO} "You have enabled PAM support. If you want to authenticate against"
	@${ECHO} "root only accessible PAM modules then define WITH_BAD_PAM=yes also."
	@${ECHO} "For example, pam_unix requires root rights to access shadow passwords."
	@${ECHO}
.endif

post-patch:
	@${REINPLACE_CMD} -e '/xglockrc/ s|PROGRAM|DATA|' ${WRKSRC}/xglock/Makefile.in

post-configure:
	${REINPLACE_CMD} -e 's/-lXdpms//g' ${WRKSRC}/modes/Makefile

.include <bsd.port.post.mk>