Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 318727 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/net-misc/nxnode/nxnode-3.4.0.16.ebuild (-12 / +50 lines)
Lines 35-48 Link Here
35
35
36
S=${WORKDIR}/NX
36
S=${WORKDIR}/NX
37
37
38
move_dir()
39
{
40
	if [[ -e $1 && ! -L $1 ]] ; then
41
		mkdir -p $2
42
		mv $1/* $2/
43
		rm -rf $1
44
	fi
45
}
46
47
pkg_setup() {
48
	if [ ! -h ${ROOT}/usr/NX/etc \
49
	    -o ! -h ${ROOT}/usr/NX/var/db \
50
	    -o ! -h ${ROOT}/usr/NX/var/log \
51
	    -o ! -h ${ROOT}/usr/NX/var/run \
52
	    -o ! -h ${ROOT}/usr/NX/home/nx ]; then
53
		ewarn
54
		ewarn "Collisions are expected here."
55
		ewarn "Use COLLISION_IGNORE=\"/usr/NX/var /usr/NX/home\" emerge ... for this package,"
56
		ewarn "or remove previous versions of nxnode and nxserver-freeedition first."
57
		ewarn
58
	fi
59
}
60
38
pkg_preinst()
61
pkg_preinst()
39
{
62
{
40
	enewuser nx -1 -1 /usr/NX/home/nx
63
	enewuser nx -1 -1 /var/lib/NX
64
	move_dir ${ROOT}/usr/NX/etc ${ROOT}/etc/NX
65
	move_dir ${ROOT}/usr/NX/var/db ${ROOT}/var/db/NX
66
	move_dir ${ROOT}/usr/NX/home/nx ${ROOT}/var/lib/NX
67
	move_dir ${ROOT}/usr/NX/var/log ${ROOT}/var/log/NX
68
	move_dir ${ROOT}/usr/NX/var/run ${ROOT}/var/run/NX
41
}
69
}
42
70
43
src_prepare()
71
src_prepare()
44
{
72
{
45
	epatch "${FILESDIR}"/nxnode-3.4.0-setup.patch
73
	epatch "${FILESDIR}"/nxnode-3.4.0-setup.patch
74
	epatch "${FILESDIR}"/nxnode.cups_path.patch
46
}
75
}
47
76
48
src_install()
77
src_install()
Lines 55-64 Link Here
55
		dobin bin/$x
84
		dobin bin/$x
56
	done
85
	done
57
86
58
	dodir /usr/NX/etc
87
	dodir /etc/NX
59
	cp etc/node-debian.cfg.sample "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die
88
	dosym /etc/NX /usr/NX/etc
60
	sed -e 's|COMMAND_FUSER = .*|COMMAND_FUSER = "/usr/bin/fuser"|;' -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die
89
	cp etc/node-debian.cfg.sample "${D}"/etc/NX/node-gentoo.cfg.sample || die
61
	cp etc/node.lic.sample "${D}"/usr/NX/etc/node.lic.sample || die
90
	sed -e 's|COMMAND_FUSER = .*|COMMAND_FUSER = "/usr/bin/fuser"|;' -i "${D}"/etc/NX/node-gentoo.cfg.sample || die
91
	cp etc/node.lic.sample "${D}"/etc/NX/node.lic.sample || die
62
92
63
	dodir /usr/NX/lib
93
	dodir /usr/NX/lib
64
	cp -R lib "${D}"/usr/NX || die
94
	cp -R lib "${D}"/usr/NX || die
Lines 70-76 Link Here
70
	cp -R share "${D}"/usr/NX || die
100
	cp -R share "${D}"/usr/NX || die
71
101
72
	dodir /usr/NX/var
102
	dodir /usr/NX/var
73
	cp -R var "${D}"/usr/NX || die
103
	dodir /usr/NX/home
104
	dodir /var/db/NX
105
	dosym /var/db/NX /usr/NX/var/db
106
	dodir /var/lib/NX
107
	dosym /var/lib/NX /usr/NX/home/nx
108
	dodir /var/log/NX
109
	dosym /var/log/NX /usr/NX/var/log
110
	dodir /var/run/NX
111
	dosym /var/run/NX /usr/NX/var/run
74
112
75
	dodir /etc/init.d
113
	dodir /etc/init.d
76
	newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor
114
	newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor
Lines 79-92 Link Here
79
pkg_postinst()
117
pkg_postinst()
80
{
118
{
81
	# Only install license file if none is found
119
	# Only install license file if none is found
82
	if [ ! -f /usr/NX/etc/node.lic ]; then
120
	if [ ! -f "${ROOT}"/etc/NX/node.lic ]; then
83
		cp "${ROOT}"/usr/NX/etc/node.lic.sample "${ROOT}"/usr/NX/etc/node.lic || die
121
		cp "${ROOT}"/etc/NX/node.lic.sample "${ROOT}"/etc/NX/node.lic || die
84
		chmod 0400 "${ROOT}"/usr/NX/etc/node.lic
122
		chmod 0400 "${ROOT}"/etc/NX/node.lic
85
		chown nx:0 "${ROOT}"/usr/NX/etc/node.lic
123
		chown nx:0 "${ROOT}"/etc/NX/node.lic
86
	fi
124
	fi
87
125
88
	# only run install on the first time
126
	# only run install on the first time
89
	if [ -f /usr/NX/etc/node.cfg ]; then
127
	if [ -f "${ROOT}"/etc/NX/node.cfg ]; then
90
		einfo "Running NoMachine's update script"
128
		einfo "Running NoMachine's update script"
91
		"${ROOT}"/usr/NX/scripts/setup/nxnode --update
129
		"${ROOT}"/usr/NX/scripts/setup/nxnode --update
92
	else
130
	else
Lines 98-102 Link Here
98
	elog
136
	elog
99
	elog "  rc-update add nxsensor default"
137
	elog "  rc-update add nxsensor default"
100
	elog
138
	elog
101
	elog "You will also need to change EnableSensor to 1 in /usr/NX/etc/node.cfg"
139
	elog "You will also need to change EnableSensor to 1 in /etc/NX/node.cfg"
102
}
140
}

Return to bug 318727