/[gentoo-x86]/net-misc/neatx/neatx-0.3.1_p59-r4.ebuild
Gentoo

Contents of /net-misc/neatx/neatx-0.3.1_p59-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Apr 26 12:25:42 2015 UTC (4 years, 11 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Remove masked for removal package

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/neatx/neatx-0.3.1_p59-r4.ebuild,v 1.4 2013/01/30 18:07:25 ago Exp $
4
5 EAPI=4
6
7 PYTHON_DEPEND="2"
8 inherit eutils autotools python user
9
10 DESCRIPTION="Google implementation of NX server"
11 HOMEPAGE="http://code.google.com/p/neatx/"
12 SRC_URI="mirror://gentoo/${P}.tar.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="amd64 ~ppc x86"
17 IUSE=""
18
19 DEPEND="dev-python/docutils"
20 RDEPEND="dev-python/pexpect
21 dev-python/simplejson
22 >=dev-python/pygtk-2.14
23 >=dev-python/pygobject-2.14:2
24 app-portage/portage-utils
25 media-fonts/font-misc-misc
26 media-fonts/font-cursor-misc
27 || ( net-analyzer/gnu-netcat
28 net-analyzer/netcat
29 net-analyzer/netcat6 )
30 net-misc/nx"
31
32 S=${WORKDIR}/${PN}
33
34 pkg_setup () {
35 # configure script looks for latest python2 only,
36 # no multiple versions support
37 python_set_active_version 2
38 python_pkg_setup
39
40 if [ -z "${NX_HOME_DIR}" ];
41 then
42 export NX_HOME_DIR=/var/lib/neatx/home
43 fi
44 enewuser nx -1 -1 ${NX_HOME_DIR}
45 }
46
47 src_prepare() {
48 epatch "${FILESDIR}"/${P}-use_libexecdir.patch
49
50 sed -i -e "s/rst2html]/rst2html.py]/" configure.ac \
51 || die "configure.ac sed failed"
52 sed -e "s#/lib/neatx#/neatx#" \
53 -e "/^docdir/s#\$(PACKAGE)#${PF}#" \
54 -e "s#-Werror##" \
55 -i Makefile.am \
56 || die "Makefile.am sed failed"
57 sed -e "/DATA_DIR =/s#/lib/neatx#/neatx#" \
58 -i lib/constants.py || die "constants.py sed failed"
59
60 eautoreconf
61
62 echo "#!/bin/sh" > autotools/py-compile
63 }
64
65 src_compile() {
66 default_src_compile
67 # Scripts are automatically generated, fix them here
68 python_convert_shebangs 2 src/nx*
69 }
70
71 src_install() {
72 emake install DESTDIR="${D}"
73 fperms 777 /var/lib/neatx/sessions
74 dodir ${NX_HOME_DIR}/.ssh
75 fowners nx:nx ${NX_HOME_DIR}
76 fowners nx:nx ${NX_HOME_DIR}/.ssh
77
78 insinto /etc
79 newins doc/neatx.conf.example neatx.conf
80
81 # nc or netcat6 or netcat?
82 if has_version net-analyzer/gnu-netcat; then
83 nc_path="/usr/bin/netcat"
84 elif has_version net-analyzer/netcat6; then
85 nc_path="/usr/bin/nc6"
86 else
87 nc_path="/usr/bin/nc"
88 fi
89 cat >> "${D}"/etc/neatx.conf << EOF
90
91 netcat-path = ${nc_path}
92 use-xsession = false
93 start-gnome-command = /etc/X11/Sessions/Gnome
94 EOF
95
96 insinto /usr/share/neatx
97 insopts -m 600 -o nx
98 newins extras/authorized_keys.nomachine authorized_keys.nomachine
99
100 insinto ${NX_HOME_DIR}/.ssh
101 insopts -m 600 -o nx
102 newins extras/authorized_keys.nomachine authorized_keys
103
104 # protect ssh key from getting clobbered by future upgrade (bug #339366)
105 echo "CONFIG_PROTECT=\"${NX_HOME_DIR}\"" > "${T}/60${PN}"
106 doenvd "${T}/60${PN}"
107 }
108
109 pkg_preinst () {
110 # preserve custom ssh key if present (bug #339366)
111 # CONFIG_PROTECT entry created above will only work for future emerges,
112 # not the current one (until bug #276345 gets fixed)
113 if [ -e "${ROOT}/${NX_HOME_DIR}/.ssh/authorized_keys" ] ; then
114 einfo "Preserving existing ssh key: ${NX_HOME_DIR}/.ssh/authorized_keys"
115 insinto ${NX_HOME_DIR}/.ssh
116 insopts -m 600 -o nx
117 newins "${ROOT}/${NX_HOME_DIR}/.ssh/authorized_keys" authorized_keys
118 fi
119 }
120
121 pkg_postinst () {
122 python_mod_optimize neatx
123
124 # Other NX servers ebuilds may have already created the nx account
125 # However they use different login shell/home directory paths
126 if [[ ${ROOT} == "/" ]]; then
127 usermod -s /usr/libexec/neatx/nxserver-login nx || die "Unable to set login shell of nx user!!"
128 usermod -d ${NX_HOME_DIR} nx || die "Unable to set home directory of nx user!!"
129 else
130 elog "If you had another NX server installed before, please make sure"
131 elog "the nx user account is correctly set to:"
132 elog " * login shell: /usr/libexec/neatx/nxserver-login"
133 elog " * home directory: ${NX_HOME_DIR}"
134 fi
135
136 if has_version net-misc/openssh[-pam]; then
137 elog ""
138 elog "net-misc/openssh was not built with PAM support"
139 elog "You will need to unlock the nx account by setting a password for it"
140 fi
141
142 elog "If you want to use the default su authentication (rather than ssh)"
143 elog "you must ensure that the nx user is a member of the wheel group."
144 elog "You can add it via \"usermod -a -G wheel nx\""
145 }
146
147 pkg_postrm() {
148 python_mod_cleanup neatx
149 }

  ViewVC Help
Powered by ViewVC 1.1.20