#!/bin/sh # sandman setup script by Michael Shigorin, 2004 # special thanks to lioka and raorn # use, modify and distribute freely [ "$EUID" = "0" ] || { echo "This script needs root privileges and a clue on why to run it!" echo "Make sure these prerequisites are met." exit 1 } REPOS=/etc/sandman/repos SUDO=/etc/sudo.d/sandman CVS=/var/cvs echo "This script will install sandman software as described here:" echo "http://www.linux-os.ru/Members/gvy/sandman-sisyphus-mini-howto/" echo -n "Press to continue, or better yet not to: " read echo "Proceeding." echo # software echo "* installing software... " rpm -q sandman sandman-server cvs >&/dev/null && { echo "already done." } || { echo apt-get install sandman sandman-server cvs || exit 1 } # configs echo -n "* modifying $REPOS... " rpm -V sandman-server | grep -q $REPOS && { echo "already modified, so see yourself" } || { echo "(was default)" mv -i $REPOS $REPOS.setuporig cat >> $REPOS << EOF [global] target = i586 distribution = ALT Linux vendor = ALT Linux Team cvsroot = /var/cvs cvsmodule = release [classic] stable = file:/var/ftp/pub/Linux/ALT/Sisyphus i586 classic basesystem = basesystem buildsystem = rpm-build getopt kernel-headers-common EOF } echo -n "* modifying $SUDO... " rpm -V sandman-server | grep -q $SUDO && { echo "already modified, so see yourself" } || { echo "(was default)" cp -a $SUDO $SUDO.setuporig subst 's/^# %sandman/%sandman/' $SUDO subst "s/localhost.localdomain/`hostname`/" $SUDO } # init cvs repo echo -n "* initializing $CVS... " [ -d $CVS ] && { echo " already exists, skipping!" } || { cvsinitroot $CVS && \ chmod g+w $CVS && \ echo "done" } # create "classic" repo tree echo "* creating dir tree for 'classic' repo... " mkdir -p \ /var/lib/sandman/classic/stable/{SRPMS.classic,i586/{RPMS.classic,base}} chown -R sandman:sandman /var/lib/sandman/classic # minor workaround per lioka's advice... ("till XFree86 packaging is fixed") # see also http://www.linux-os.ru/Members/gvy/sandman-tips-1/ echo "* tweaking sandman a bit..." SANDSERV=/usr/share/sandlib/sandserv.tcl grep -v DURING_INSTALL $SANDSERV > $SANDSERV-new [ -f $SANDSERV.setuporig ] || mv $SANDSERV $SANDSERV.setuporig mv $SANDSERV-new $SANDSERV # finally echo "** done **" echo echo "You'll need to do user setup (sandman-user-setup.sh)," echo "include needed user(s) to cvs, cvsadmin, sandman groups," echo "and start the server with 'service sandd start'" echo