Gentoo Archives: gentoo-commits

From: "Markos Chandras (hwoarang)" <hwoarang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/webmin: webmin-1.590.ebuild ChangeLog
Date: Mon, 09 Jul 2012 18:13:07
Message-Id: 20120709181247.C961A20065@flycatcher.gentoo.org
1 hwoarang 12/07/09 18:12:47
2
3 Modified: ChangeLog
4 Added: webmin-1.590.ebuild
5 Log:
6 Version bump. Bug #425066. Thanks to PhobosK <phobosk@××××××××.fm>
7
8 (Portage version: 2.1.11.5/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.195 app-admin/webmin/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?rev=1.195&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?rev=1.195&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/ChangeLog?r1=1.194&r2=1.195
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v
20 retrieving revision 1.194
21 retrieving revision 1.195
22 diff -u -r1.194 -r1.195
23 --- ChangeLog 24 Jan 2012 20:54:42 -0000 1.194
24 +++ ChangeLog 9 Jul 2012 18:12:47 -0000 1.195
25 @@ -1,6 +1,12 @@
26 # ChangeLog for app-admin/webmin
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v 1.194 2012/01/24 20:54:42 hwoarang Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/ChangeLog,v 1.195 2012/07/09 18:12:47 hwoarang Exp $
30 +
31 +*webmin-1.590 (09 Jul 2012)
32 +
33 + 09 Jul 2012; Markos Chandras <hwoarang@g.o> +webmin-1.590.ebuild,
34 + files/init.d.webmin:
35 + Version bump. Bug #425066. Thanks to PhobosK <phobosk@××××××××.fm>
36
37 *webmin-1.580 (24 Jan 2012)
38
39 @@ -28,4 +34,3 @@
40 +files/gentoo-setup, +files/init.d.webmin, +metadata.xml:
41 Re-introduce webmin. Thanks to Dell'Aica Valentino <elettronik@×××××.com> and
42 PhobosK <phobosk@××××××××.fm> for the ebuilds. This fixes bug #348432
43 -
44
45
46
47 1.1 app-admin/webmin/webmin-1.590.ebuild
48
49 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.590.ebuild?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webmin/webmin-1.590.ebuild?rev=1.1&content-type=text/plain
51
52 Index: webmin-1.590.ebuild
53 ===================================================================
54 # Copyright 1999-2012 Gentoo Foundation
55 # Distributed under the terms of the GNU General Public License v2
56 # $Header: /var/cvsroot/gentoo-x86/app-admin/webmin/webmin-1.590.ebuild,v 1.1 2012/07/09 18:12:47 hwoarang Exp $
57
58 EAPI="3"
59
60 inherit eutils pam ssl-cert
61
62 DESCRIPTION="A web-based Unix systems administration interface"
63 HOMEPAGE="http://www.webmin.com/"
64 SRC_URI="minimal? ( mirror://sourceforge/webadmin/${P}-minimal.tar.gz )
65 !minimal? ( mirror://sourceforge/webadmin/${P}.tar.gz )"
66
67 LICENSE="BSD"
68 SLOT="0"
69
70 KEYWORDS="~amd64 ~x86"
71
72 # NOTE: The ssl flag auto added by ssl-cert eclass is not used actually
73 # because openssl is forced by dev-perl/Net-SSLeay
74 IUSE="minimal +ssl mysql postgres ldap"
75
76 # All the required perl modules can be found easily using (in Webmin's root src dir):
77 # find . -name cpan_modules.pl -exec grep "::" {} \;
78 # NOTE: If Webmin doesn't find the required perl modules, it offers(runtime) the user
79 # to install them using the in-built cpan module, and this will mess up perl on the system
80 # That's why some modules are forced without a use flag
81 # NOTE: pam and ssl deps are forced for security and Gentoo compliance installation reasons
82 DEPEND="virtual/perl-Sys-Syslog
83 virtual/perl-Time-HiRes
84 virtual/perl-Time-Local
85 dev-perl/Authen-Libwrap
86 dev-perl/IO-Tty
87 dev-perl/MD5
88 dev-perl/Net-SSLeay
89 dev-perl/Authen-PAM
90 dev-perl/Sys-Hostname-Long
91 !minimal? (
92 mysql? ( dev-perl/DBD-mysql )
93 postgres? ( dev-perl/DBD-Pg )
94 ldap? ( dev-perl/perl-ldap )
95 dev-perl/XML-Generator
96 dev-perl/XML-Parser
97 )"
98 RDEPEND="${DEPEND}"
99
100 src_prepare() {
101 local perl="$( which perl )"
102
103 # Remove the unnecessary and incompatible files
104 rm -rf acl/Authen-SolarisRBAC-0.1*
105 if ! use minimal ; then
106 rm -rf {format,{bsd,hpux,sgi}exports,zones,rbac}
107 rm -f mount/{free,net,open}bsd-mounts*
108 rm -f mount/macos-mounts*
109 fi
110
111 # For security reasons remove the SSL certificate that comes with Webmin
112 # We will create our own later
113 rm -f miniserv.pem
114
115 # Remove the Webmin setup scripts to avoid Webmin in runtime to mess up config
116 # We will use our own later
117 rm -f setup.{sh,pl}
118
119 # Fix the permissions of the install files
120 chmod -R og-w "${S}"
121
122 # Since we should not modify any files after install
123 # we set the perl path in all cgi and pl files here using Webmin's routines
124 # The pl file is Prefix safe and works only on provided input, no other filesystem files
125 ebegin "Fixing perl path in source files"
126 (find "${S}" -name '*.cgi' -print ; find "${S}" -name '*.pl' -print) | $perl "${S}"/perlpath.pl $perl -
127 eend $?
128 }
129
130 src_install() {
131 # Create config dir and keep
132 diropts -m0755
133 dodir /etc/webmin
134 keepdir /etc/webmin
135
136 # Create install dir
137 # Third party modules installed through Webmin go here too, so keep
138 dodir /usr/libexec/webmin
139 keepdir /usr/libexec/webmin
140
141 # Copy our own setup script to installation folder
142 insinto /usr/libexec/webmin
143 newins "${FILESDIR}"/gentoo-setup gentoo-setup.sh
144 fperms 0744 /usr/libexec/webmin/gentoo-setup.sh
145
146 # This is here if we ever want in future ebuilds to add some specific
147 # config values in the /etc/webmin/miniserv.conf
148 # The format of this file should be the same as the one of miniserv.conf:
149 # var=value
150 #
151 # Uncomment it if you use such file. Before that check if upstream
152 # has this file in root dir too.
153 #newins "${FILESDIR}/miniserv-conf" miniserv-conf
154
155 # Create the log dir and keep
156 diropts -m0700
157 dodir /var/log/webmin
158 keepdir /var/log/webmin
159
160 # Create the init.d file and put the neccessary variables there
161 newinitd "${FILESDIR}"/init.d.webmin webmin
162 sed -i \
163 -e "s:%exe%:${EROOT}usr/libexec/webmin/miniserv.pl:" \
164 -e "s:%pid%:${EROOT}var/run/webmin.pid:" \
165 -e "s:%conf%:${EROOT}etc/webmin/miniserv.conf:" \
166 -e "s:%perllib%:${EROOT}usr/libexec/webmin:" \
167 "${ED}etc/init.d/webmin" \
168 || die "Failed to patch the webmin init file"
169
170 # Setup pam
171 pamd_mimic system-auth webmin auth account session
172
173 # Copy files to installation folder
174 ebegin "Copying install files to destination"
175 cp -pPR "${S}"/* "${ED}usr/libexec/webmin"
176 eend $?
177 }
178
179 pkg_preinst() {
180 # First stop service if running so Webmin to not messup our config
181 ebegin "Stopping any running Webmin instance prior merging"
182 rc-service --ifexists -- webmin --ifstarted stop
183 eend $?
184 }
185
186 pkg_postinst() {
187 # Run pkg_config phase first - non interactively
188 export INTERACTIVE="no"
189 pkg_config
190 # Every next time pkg_config should be interactive
191 INTERACTIVE="yes"
192
193 ewarn
194 ewarn "Bare in mind that not all Webmin modules are Gentoo tweaked and may have some issues."
195 ewarn "Always be careful when using modules that modify init entries, do update of webmin, install CPAN modules etc."
196 ewarn "To avoid problems, please before using any module, look at its configuration options first."
197 ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
198 ewarn
199 elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
200 elog "- The default URL to connect to Webmin is: https://localhost:10000"
201 elog "- The default user that can login is: root"
202 elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
203 }
204
205 pkg_prerm() {
206 # First stop service if running - we do not want Webmin to mess up config
207 ebegin "Stopping any running Webmin instance prior unmerging"
208 rc-service --ifexists -- webmin --ifstarted stop
209 eend $?
210 }
211
212 pkg_postrm() {
213 ewarn
214 ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
215 ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
216 ewarn "To fix this just disable them if you intend to use Webmin again,"
217 ewarn "OR delete them if not."
218 ewarn
219 }
220
221 pkg_config(){
222 # First stop service if running
223 ebegin "Stopping any running Webmin instance"
224 rc-service --ifexists -- webmin --ifstarted stop
225 eend $?
226
227 # Next set the default reset variable to 'none'
228 # reset/_reset can be:
229 # 'none' - does not reset anything, just upgrades if a conf is present
230 # OR installs new conf if a conf is missing
231 # 'soft' - deletes only $config_dir/config file and thus resetting most
232 # conf values to their defaults. Keeps the specific Webmin cron jobs
233 # 'hard' - deletes all files in $config_dir (keeping the .keep_* Gentoo file)
234 # and thus resetting all Webmin. Deletes the specific Webmin cron jobs too.
235 local _reset="none"
236
237
238 # If in interactive mode ask user what should we do
239 if [[ "${INTERACTIVE}" = "yes" ]]; then
240 einfo
241 einfo "Please enter the number of the action you would like to perform?"
242 einfo
243 einfo "1. Update configuration"
244 einfo " (keeps old config options and adds the new ones)"
245 einfo "2. Soft reset configuration"
246 einfo " (keeps some old config options, the other options are set to default)"
247 ewarn " All Webmin users will be reset"
248 einfo "3. Hard reset configuration"
249 einfo " (all options including module options are set to default)"
250 ewarn " You will lose all Webmin configuration options you have done till now"
251 einfo "4. Exit this configuration utility (default)"
252 while [ "$correct" != "true" ] ; do
253 read answer
254 if [[ "$answer" = "1" ]] ; then
255 _reset="none"
256 correct="true"
257 elif [[ "$answer" = "2" ]] ; then
258 _reset="soft"
259 correct="true"
260 elif [[ "$answer" = "3" ]] ; then
261 _reset="hard"
262 correct="true"
263 elif [ "$answer" = "4" -o "$answer" = "" ] ; then
264 die "User aborted configuration."
265 else
266 echo "Answer not recognized. Enter a number from 1 to 4"
267 fi
268 done
269
270 if [[ "$_reset" = "hard" ]]; then
271 while [ "$sure" != "true" ] ; do
272 ewarn "You will lose all Webmin configuration options you have done till now."
273 ewarn "Are you sure you want to do this? (y/n)"
274 read answer
275 if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
276 sure="true"
277 elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
278 die "User aborted configuration."
279 else
280 echo "Answer not recognized. Enter 'y' or 'n'"
281 fi
282 done
283 fi
284 fi
285
286 export reset=$_reset
287
288 # Create ssl certificate for Webmin if there is not one in the proper place
289 if [[ ! -e "${EROOT}etc/ssl/webmin/server.pem" ]]; then
290 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Webmin Server}"
291 SSL_COMMONNAME="${SSL_COMMONNAME:-*}"
292 install_cert "${EROOT}/etc/ssl/webmin/server"
293 fi
294
295 # Ensure all paths passed to the setup script use EROOT
296 export wadir="${EROOT}usr/libexec/webmin"
297 export config_dir="${EROOT}etc/webmin"
298 export var_dir="${EROOT}var/log/webmin"
299 export tempdir="${T}"
300 export pidfile="${EROOT}var/run/webmin.pid"
301 export perl="$( which perl )"
302 export os_type='gentoo-linux'
303 export os_version='*'
304 export real_os_type='Gentoo Linux'
305 export real_os_version='Any version'
306 # Forcing 'ssl' and 'ssl_redirect' for tightening security
307 export ssl=1
308 export ssl_redirect=1
309 export keyfile="${EROOT}etc/ssl/webmin/server.pem"
310 export port=10000
311
312 export atboot=0
313
314 einfo "Executing Webmin's configure script"
315 $wadir/gentoo-setup.sh
316
317 einfo "Configuration of Webmin done"
318 }