Summary: A web-based administration interface for Unix systems Name: webmin Version: 1.430 Release: 2%{?dist} Provides: %{name}-%{version} BuildRequires: bash coreutils perl Requires: perl perl-Net-SSLeay Requires(post): chkconfig Requires(preun): chkconfig initscripts Requires(postun): initscripts AutoReq: 0 License: GPLv2 Group: System Environment/Daemons URL: http://www.webmin.com Source0: http://www.webmin.com/download/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArchitectures: noarch Patch0: webmin-ascending-uids.patch Patch1: webmin-init-script.patch %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. %prep %setup -q %patch0 %patch1 %build (find . -name '*.cgi' ; find . -name '*.pl') | perl perlpath.pl %{_bindir}/perl - rm -f mount/freebsd-mounts* rm -f mount/openbsd-mounts* rm -f mount/netbsd-mounts* rm -f mount/macos-mounts* rm -f webmin-gentoo-init rm -rf acl/Authen-SolarisRBAC-0.1 rm -rf format bsdexports hpuxexports sgiexports zones rbac find . -size 0 | xargs rm -f chmod -R og-w . %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_libexecdir}/%{name} mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/daemons mkdir -p %{buildroot}%{_initrddir} mkdir -p %{buildroot}%{_sysconfdir}/pam.d mkdir -p %{buildroot}%{_sysconfdir}/%{name} mkdir -p %{buildroot}%{_localstatedir}/%{name} cp -rp * %{buildroot}%{_libexecdir}/%{name} mv %{buildroot}%{_libexecdir}/%{name}/webmin-daemon %{buildroot}%{_sysconfdir}/sysconfig/daemons/%{name} mv %{buildroot}%{_libexecdir}/%{name}/webmin-init %{buildroot}%{_initrddir}/%{name} mv %{buildroot}%{_libexecdir}/%{name}/webmin-pam %{buildroot}%{_sysconfdir}/pam.d/%{name} # I'm only removing this so I can add it *differently* under # %files and get rid of an rpmlint warning rm -f %{buildroot}{%_libexecdir}/%{name}/README cd %{buildroot}%{_libexecdir}/%{name} # Remove the executable bit from anything executable w/o a shebang # Add an executable bit to anything w/ a shebang # This will help the following loop sort things properly between # /usr/share and /usr/libexec # # Props to ninkendo on irc.arstechnica.com for helping out with this part for i in $( find . -type f ); do if [ `head -1 $i | grep -c '^#!'` -eq 0 ]; then chmod -x $i else chmod +x $i fi done # AN EXPLANATION OF THE FOLLOWING LOOPY MESS: # There's a jumble of executable code (perl) and text data all # mixed together. It can't all stay in libexec, so I'm copying it # over to /usr/share and sym-linking it into libexec where the perl # scripts expect. The outer loop is to control find depth so I can do # relative symlinks. DATA_SUBDIR=`echo "%{_datadir}" | sed -e "s#%{_prefix}##g"` for i in `seq 1 3`; do rel=".." for j in `seq 1 $i`; do rel=`echo "../$rel"` done # help, a common directory for current in $( find . -mindepth $i -maxdepth $i -type d -name 'help'); do dest=`echo $current | sed -e "s#\./#%{buildroot}%{_datadir}/%{name}/#g"` mkdir -p $dest fc=`ls $current | wc -l` if [ $fc != 0 ]; then cp -r $current/* $dest fi rm -rf $current linkpath=`echo $current | sed -e "s#\./#$rel$DATA_SUBDIR/%{name}/#g"` ln -s $linkpath $current done # lang, a common directory for current in $( find . -mindepth $i -maxdepth $i -type d -name 'lang'); do dest=`echo $current | sed -e "s#\./#%{buildroot}%{_datadir}/%{name}/#g"` mkdir -p $dest fc=`ls $current | wc -l` if [ $fc != 0 ]; then cp -r $current/* $dest fi rm -rf $current linkpath=`echo $current | sed -e "s#\./#$rel$DATA_SUBDIR/%{name}/#g"` ln -s $linkpath $current done # images, a common directory for current in $( find . -mindepth $i -maxdepth $i -type d -name 'images'); do dest=`echo $current | sed -e "s#\./#%{buildroot}%{_datadir}/%{name}/#g"` mkdir -p $dest fc=`ls $current | wc -l` if [ $fc != 0 ]; then cp -r $current/* $dest fi rm -rf $current linkpath=`echo $current | sed -e "s#\./#$rel$DATA_SUBDIR/%{name}/#g"` ln -s $linkpath $current done # files that need to be symlinked for file in $( find . -mindepth $i -maxdepth $i -type f -name 'defaultacl' -o -name 'module.info' \ -o -name 'theme.info' -o -name '*.css' -o -name 'favicon.ico' -o -name '*.txt' \ -o -name 'defaulttheme' -o -name 'miniserv.pem' -o -name '*.gif' -o -name 'config' \ -o ! -perm /a+x -name '*.pl' ); do dest=`echo "$file" | sed -e "s#\./#%{buildroot}%{_datadir}/%{name}/#g"` dest=`dirname "$dest"` mkdir -p "$dest" mv "$file" "$dest" linkpath=`echo $file | sed -e "s#\./#$rel$DATA_SUBDIR/%{name}/#g"` ln -s $linkpath $file done # any other non-executable files aren't sym-linked for file in $( find . -mindepth $i -maxdepth $i -type f ! -perm /a+x ); do if [ -f "$file" ]; then dest=`echo "$file" | sed -e "s#\./#%{buildroot}%{_datadir}/%{name}/#g"` dest=`dirname "$dest"` mkdir -p "$dest" mv "$file" "$dest" fi done done %clean #[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %{_libexecdir}/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/daemons/%{name} %config(noreplace) %{_sysconfdir}/pam.d/%{name} %config(noreplace) %{_sysconfdir}/%{name} %{_localstatedir}/%{name} %{_initrddir}/%{name} %{_datadir}/%{name} %doc README %changelog * Thu Oct 30 2008 Andy Theuninck - 1.430-2 - Changed license to GPL - Removed Vendor tag - Removed all echo-ed output * Thu Oct 23 2008 Andy Theuninck - 1.430-1 - Initial RPM %pre tempdir=%{_datadir}/%{name}/installation-log mkdir -p $tempdir if [ "$?" != "0" ]; then exit 1 fi oscheck="Redhat Linux" # Save /etc/webmin in case the upgrade trashes it if [ "$1" != 1 ]; then cp -r --remove-destination %{_sysconfdir}/{%name} %{_datadir}/%{name}/webmin-etc-conf-backup fi /bin/true %post /sbin/chkconfig --add %{name} cd %{_libexecdir}/%{name} config_dir=%{_sysconfdir}/%{name} var_dir=%{_localstatedir}/%{name} localperl="%{_bindir}/perl" autoos=3 if [ "$WEBMIN_PORT" != "" ]; then port=$WEBMIN_PORT else port=10000 fi login=root if [ -r %{_sysconfdir}/shadow ]; then #crypt=`grep "^root:" /etc/shadow | cut -f 2 -d :` crypt=x else crypt=`grep "^root:" %{_sysconfdir}/passwd | cut -f 2 -d :` fi host=`hostname` ssl=1 atboot=0 nochown=1 autothird=1 noperlpath=1 nouninstall=1 nostart=1 tempdir=%{_datadir}/%{name}/installation-log export config_dir var_dir localperl autoos port login crypt host ssl nochown autothird noperlpath nouninstall nostart allow atboot ./setup.sh >$tempdir/webmin-setup.out 2>&1 chmod 600 $tempdir/webmin-setup.out cat >%{_sysconfdir}/%{name}/uninstall.sh </dev/null 2>&1 /sbin/chkconfig --del %{name} fi /bin/true %postun if [ "$1" -ge "1" ] ; then /sbin/service webmin condrestart >/dev/null 2>&1 || : fi