1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="Tool to block access via the physical display while x11vnc is running"
9 HOMEPAGE="http://www.karlrunge.com/x11vnc/blockdpy.c"
10 SRC_URI="http://www.karlrunge.com/x11vnc/blockdpy.c"
14 KEYWORDS="~amd64 ~x86"
26 cp "${DISTDIR}"/blockdpy.c blockdpy.c || die
32 # Add includes to avoid QA warnings.
33 sed -i '/#include <stdio.h>/i#include <stdlib.h>' blockdpy.c || die
34 sed -i '/#include <stdio.h>/i#include <string.h>' blockdpy.c || die
38 $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \
39 $($(tc-getPKG_CONFIG) --cflags x11) \
40 $($(tc-getPKG_CONFIG) --cflags xext) \
41 -o blockdpy blockdpy.c \
42 $($(tc-getPKG_CONFIG) --libs x11) \
43 $($(tc-getPKG_CONFIG) --libs xext) \
44 || die "compile failed"
46 # Create README from head comment in source.
47 sed -n '1,/^ *\*\//s/^[ -]*\*[ \/]*//p' < blockdpy.c > README || die
56 # Just warn about missing xlock instead of requiring it in case
57 # the user wants to use something else.
58 if [[ ! -x ${EPREFIX}/usr/bin/xlock ]]; then
59 ewarn 'The xlock executable was not found.'
60 ewarn 'blockdpy runs "xlock" as the screen-lock program by default.'
61 ewarn 'You should either install x11-misc/xlockmore or override the'
62 ewarn 'default by calling blockdpy with the -lock option or by'
63 ewarn 'setting the XLOCK_CMD environment variable.'
65 ewarn " Examples: blockdpy -lock 'xscreensaver-command -lock'"
66 ewarn " blockdpy -lock 'kdesktop_lock --forcelock'"