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-r1.ebuild (-12 / +49 lines)
Lines 35-43 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()
Lines 56-65 Link Here
56
		dobin bin/$x
84
		dobin bin/$x
57
	done
85
	done
58
86
59
	dodir /usr/NX/etc
87
	dodir /etc/NX
60
	cp etc/node-debian.cfg.sample "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die
88
	dosym /etc/NX /usr/NX/etc
61
	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
62
	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
63
92
64
	dodir /usr/NX/lib
93
	dodir /usr/NX/lib
65
	cp -R lib "${D}"/usr/NX || die
94
	cp -R lib "${D}"/usr/NX || die
Lines 71-77 Link Here
71
	cp -R share "${D}"/usr/NX || die
100
	cp -R share "${D}"/usr/NX || die
72
101
73
	dodir /usr/NX/var
102
	dodir /usr/NX/var
74
	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
75
112
76
	dodir /etc/init.d
113
	dodir /etc/init.d
77
	newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor
114
	newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor
Lines 80-93 Link Here
80
pkg_postinst()
117
pkg_postinst()
81
{
118
{
82
	# Only install license file if none is found
119
	# Only install license file if none is found
83
	if [ ! -f /usr/NX/etc/node.lic ]; then
120
	if [ ! -f "${ROOT}"/etc/NX/node.lic ]; then
84
		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
85
		chmod 0400 "${ROOT}"/usr/NX/etc/node.lic
122
		chmod 0400 "${ROOT}"/etc/NX/node.lic
86
		chown nx:0 "${ROOT}"/usr/NX/etc/node.lic
123
		chown nx:0 "${ROOT}"/etc/NX/node.lic
87
	fi
124
	fi
88
125
89
	# only run install on the first time
126
	# only run install on the first time
90
	if [ -f /usr/NX/etc/node.cfg ]; then
127
	if [ -f "${ROOT}"/etc/NX/node.cfg ]; then
91
		einfo "Running NoMachine's update script"
128
		einfo "Running NoMachine's update script"
92
		"${ROOT}"/usr/NX/scripts/setup/nxnode --update
129
		"${ROOT}"/usr/NX/scripts/setup/nxnode --update
93
	else
130
	else
Lines 99-103 Link Here
99
	elog
136
	elog
100
	elog "  rc-update add nxsensor default"
137
	elog "  rc-update add nxsensor default"
101
	elog
138
	elog
102
	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"
103
}
140
}

Return to bug 318727