summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarri Nieminen <moikkis@gmail.com>2017-02-09 12:00:33 +0200
committerDavid Seifert <soap@gentoo.org>2017-02-09 22:52:48 +0100
commitb303a6babce18c69588b6fa76faf68f0653505c1 (patch)
tree3776c25ebae540540204b8b562989629d1501177 /x11-misc/blockdpy/blockdpy-1-r1.ebuild
parentx11-misc/dxpc: EAPI bump 0 -> 6 (diff)
downloadgentoo-b303a6babce18c69588b6fa76faf68f0653505c1.tar.gz
gentoo-b303a6babce18c69588b6fa76faf68f0653505c1.tar.bz2
gentoo-b303a6babce18c69588b6fa76faf68f0653505c1.zip
x11-misc/blockdpy: EAPI bump 0 -> 6
Package-Manager: Portage-2.3.3, Repoman-2.3.1 Closes: https://github.com/gentoo/gentoo/pull/3891
Diffstat (limited to 'x11-misc/blockdpy/blockdpy-1-r1.ebuild')
-rw-r--r--x11-misc/blockdpy/blockdpy-1-r1.ebuild70
1 files changed, 70 insertions, 0 deletions
diff --git a/x11-misc/blockdpy/blockdpy-1-r1.ebuild b/x11-misc/blockdpy/blockdpy-1-r1.ebuild
new file mode 100644
index 000000000000..f96d837aaa7e
--- /dev/null
+++ b/x11-misc/blockdpy/blockdpy-1-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Tool to block access via the physical display while x11vnc is running"
+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=""
+
+RDEPEND="
+ x11-libs/libX11
+ x11-libs/libXext"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${DISTDIR}"/blockdpy.c blockdpy.c || die
+}
+
+src_prepare() {
+ default
+
+ # Add includes to avoid QA warnings.
+ sed -i '/#include <stdio.h>/i#include <stdlib.h>' blockdpy.c || die
+ sed -i '/#include <stdio.h>/i#include <string.h>' blockdpy.c || die
+}
+
+src_compile() {
+ $(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"
+
+ # Create README from head comment in source.
+ sed -n '1,/^ *\*\//s/^[ -]*\*[ \/]*//p' < blockdpy.c > README || die
+}
+
+src_install() {
+ dobin blockdpy
+ einstalldocs
+}
+
+pkg_postinst() {
+ # Just warn about missing xlock instead of requiring it in case
+ # the user wants to use something else.
+ if [[ ! -x ${EPREFIX}/usr/bin/xlock ]]; then
+ 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
+}