Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 611846
Collapse All | Expand All

(-)runit-2.1.2-r1.ebuild (-25 / +17 lines)
Lines 1-4 Link Here
1
# Copyright 1999-2016 Gentoo Foundation
1
# Copyright 1999-2017 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=6
4
EAPI=6
Lines 49-55 Link Here
49
	einstalldocs
49
	einstalldocs
50
	doman ../man/*.[18]
50
	doman ../man/*.[18]
51
51
52
dodir /etc/runit
52
	dodir /etc/runit
53
	exeinto /etc/runit
53
	exeinto /etc/runit
54
	doexe "${FILESDIR}"/ctrlaltdel
54
	doexe "${FILESDIR}"/ctrlaltdel
55
	newexe "${FILESDIR}"/1-${PV} 1
55
	newexe "${FILESDIR}"/1-${PV} 1
Lines 83-114 Link Here
83
			mv -f "${EROOT}"etc/sv "${EROOT}"etc/sv.bak || die
83
			mv -f "${EROOT}"etc/sv "${EROOT}"etc/sv.bak || die
84
			ewarn "${EROOT}etc/sv was moved to ${EROOT}etc/sv.bak"
84
			ewarn "${EROOT}etc/sv was moved to ${EROOT}etc/sv.bak"
85
		fi
85
		fi
86
		mv "${EROOT}"etc/runit/runsvdir/all "${EROOT}"etc/sv|| die
86
		mv "${EROOT}"etc/runit/runsvdir/all "${EROOT}"etc/sv || die
87
		ln -sf "${EROOT}"etc/sv "${EROOT}"etc/runit/runsvdir/all || die
87
		ln -snf ../../sv "${EROOT}"etc/runit/runsvdir/all || die
88
		cp -a "${EROOT}"etc/runit/runsvdir "${T}" || die
88
		cp -a "${EROOT}"etc/runit/runsvdir "${T}" || die
89
		touch "${T}"/make_var_service || die
89
		touch "${T}"/make_var_service || die
90
	fi
90
	fi
91
92
	if has_version '<sys-process/runit-2.1.2'; then
93
		pre_212=yes
94
	fi
91
}
95
}
92
96
93
default_config() {
97
default_config() {
94
	local sv="${EROOT}"etc/sv
98
	if [ ! -e "${EROOT}"etc/runit/runsvdir/current ]; then
95
	local service="${EROOT}"etc/service
99
		mkdir -p "${EROOT}"etc/runit/runsvdir/default || die
96
	mkdir -p "${service}" || die
100
		ln -snf default "${EROOT}"etc/runit/runsvdir/current || die
97
	for x in tty1 tty2 tty3 tty4 tty5 tty6; do
101
	fi
98
	ln -sf "${sv}"/getty-$x "${service}"/getty-$x || die
102
	ln -snf runit/runsvdir/current "${EROOT}"etc/service || die
99
	done
100
	einfo "The links to services runit will supervise are installed"
101
	einfo "in $service."
102
	einfo "If you need multiple runlevels, please see the documentation"
103
	einfo "for how to set them up."
104
	einfo
105
}
103
}
106
104
107
migrate_from_211() {
105
migrate_from_211() {
108
	# Create /etc/service and /var/service if requested
106
	# Create /etc/service and /var/service if requested
109
	if [ -e "${T}"/make_var_service ]; then
107
	if [ -e "${T}"/make_var_service ]; then
110
		ln -sf "${EROOT}"etc/runit/runsvdir/current "${EROOT}"etc/service || die
108
		ln -snf runit/runsvdir/current "${EROOT}"etc/service || die
111
		ln -sf "${EROOT}"etc/runit/runsvdir/current "${EROOT}"var/service || die
109
		ln -snf ../etc/runit/runsvdir/current "${EROOT}"var/service || die
112
	fi
110
	fi
113
	if [ -d "${T}"/runsvdir ]; then
111
	if [ -d "${T}"/runsvdir ]; then
114
		cp -a "${T}"/runsvdir "${EROOT}"etc/runit || die
112
		cp -a "${T}"/runsvdir "${EROOT}"etc/runit || die
Lines 116-127 Link Here
116
	return 0
114
	return 0
117
}
115
}
118
116
119
pkg_preinst() {
120
	if  has_version '<sys-process/runit-2.1.2'; then
121
		pre_212=yes
122
	fi
123
}
124
125
pkg_postinst() {
117
pkg_postinst() {
126
	if [[ -z $REPLACING_VERSIONS ]]; then
118
	if [[ -z $REPLACING_VERSIONS ]]; then
127
		default_config
119
		default_config
Lines 144-152 Link Here
144
136
145
	if [ -L "${EROOT}"etc/runit/runsvdir/all ]; then
137
	if [ -L "${EROOT}"etc/runit/runsvdir/all ]; then
146
		ewarn "${EROOT}etc/runit/runsvdir/all has moved to"
138
		ewarn "${EROOT}etc/runit/runsvdir/all has moved to"
147
		iewarn "${EROOT}etc/sv."
139
		ewarn "${EROOT}etc/sv."
148
		ewarn "Any symbolic links under ${EROOT}etc/runit/runsvdir"
140
		ewarn "Any symbolic links under ${EROOT}etc/runit/runsvdir"
149
		ewarn "which point to services through ../all should be updated to"
141
		ewarn "which point to services through ${EROOT}etc/runit/runsvdir/all should be updated to"
150
		ewarn "point to them through ${EROOT}etc/sv."
142
		ewarn "point to them through ${EROOT}etc/sv."
151
		ewarn "Once that is done, ${EROOT}etc/runit/runsvdir/all should be"
143
		ewarn "Once that is done, ${EROOT}etc/runit/runsvdir/all should be"
152
		ewarn "removed."
144
		ewarn "removed."

Return to bug 611846