x2goserver-4.0.1.19-r3.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit multilib systemd toolchain-funcs user
  5. DESCRIPTION="The X2Go server"
  6. HOMEPAGE="http://www.x2go.org"
  7. SRC_URI="http://code.x2go.org/releases/source/${PN}/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="+fuse postgres +sqlite"
  12. REQUIRED_USE="|| ( postgres sqlite )"
  13. DEPEND=""
  14. RDEPEND="dev-perl/Capture-Tiny
  15. dev-perl/Config-Simple
  16. dev-perl/File-BaseDir
  17. dev-perl/File-ReadBackwards
  18. dev-perl/File-Which
  19. media-fonts/font-cursor-misc
  20. media-fonts/font-misc-misc[nls]
  21. >=net-misc/nx-3.5.0.25
  22. net-misc/openssh
  23. >=sys-apps/iproute2-4.3.0
  24. x11-apps/xauth
  25. x11-apps/xhost
  26. x11-apps/xwininfo
  27. fuse? ( net-fs/sshfs )
  28. postgres? ( dev-perl/DBD-Pg )
  29. sqlite? ( dev-perl/DBD-SQLite )"
  30. PATCHES=(
  31. "${FILESDIR}"/${P}-use_bash_in_Xsession.patch
  32. "${FILESDIR}"/${P}-remove_sshfs_cipher.patch
  33. )
  34. pkg_setup() {
  35. # Force the group creation, #479650
  36. enewgroup x2gouser
  37. enewgroup x2goprint
  38. enewuser x2gouser -1 -1 /var/lib/x2go x2gouser
  39. enewuser x2goprint -1 -1 /var/spool/x2goprint x2goprint
  40. }
  41. src_prepare() {
  42. # Do not install Xresources symlink (#521126)
  43. sed -e '\#$(INSTALL_SYMLINK) /etc/X11/Xresources# s/^/#/' -i x2goserver-xsession/Makefile || die "Xresources symlink sed failed"
  44. # Multilib clean
  45. sed -e "/^LIBDIR=/s/lib/$(get_libdir)/" -i Makefile */Makefile || die "multilib sed failed"
  46. # Skip man2html build
  47. sed -e "s/build-indep: build_man2html/build-indep:/" -i Makefile */Makefile || die "man2html sed failed"
  48. # Use nxagent directly
  49. sed -i -e "/NX_TEMP=/s/x2goagent/nxagent/" x2goserver/bin/x2gostartagent || die "sed failed"
  50. default
  51. }
  52. src_compile() {
  53. emake CC="$(tc-getCC)" PREFIX=/usr
  54. }
  55. src_install() {
  56. emake DESTDIR="${D}" PREFIX=/usr install
  57. fowners root:x2goprint /usr/bin/x2goprint
  58. fperms 2755 /usr/bin/x2goprint
  59. fperms 0750 /etc/sudoers.d
  60. fperms 0440 /etc/sudoers.d/x2goserver
  61. dosym /usr/share/applications /etc/x2go/applications
  62. newinitd "${FILESDIR}"/${PN}.init x2gocleansessions
  63. systemd_dounit "${FILESDIR}"/x2gocleansessions.service
  64. }
  65. pkg_postinst() {
  66. if use sqlite ; then
  67. elog "To use sqlite and create the initial database, run:"
  68. elog " # x2godbadmin --createdb"
  69. fi
  70. if use postgres ; then
  71. elog "To use a PostgreSQL database, more information is availabe here:"
  72. elog "http://www.x2go.org/doku.php/wiki:advanced:multi-node:x2goserver-pgsql"
  73. fi
  74. elog "For password authentication, you need to enable PasswordAuthentication"
  75. elog "in /etc/ssh/sshd_config (disabled by default in Gentoo)"
  76. elog "An init script was installed for x2gocleansessions"
  77. }