x2goserver-4.0.1.19-r2.ebuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. pkg_setup() {
  31. # Force the group creation, #479650
  32. enewgroup x2gouser
  33. enewgroup x2goprint
  34. enewuser x2gouser -1 -1 /var/lib/x2go x2gouser
  35. enewuser x2goprint -1 -1 /var/spool/x2goprint x2goprint
  36. }
  37. src_prepare() {
  38. # Do not install Xresources symlink (#521126)
  39. sed -e '\#$(INSTALL_SYMLINK) /etc/X11/Xresources# s/^/#/' -i x2goserver-xsession/Makefile || die "Xresources symlink sed failed"
  40. # Multilib clean
  41. sed -e "/^LIBDIR=/s/lib/$(get_libdir)/" -i Makefile */Makefile || die "multilib sed failed"
  42. # Skip man2html build
  43. sed -e "s/build-indep: build_man2html/build-indep:/" -i Makefile */Makefile || die "man2html sed failed"
  44. # Use nxagent directly
  45. sed -i -e "/NX_TEMP=/s/x2goagent/nxagent/" x2goserver/bin/x2gostartagent || die "sed failed"
  46. eapply "${FILESDIR}"/${P}-use_bash_in_Xsession.patch
  47. eapply_user
  48. }
  49. src_compile() {
  50. emake CC="$(tc-getCC)" PREFIX=/usr
  51. }
  52. src_install() {
  53. emake DESTDIR="${D}" PREFIX=/usr install
  54. fowners root:x2goprint /usr/bin/x2goprint
  55. fperms 2755 /usr/bin/x2goprint
  56. fperms 0750 /etc/sudoers.d
  57. fperms 0440 /etc/sudoers.d/x2goserver
  58. dosym /usr/share/applications /etc/x2go/applications
  59. newinitd "${FILESDIR}"/${PN}.init x2gocleansessions
  60. systemd_dounit "${FILESDIR}"/x2gocleansessions.service
  61. }
  62. pkg_postinst() {
  63. if use sqlite ; then
  64. elog "To use sqlite and create the initial database, run:"
  65. elog " # x2godbadmin --createdb"
  66. fi
  67. if use postgres ; then
  68. elog "To use a PostgreSQL database, more information is availabe here:"
  69. elog "http://www.x2go.org/doku.php/wiki:advanced:multi-node:x2goserver-pgsql"
  70. fi
  71. elog "For password authentication, you need to enable PasswordAuthentication"
  72. elog "in /etc/ssh/sshd_config (disabled by default in Gentoo)"
  73. elog "An init script was installed for x2gocleansessions"
  74. }