Blame Extras/Moin/install.sh

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