x2goserver-4.0.1.19.ebuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils 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. x11-apps/xauth
  24. x11-apps/xhost
  25. x11-apps/xwininfo
  26. fuse? ( net-fs/sshfs )
  27. postgres? ( dev-perl/DBD-Pg )
  28. sqlite? ( dev-perl/DBD-SQLite )"
  29. pkg_setup() {
  30. # Force the group creation, #479650
  31. enewgroup x2gouser
  32. enewgroup x2goprint
  33. enewuser x2gouser -1 -1 /var/lib/x2go x2gouser
  34. enewuser x2goprint -1 -1 /var/spool/x2goprint x2goprint
  35. }
  36. src_prepare() {
  37. # Do not install Xresources symlink (#521126)
  38. sed -e '\#$(INSTALL_SYMLINK) /etc/X11/Xresources# s/^/#/' -i x2goserver-xsession/Makefile || die "Xresources symlink sed failed"
  39. # Multilib clean
  40. sed -e "/^LIBDIR=/s/lib/$(get_libdir)/" -i Makefile */Makefile || die "multilib sed failed"
  41. # Skip man2html build
  42. sed -e "s/build-indep: build_man2html/build-indep:/" -i Makefile */Makefile || die "man2html sed failed"
  43. # Use nxagent directly
  44. sed -i -e "/NX_TEMP=/s/x2goagent/nxagent/" x2goserver/bin/x2gostartagent || die "sed failed"
  45. }
  46. src_compile() {
  47. emake CC="$(tc-getCC)" PREFIX=/usr
  48. }
  49. src_install() {
  50. emake DESTDIR="${D}" PREFIX=/usr install
  51. fowners root:x2goprint /usr/bin/x2goprint
  52. fperms 2755 /usr/bin/x2goprint
  53. fperms 0750 /etc/sudoers.d
  54. fperms 0440 /etc/sudoers.d/x2goserver
  55. dosym /usr/share/applications /etc/x2go/applications
  56. newinitd "${FILESDIR}"/${PN}.init x2gocleansessions
  57. systemd_dounit "${FILESDIR}"/x2gocleansessions.service
  58. }
  59. pkg_postinst() {
  60. if use sqlite ; then
  61. elog "To use sqlite and create the initial database, run:"
  62. elog " # x2godbadmin --createdb"
  63. fi
  64. if use postgres ; then
  65. elog "To use a PostgreSQL database, more information is availabe here:"
  66. elog "http://www.x2go.org/doku.php/wiki:advanced:multi-node:x2goserver-pgsql"
  67. fi
  68. elog "For password authentication, you need to enable PasswordAuthentication"
  69. elog "in /etc/ssh/sshd_config (disabled by default in Gentoo)"
  70. elog "An init script was installed for x2gocleansessions"
  71. }