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

Collapse All | Expand All

(-)/usr/local/portage/app-admin/webmin/webmin-1.680.ebuild (-15 / +49 lines)
Lines 1-10 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
1
# Copyright 1999-2014 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
# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/webmin-1.680.ebuild,v 1.1 2014/05/01 16:30:09 hwoarang Exp $
3
# $Header: $
4
4
5
EAPI="3"
5
EAPI="4"
6
6
7
inherit eutils pam ssl-cert
7
inherit eutils pam ssl-cert systemd
8
8
9
DESCRIPTION="A web-based Unix systems administration interface"
9
DESCRIPTION="A web-based Unix systems administration interface"
10
HOMEPAGE="http://www.webmin.com/"
10
HOMEPAGE="http://www.webmin.com/"
Lines 18-24 Link Here
18
18
19
# NOTE: The ssl flag auto added by ssl-cert eclass is not used actually
19
# NOTE: The ssl flag auto added by ssl-cert eclass is not used actually
20
# because openssl is forced by dev-perl/Net-SSLeay
20
# because openssl is forced by dev-perl/Net-SSLeay
21
IUSE="minimal +ssl mysql postgres ldap"
21
IUSE="minimal +ssl mysql postgres ldap systemd"
22
22
23
# All the required perl modules can be found easily using (in Webmin's root src dir):
23
# All the required perl modules can be found easily using (in Webmin's root src dir):
24
# find . -name cpan_modules.pl -exec grep "::" {} \;
24
# find . -name cpan_modules.pl -exec grep "::" {} \;
Lines 42-48 Link Here
42
		ldap? ( dev-perl/perl-ldap )
42
		ldap? ( dev-perl/perl-ldap )
43
		dev-perl/XML-Generator
43
		dev-perl/XML-Generator
44
		dev-perl/XML-Parser
44
		dev-perl/XML-Parser
45
	)"
45
	)
46
	systemd? ( sys-apps/systemd )"
46
RDEPEND="${DEPEND}"
47
RDEPEND="${DEPEND}"
47
48
48
src_prepare() {
49
src_prepare() {
Lines 114-123 Link Here
114
		-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
115
		-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
115
		-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
116
		-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
116
		-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
117
		-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
118
		-e "s:%config%:${EROOT}etc/webmin/config:" \
117
		-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
119
		-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
118
		"${ED}etc/init.d/webmin" \
120
		"${ED}etc/init.d/webmin" \
119
		|| die "Failed to patch the webmin init file"
121
		|| die "Failed to patch the webmin init file"
120
122
123
	if use systemd ; then
124
		# Create the systemd service file and put the neccessary variables there
125
		systemd_newunit "${FILESDIR}"/webmin.service webmin.service
126
		sed -i \
127
			-e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
128
			-e "s:%pid%:${EROOT}var/run/webmin.pid:" \
129
			-e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
130
			-e "s:%config%:${EROOT}etc/webmin/config:" \
131
			-e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
132
			"${ED}$(_systemd_get_unitdir)/webmin.service" \
133
			|| die "Failed to patch the webmin systemd service file"
134
	fi
135
121
	# Setup pam
136
	# Setup pam
122
	pamd_mimic system-auth webmin auth account session
137
	pamd_mimic system-auth webmin auth account session
123
138
Lines 130-136 Link Here
130
pkg_preinst() {
145
pkg_preinst() {
131
	# First stop service if running so Webmin to not messup our config
146
	# First stop service if running so Webmin to not messup our config
132
	ebegin "Stopping any running Webmin instance prior merging"
147
	ebegin "Stopping any running Webmin instance prior merging"
133
	rc-service --ifexists -- webmin --ifstarted stop
148
	if systemd_is_booted ; then
149
		systemctl stop webmin.service 2>/dev/null
150
	else
151
		rc-service --ifexists -- webmin --ifstarted stop
152
	fi
134
	eend $?
153
	eend $?
135
}
154
}
136
155
Lines 147-153 Link Here
147
	ewarn "To avoid problems, please before using any module, look at its configuration options first."
166
	ewarn "To avoid problems, please before using any module, look at its configuration options first."
148
	ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
167
	ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
149
	ewarn
168
	ewarn
150
	elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
169
	if systemd_is_booted || use systemd ; then
170
		elog "- To make Webmin start at boot time, run: 'systemctl enable webmin.service'"
171
	else
172
		elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
173
	fi
151
	elog "- The default URL to connect to Webmin is: https://localhost:10000"
174
	elog "- The default URL to connect to Webmin is: https://localhost:10000"
152
	elog "- The default user that can login is: root"
175
	elog "- The default user that can login is: root"
153
	elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
176
	elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
Lines 156-178 Link Here
156
pkg_prerm() {
179
pkg_prerm() {
157
	# First stop service if running - we do not want Webmin to mess up config
180
	# First stop service if running - we do not want Webmin to mess up config
158
	ebegin "Stopping any running Webmin instance prior unmerging"
181
	ebegin "Stopping any running Webmin instance prior unmerging"
159
	rc-service --ifexists -- webmin --ifstarted stop
182
	if systemd_is_booted ; then
183
		systemctl stop webmin.service 2>/dev/null
184
	else
185
		rc-service --ifexists -- webmin --ifstarted stop
186
	fi
160
	eend $?
187
	eend $?
161
}
188
}
162
189
163
pkg_postrm() {
190
pkg_postrm() {
164
	ewarn
191
	# If removing webmin completely, remind the user for the Webmin's own cron jobs.
165
	ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
192
	if [[ ! ${REPLACED_BY_VERSION} ]]; then
166
	ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
193
		ewarn
167
	ewarn "To fix this just disable them if you intend to use Webmin again,"
194
		ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
168
	ewarn "OR delete them if not."
195
		ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
169
	ewarn
196
		ewarn "To fix this just disable them if you intend to use Webmin again,"
197
		ewarn "OR delete them if not."
198
		ewarn
199
	fi
170
}
200
}
171
201
172
pkg_config(){
202
pkg_config(){
173
	# First stop service if running
203
	# First stop service if running
174
	ebegin "Stopping any running Webmin instance"
204
	ebegin "Stopping any running Webmin instance"
175
	rc-service --ifexists -- webmin --ifstarted stop
205
	if systemd_is_booted ; then
206
		systemctl stop webmin.service 2>/dev/null
207
	else
208
		rc-service --ifexists -- webmin --ifstarted stop
209
	fi
176
	eend $?
210
	eend $?
177
211
178
	# Next set the default reset variable to 'none'
212
	# Next set the default reset variable to 'none'

Return to bug 511624