summaryrefslogtreecommitdiff
path: root/x11/xlockmore/Makefile.common
blob: c9adf8c960065b12d3940c5ab89393a776789ec0 (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
# $NetBSD: Makefile.common,v 1.32 2005/09/11 16:55:38 hubertf Exp $
#
# This Makefile.common is included by:
#
#	x11/xlockmore/Makefile
#	x11/xlockmore-lite/Makefile
#
# If these packages are updated, please remember to reset any PKGREVISIONs
# in those Makefiles.

DISTNAME=       xlockmore-5.19
PKGREVISION=	2
CATEGORIES=	x11
MASTER_SITES=	ftp://ftp.tux.org/pub/tux/bagleyd/xlockmore/ \
		ftp://ibiblio.org/pub/Linux/X11/screensavers/ \
		${MASTER_SITE_XCONTRIB:=applications/}
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	hubertf@NetBSD.org
HOMEPAGE=	http://www.tux.org/~bagleyd/xlockmore.html

CONFLICTS+=	xlockmore-[0-9]* xlockmore-lite-[0-9]*

DISTINFO_FILE?=		${.CURDIR}/../xlockmore/distinfo
PATCHDIR?=		${.CURDIR}/../xlockmore/patches
PLIST_SRC?=		${.CURDIR}/../xlockmore/PLIST

PKG_INSTALLATION_TYPES=	overwrite pkgviews

PKG_OPTIONS_VAR=        PKG_OPTIONS.xlockmore
PKG_SUPPORTED_OPTIONS=  xlockmore-allow-root xlockmore-dpms
PKG_SUGGESTED_OPTIONS=  xlockmore-allow-root xlockmore-dpms
PKG_OPTIONS_LEGACY_VARS+=XLOCK_DISABLE_ALLOW_ROOT:-xlockmore-allow-root
PKG_OPTIONS_LEGACY_VARS+=XLOCK_NO_DPMS:-xlockmore-dpms
.include "../../mk/bsd.options.mk"

USE_LANGUAGES=		c c++
USE_X11BASE=		YES

.include "../../mk/bsd.prefs.mk"

XLOCK_SOUNDDIR=		${PREFIX}/lib/X11/xlock/sounds
XLOCK_MODULEDIR=	${PREFIX}/lib/X11/xlock/modules

DEFINES+=		-DDEF_MODULEPATH="\"${XLOCK_MODULEDIR}\""
CPPFLAGS+=		${DEFINES}
CXXFLAGS+=		${DEFINES}

GNU_CONFIGURE=		YES
CONFIGURE_ARGS+=        --without-motif
CONFIGURE_ARGS+=        --without-editres
CONFIGURE_ARGS+=        --without-dtsaver
CONFIGURE_ARGS+=        --without-rplay
CONFIGURE_ARGS+=        --without-nas
CONFIGURE_ARGS+=        --without-gtk

.if ${OPSYS} == "NetBSD"
.  if defined(USE_OSS)
.    include "../../audio/oss/buildlink3.mk"
XLOCK_AUDIOPLAY?=	${BUILDLINK_PREFIX.oss}/bin/ossplay
.  else
XLOCK_AUDIOPLAY?=	/usr/bin/audioplay
.  endif
CONFIGURE_ARGS+=	--enable-def-play="${XLOCK_AUDIOPLAY}"
.endif

.if empty(PKG_OPTIONS:Mxlockmore-dpms)
CONFIGURE_ARGS+=	--without-dpms
.endif

.if empty(PKG_OPTIONS:Mxlockmore-allow-root)
CONFIGURE_ARGS+=	--disable-allow-root
.endif

.include "../../mk/x11.buildlink3.mk"

# Set the complete paths to the sound files and set the default xlock
# mode/screensaver.
#
post-patch:
	cd ${WRKSRC}/xlock;						\
	${MV} -f XLock.ad XLock.ad.presed;				\
	${SED}	-e "s|/usr/lib/|${PREFIX}/lib/|g"			\
		XLock.ad.presed > XLock.ad;				\
	${RM} -f XLock.ad.presed
.if defined(XLOCK_DEFAULT_MODE) && !empty(XLOCK_DEFAULT_MODE)
	cd ${WRKSRC}/xlock;						\
	${MV} -f XLock.ad XLock.ad.presed;				\
	${SED} -e "s|^\(XLock.mode:[ 	]*\).*|\1${XLOCK_DEFAULT_MODE}|" \
		XLock.ad.presed > XLock.ad;				\
	${RM} -f XLock.ad.presed
.endif

post-install:
	${INSTALL_DATA_DIR} ${XLOCK_SOUNDDIR}
	cd ${WRKSRC}/sounds;						\
	for file in *.au; do						\
		${INSTALL_DATA} $$file ${XLOCK_SOUNDDIR};		\
	done