Blame Identity/Webenv/Moin/install.sh

ef5584
#!/bin/bash
ef5584
#
ef5584
#
ef5584
ef5584
ef5584
# Export directory name.
ef5584
EXPORTDIR=tmp
ef5584
WIKILOCATION=/var/www
ef5584
ef5584
# Instance Name which you want apply this theme to.
ef5584
printf 'Site instance: '
ef5584
read WIKIINSTANCE
ef5584
if [ ! -d "${WIKILOCATION}/${WIKIINSTANCE}" ];then
ef5584
	echo "The instance '${WIKIINSTANCE}' does not exist."
ef5584
	exit;
ef5584
fi
ef5584
ef5584
# Customized version selector
ef5584
echo 'Site customization:'
ef5584
select VERSION in `find . -maxdepth 1 -type d \
ef5584
	| egrep -v '^.$' | egrep -v 'svn' \
ef5584
	| sed 's/\.\///'`;do
ef5584
	# SVN Repository directory
ef5584
	SVN=http://centos.org/svn/artwork/trunk/Extras/Moin/$VERSION
ef5584
	break
ef5584
done
ef5584
ef5584
ef5584
# Location where your wiki instance is stored.
ef5584
WIKILOCATION=/var/www/
ef5584
ef5584
# Define Theme Name.
ef5584
THEMENAME="Modern"
ef5584
ef5584
# Create instance
ef5584
echo 'Downloading customization ...'
ef5584
mkdir $EXPORTDIR
ef5584
svn export $SVN/ $EXPORTDIR/ --force --quiet
ef5584
ef5584
echo 'Applying customization ...'
ef5584
cp -r $EXPORTDIR/$THEMENAME ${WIKILOCATION}${WIKIINSTANCE}/htdocs/
ef5584
cp $EXPORTDIR/${THEMENAME}.py ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
ef5584
cp logo.png ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png
ef5584
rm -r $EXPORTDIR
ef5584
ef5584
# Modify wikiconfig.py to set theme personalized names.
ef5584
sed -i -e "
ef5584
	/logo_string =/{
ef5584
	c\\
ef5584
    logo_string = u'\"CentOS\"'
ef5584
	}
ef5584
	/theme_default =/{
ef5584
	c\\
ef5584
    theme_default = '${THEMENAME}'
ef5584
	}
ef5584
	" ${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/*.py
ef5584
ef5584
# Set Permissions
ef5584
echo 'Updating permissions ... '
ef5584
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/
ef5584
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
ef5584
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png
ef5584
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/
ef5584
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
ef5584
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png