Source: http://www.webmin.com/download/%{name}-%{version}.tar.gz
Vendor: Jamie Cameron
BuildRoot: /tmp/%{name}-%{version}
-BuildArch: noarch
+BuildArchitectures: noarch
%description
A web-based administration interface for Unix systems. Using Webmin you can
configure DNS, Samba, NFS, local/remote filesystems and more using your
rm -f mount/macos-mounts*
rm -f webmin-gentoo-init
rm -rf format bsdexports hpuxexports sgiexports zones rbac
+rm -rf acl/Authen-SolarisRBAC-0.1*
chmod -R og-w .
%install
rm -rf /etc/.webmin-backup
cp -r /etc/webmin /etc/.webmin-backup
fi
+# Put back old /etc/webmin saved when an RPM was removed
+if [ "\$1" = 1 -a ! -d /etc/webmin -a -d /etc/webmin.rpmsave ]; then
+ mv /etc/webmin.rpmsave /etc/webmin
+fi
+/bin/true
%post
inetd=`grep "^inetd=" /etc/webmin/miniserv.conf 2>/dev/null | sed -e 's/inetd=//g'`
+startafter=0
if [ "\$1" != 1 ]; then
# Upgrading the RPM, so stop the old webmin properly
if [ "\$inetd" != "1" ]; then
+ kill -0 `cat /var/webmin/miniserv.pid 2>/dev/null` 2>/dev/null
+ if [ "\$?" = 0 ]; then
+ startafter=1
+ fi
/etc/init.d/webmin stop >/dev/null 2>&1 </dev/null
fi
+else
+ startafter=1
fi
cd /usr/libexec/webmin
config_dir=/etc/webmin
tempdir=/tmp/.webmin
fi
export config_dir var_dir perl autoos port login crypt host ssl nochown autothird noperlpath nouninstall nostart allow atboot
-./setup.sh >$tempdir/webmin-setup.out 2>&1
+./setup.sh >\$tempdir/webmin-setup.out 2>&1
+chmod 600 \$tempdir/webmin-setup.out
rm -f /var/lock/subsys/webmin
-if [ "$inetd" != "1" ]; then
+if [ "\$inetd" != "1" -a "\$startafter" = "1" ]; then
/etc/init.d/webmin start >/dev/null 2>&1 </dev/null
fi
cat >/etc/webmin/uninstall.sh <<EOFF
echo "Webmin install complete. You can now login to http://\$host:\$port/"
fi
echo "as root with your root password."
+/bin/true
%preun
if [ "\$1" = 0 ]; then
(cd /usr/libexec/webmin ; WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin LANG= /usr/libexec/webmin/run-uninstalls.pl)
/etc/init.d/webmin stop >/dev/null 2>&1 </dev/null
/etc/webmin/stop >/dev/null 2>&1 </dev/null
- /bin/true
fi
fi
+/bin/true
%postun
if [ "\$1" = 0 ]; then
grep root=/usr/libexec/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. Delete the config files
- rm -rf /etc/webmin /var/webmin
+ # has taken it's place. Rename away the /etc/webmin directory
+ rm -rf /etc/webmin.rpmsave
+ mv /etc/webmin /etc/webmin.rpmsave
+ rm -rf /var/webmin
fi
fi
+/bin/true
%triggerpostun -- webmin
if [ ! -d /var/webmin -a "\$1" = 2 ]; then
else
rm -rf /etc/.webmin-backup
fi
+/bin/true
EOF
close(SPEC);
}
}
+if (!$webmail && -d "/usr/local/webadmin/rpm/yum") {
+ # Add to our repository
+ system("cp rpm/webmin-$ver-$rel.noarch.rpm /usr/local/webadmin/rpm/yum");
+ }
+