blockdpy-1-r1.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs
  5. DESCRIPTION="Tool to block access via the physical display while x11vnc is running"
  6. HOMEPAGE="http://www.karlrunge.com/x11vnc/blockdpy.c"
  7. SRC_URI="http://www.karlrunge.com/x11vnc/blockdpy.c"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE=""
  12. RDEPEND="
  13. x11-libs/libX11
  14. x11-libs/libXext"
  15. DEPEND="${RDEPEND}
  16. virtual/pkgconfig"
  17. S=${WORKDIR}
  18. src_unpack() {
  19. cp "${DISTDIR}"/blockdpy.c blockdpy.c || die
  20. }
  21. src_prepare() {
  22. default
  23. # Add includes to avoid QA warnings.
  24. sed -i '/#include <stdio.h>/i#include <stdlib.h>' blockdpy.c || die
  25. sed -i '/#include <stdio.h>/i#include <string.h>' blockdpy.c || die
  26. }
  27. src_compile() {
  28. $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \
  29. $($(tc-getPKG_CONFIG) --cflags x11) \
  30. $($(tc-getPKG_CONFIG) --cflags xext) \
  31. -o blockdpy blockdpy.c \
  32. $($(tc-getPKG_CONFIG) --libs x11) \
  33. $($(tc-getPKG_CONFIG) --libs xext) \
  34. || die "compile failed"
  35. # Create README from head comment in source.
  36. sed -n '1,/^ *\*\//s/^[ -]*\*[ \/]*//p' < blockdpy.c > README || die
  37. }
  38. src_install() {
  39. dobin blockdpy
  40. einstalldocs
  41. }
  42. pkg_postinst() {
  43. # Just warn about missing xlock instead of requiring it in case
  44. # the user wants to use something else.
  45. if [[ ! -x ${EPREFIX}/usr/bin/xlock ]]; then
  46. ewarn 'The xlock executable was not found.'
  47. ewarn 'blockdpy runs "xlock" as the screen-lock program by default.'
  48. ewarn 'You should either install x11-misc/xlockmore or override the'
  49. ewarn 'default by calling blockdpy with the -lock option or by'
  50. ewarn 'setting the XLOCK_CMD environment variable.'
  51. ewarn
  52. ewarn " Examples: blockdpy -lock 'xscreensaver-command -lock'"
  53. ewarn " blockdpy -lock 'kdesktop_lock --forcelock'"
  54. ewarn
  55. fi
  56. }