Gentoo Archives: gentoo-commits

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