Blame Identity/Webenv/Themes/Default/Moin/1.5.7/install.sh

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