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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Thu Jun 30 15:00:21 2011 UTC (8 years, 8 months ago) by ranger
Branch: MAIN
Changes since 1.3: +2 -2 lines
Marking neatx-0.3.1_p59-r2 ~ppc for bug 344043

(Portage version: 2.1.9.42/cvs/Linux ppc64)

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

  ViewVC Help
Powered by ViewVC 1.1.20