You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
70 lines
1.8 KiB
8 years ago
|
# Copyright 1999-2017 Gentoo Foundation
|
||
13 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
8 years ago
|
EAPI=6
|
||
|
|
||
13 years ago
|
inherit toolchain-funcs
|
||
|
|
||
10 years ago
|
DESCRIPTION="Tool to block access via the physical display while x11vnc is running"
|
||
13 years ago
|
HOMEPAGE="http://www.karlrunge.com/x11vnc/blockdpy.c"
|
||
|
SRC_URI="http://www.karlrunge.com/x11vnc/blockdpy.c"
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
|
IUSE=""
|
||
|
|
||
8 years ago
|
RDEPEND="
|
||
|
x11-libs/libX11
|
||
13 years ago
|
x11-libs/libXext"
|
||
8 years ago
|
DEPEND="${RDEPEND}
|
||
|
virtual/pkgconfig"
|
||
13 years ago
|
|
||
|
S=${WORKDIR}
|
||
|
|
||
|
src_unpack() {
|
||
8 years ago
|
cp "${DISTDIR}"/blockdpy.c blockdpy.c || die
|
||
|
}
|
||
|
|
||
|
src_prepare() {
|
||
|
default
|
||
13 years ago
|
|
||
|
# Add includes to avoid QA warnings.
|
||
8 years ago
|
sed -i '/#include <stdio.h>/i#include <stdlib.h>' blockdpy.c || die
|
||
|
sed -i '/#include <stdio.h>/i#include <string.h>' blockdpy.c || die
|
||
13 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
8 years ago
|
$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \
|
||
|
$($(tc-getPKG_CONFIG) --cflags x11) \
|
||
|
$($(tc-getPKG_CONFIG) --cflags xext) \
|
||
|
-o blockdpy blockdpy.c \
|
||
|
$($(tc-getPKG_CONFIG) --libs x11) \
|
||
|
$($(tc-getPKG_CONFIG) --libs xext) \
|
||
|
|| die "compile failed"
|
||
13 years ago
|
|
||
|
# Create README from head comment in source.
|
||
8 years ago
|
sed -n '1,/^ *\*\//s/^[ -]*\*[ \/]*//p' < blockdpy.c > README || die
|
||
13 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
8 years ago
|
dobin blockdpy
|
||
|
einstalldocs
|
||
13 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
# Just warn about missing xlock instead of requiring it in case
|
||
|
# the user wants to use something else.
|
||
8 years ago
|
if [[ ! -x ${EPREFIX}/usr/bin/xlock ]]; then
|
||
13 years ago
|
ewarn 'The xlock executable was not found.'
|
||
|
ewarn 'blockdpy runs "xlock" as the screen-lock program by default.'
|
||
|
ewarn 'You should either install x11-misc/xlockmore or override the'
|
||
|
ewarn 'default by calling blockdpy with the -lock option or by'
|
||
|
ewarn 'setting the XLOCK_CMD environment variable.'
|
||
|
ewarn
|
||
|
ewarn " Examples: blockdpy -lock 'xscreensaver-command -lock'"
|
||
|
ewarn " blockdpy -lock 'kdesktop_lock --forcelock'"
|
||
|
ewarn
|
||
|
fi
|
||
|
}
|