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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Aug 23 12:30:40 2012 UTC (7 years, 7 months ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Fix missing parts for libexecdir migration, thanks Damien Granger in bug #432274

(Portage version: 2.2.0_alpha122/cvs/Linux x86_64)

1 # Copyright 1999-2012 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-r3.ebuild,v 1.1 2012/08/21 13:34:00 voyageur Exp $
4
5 EAPI=4
6
7 PYTHON_DEPEND="2"
8 inherit eutils autotools python multilib 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 -i Makefile.am \
55 || die "Makefile.am sed failed"
56 sed -e "/DATA_DIR =/s#/lib/neatx#/neatx#" \
57 -i lib/constants.py || die "constants.py sed failed"
58
59 eautoreconf
60
61 echo "#!/bin/sh" > autotools/py-compile
62 }
63
64 src_compile() {
65 default_src_compile
66 # Scripts are automatically generated, fix them here
67 python_convert_shebangs 2 src/nx*
68 }
69
70 src_install() {
71 emake install DESTDIR="${D}"
72 fperms 777 /var/lib/neatx/sessions
73 dodir ${NX_HOME_DIR}/.ssh
74 fowners nx:nx ${NX_HOME_DIR}
75 fowners nx:nx ${NX_HOME_DIR}/.ssh
76
77 insinto /etc
78 newins doc/neatx.conf.example neatx.conf
79
80 # nc or netcat6 or netcat?
81 if has_version net-analyzer/gnu-netcat; then
82 nc_path="/usr/bin/netcat"
83 elif has_version net-analyzer/netcat6; then
84 nc_path="/usr/bin/nc6"
85 else
86 nc_path="/usr/bin/nc"
87 fi
88 cat >> "${D}"/etc/neatx.conf << EOF
89
90 netcat-path = ${nc_path}
91 use-xsession = false
92 start-gnome-command = /etc/X11/Sessions/Gnome
93 EOF
94
95 insinto /usr/share/neatx
96 insopts -m 600 -o nx
97 newins extras/authorized_keys.nomachine authorized_keys.nomachine
98
99 insinto ${NX_HOME_DIR}/.ssh
100 insopts -m 600 -o nx
101 newins extras/authorized_keys.nomachine authorized_keys
102
103 # protect ssh key from getting clobbered by future upgrade (bug #339366)
104 echo "CONFIG_PROTECT=\"${NX_HOME_DIR}\"" > "${T}/60${PN}"
105 doenvd "${T}/60${PN}"
106 }
107
108 pkg_preinst () {
109 # preserve custom ssh key if present (bug #339366)
110 # CONFIG_PROTECT entry created above will only work for future emerges,
111 # not the current one (until bug #276345 gets fixed)
112 if [ -e "${ROOT}/${NX_HOME_DIR}/.ssh/authorized_keys" ] ; then
113 einfo "Preserving existing ssh key: ${NX_HOME_DIR}/.ssh/authorized_keys"
114 insinto ${NX_HOME_DIR}/.ssh
115 insopts -m 600 -o nx
116 newins "${ROOT}/${NX_HOME_DIR}/.ssh/authorized_keys" authorized_keys
117 fi
118 }
119
120 pkg_postinst () {
121 python_mod_optimize neatx
122
123 # Other NX servers ebuilds may have already created the nx account
124 # However they use different login shell/home directory paths
125 if [[ ${ROOT} == "/" ]]; then
126 usermod -s /usr/$(get_libdir)/neatx/nxserver-login nx || die "Unable to set login shell of nx user!!"
127 usermod -d ${NX_HOME_DIR} nx || die "Unable to set home directory of nx user!!"
128 else
129 elog "If you had another NX server installed before, please make sure"
130 elog "the nx user account is correctly set to:"
131 elog " * login shell: /usr/$(get_libdir)/neatx/nxserver-login"
132 elog " * home directory: ${NX_HOME_DIR}"
133 fi
134
135 if has_version net-misc/openssh[-pam]; then
136 elog ""
137 elog "net-misc/openssh was not built with PAM support"
138 elog "You will need to unlock the nx account by setting a password for it"
139 fi
140
141 elog "If you want to use the default su authentication (rather than ssh)"
142 elog "you must ensure that the nx user is a member of the wheel group."
143 elog "You can add it via \"usermod -a -G wheel nx\""
144 }
145
146 pkg_postrm() {
147 python_mod_cleanup neatx
148 }

  ViewVC Help
Powered by ViewVC 1.1.20