File webmin.spec of Package webmin
# spec file for package webmin
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# norootforbuild
Name: webmin
Summary: A web-based administration interface for Unix systems.
Version: 1.441
Release: 1
PreReq: bash perl coreutils
AutoReqProv: off
License: Freeware
Group: System/Tools
Source: %{name}-%{version}.tar.bz2
%if 0%{?suse_version}
PreReq: %insserv_prereq
PreReq: %fillup_prereq
PreReq: perl-Net-SSLeay
BuildRequires: fdupes
Recommends: cron
Source2: webmin-SuSEfirewall2
Source3: webmin-init
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A web-based administration interface for Unix systems. Using Webmin you can
configure DNS, Samba, NFS, local/remote filesystems and more using your
web browser.
After installation, enter the URL http://localhost:10000/ into your
browser and login as root with your root password.
Author:
-------
Jamie Cameron
%prep
%setup -q
%build
(find . -name '*.cgi' ; find . -name '*.pl') | perl perlpath.pl /usr/bin/perl -
rm -f mount/freebsd-mounts*
rm -f mount/openbsd-mounts*
rm -f mount/macos-mounts*
rm -f webmin-gentoo-init
rm -rf format bsdexports hpuxexports sgiexports zones rbac
chmod -R og-w .
%install
export NO_BRP_CHECK_BYTECODE_VERSION="true"
mkdir -p %{buildroot}%{_libexecdir}/webmin
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/daemons
mkdir -p %{buildroot}%{_sysconfdir}/init.d/
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
mkdir -p %{buildroot}%{_sysconfdir}/webmin
cp -rp * %{buildroot}%{_libexecdir}/webmin
cp webmin-daemon %{buildroot}%{_sysconfdir}/sysconfig/daemons/webmin
%if 0%{?suse_version}
install -m755 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/webmin
mkdir -p %{buildroot}/tmp/.webmin
mkdir -p %{buildroot}/var/webmin
mkdir -p %{buildroot}/var/lock/subsys
mkdir -p %{buildroot}/%{_sbindir}
touch %{buildroot}/var/lock/subsys/webmin
echo "oscheck='SuSE Linux" > %{buildroot}/tmp/.webmin/.check
ln -s %{_sysconfdir}/init.d/webmin %{buildroot}/%{_sbindir}/rcwebmin
%fdupes %{buildroot}%{_libexecdir}/webmin
%else
cp webmin-init %{buildroot}%{_sysconfdir}/init.d/webmin
%endif
touch %{buildroot}%{_sysconfdir}/webmin/config
cp webmin-pam %{buildroot}%{_sysconfdir}/pam.d/webmin
echo rpm >%{buildroot}%{_libexecdir}/webmin/install-type
%if 0%{?suse_version} > 1020
# install firewall definitions
# see http://en.opensuse.org/SuSEfirewall2/Service_Definitions_Added_via_Packages
# for details
install -D -m644 %{SOURCE2} %buildroot/%_sysconfdir/sysconfig/SuSEfirewall2.d/services/webmin
%endif
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%if 0%{?suse_version} > 1020
%_sysconfdir/sysconfig/SuSEfirewall2.d/services/webmin
%endif
%dir %{_sysconfdir}/sysconfig/daemons
%dir %{_libexecdir}/webmin
%dir %{_sysconfdir}/webmin
%dir /var/webmin
%dir /tmp/.webmin
%{_libexecdir}/webmin
%{_sbindir}/rcwebmin
/etc/init.d/webmin
%attr(755,root,root) %{_libexecdir}/webmin/setup.sh
%config(noreplace) %{_sysconfdir}/pam.d/webmin
%config(noreplace) %{_sysconfdir}/sysconfig/daemons/webmin
%config(missingok,noreplace) %{_sysconfdir}/webmin/config
%ghost /var/lock/subsys/webmin
%config /tmp/.webmin/.check
%pre
# Save /etc/webmin in case the upgrade trashes it
if [ "$1" != 1 ]; then
test -d etc/.webmin-backup && rm -rf etc/.webmin-backup
test -d etc/webmin && cp -r etc/webmin etc/.webmin-backup
fi
%post
%{fillup_and_insserv webmin}
%preun
if [ "$1" = 0 ]; then
grep "root=%{_libexecdir}/webmin /etc/webmin/miniserv.conf" >/dev/null 2>&1
if [ "$?" = 0 ]; then
# RPM is being removed, and no new version of webmin
# has taken it's place. Run uninstalls and stop the server
(cd %{_libexecdir}/webmin ; WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin LANG= %{_libexecdir}/webmin/run-uninstalls.pl)
fi
fi
%stop_on_removal webmin
%postun
%restart_on_update webmin
%triggerpostun -- webmin
if [ ! -r etc/webmin/miniserv.conf -a -d etc/.webmin-backup -a "$1" = 2 ]; then
test -d etc/.webmin-broken && rm -rf etc/.webmin-broken
test -d etc/webmin && mv etc/webmin etc/.webmin-broken
mv -f etc/.webmin-backup etc/webmin
else
test -d etc/.webmin-backup && rm -rf etc/.webmin-backup
fi
%changelog