# $Id: smeserver-groupoffice.spec,v 1.4 2008/11/25 16:20:23 slords Exp $ # Authority: nocvs # Name: Dietmar Berteld %define name smeserver-groupoffice %define version 2.18.1 %define release 7 %define rpmver 4.0.4 Summary: GroupOffice Collaboration-Suite Web Application for SME Server 7.x based on GroupOffice 2.18-stable-1 Name: %{name} Version: %{version} Release: %{release}%{?dist} License: GPL Group: /Web/Applications Source: %{name}-%{version}.tar.gz URL: http://group-office.com/ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch Requires: e-smith-base, e-smith-release >= 7 BuildRequires: e-smith-devtools %description This RPM is an unofficial addon for the SME Server 7.x. The target audience is the Linux/E-smith administrator who wants to add Collaboration package . Group-Office is a Groupware suite containing a base system and different modules. The modules are designed in a way that groups of people can collaborate online. Shared calendars, addressbooks, projects, files and e-mail are the key features of the project. Users use their favorite browser to access their groupware from all over the world. Combined with the powerful Linux operating system it is a complete enterprise solution for the small to medium enterprise. After installation open your webbrowser your local site https://your_e-smith-server_adress/groupoffice %changelog * Mon Nov 05 2007 Dietmar Berteld - [2.18.1-7] Upgrade to new GroupOffice version 2.18-stable-1 Change to e-mail-auth with automatic user creation * Thu Oct 04 2007 Dietmar Berteld - [2.17.13-6] Upgrade to new GroupOffice version 2.17-stable-13 * Fri May 25 2007 Dietmar Berteld - [2.17.2-5] Upgrade to new GroupOffice version 2.17-stable-2 * Sun May 13 2007 Dietmar Berteld - [2.16.10-4] Add auto-configuration for languages and domain-settings, delete install-folder * Wed Apr 25 2007 Dietmar Berteld - [2.16.10-3] Change rights to root:root, MySQL-userrights * Thu Feb 20 2007 Dietmar Berteld - [2.16.10-2] New location: /opt/groupoffice * Thu Feb 06 2007 Dietmar Berteld - [2.16.10-1] Initial version %prep rm -rf $RPM_BUILD_ROOT %setup %build %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %pre UPDATE=$(ls /opt | grep -c groupoffice) HTMLDIR=/opt/groupoffice case $UPDATE in 0) echo "Installing GroupOffice... Please wait!" ;; *) echo "Updating GroupOffice... Please wait!" mkdir -p /opt/GO_RPM_BACKUP cd /opt echo "Backing up installation files..." tar -czf /opt/GO_RPM_BACKUP/groupoffice.tar.gz groupoffice echo "Backing up MySQL database..." mysqldump groupoffice > /opt/GO_RPM_BACKUP/groupoffice.sql /sbin/e-smith/db configuration show groupoffice > /opt/GO_RPM_BACKUP/config.txt ;; esac %post /etc/e-smith/events/actions/initialize-default-databases # General Information APP=GroupOffice URL=groupoffice WORKDIR=/root INSTALLDIR=/usr/share/doc/groupoffice-com-2.18-stable-1/Sources HTMLDIR=/opt/groupoffice MYSQLDB=groupoffice MYSQLUSER=gofficeuser MYSQLPASS=$(/sbin/e-smith/db configuration getprop groupoffice DbPassword) DOMAIN=$(/sbin/e-smith/db configuration get DomainName) SRVNAME=$(/sbin/e-smith/db configuration get SystemName) UPDATE=$(ls /opt | grep -c groupoffice) grep "LANG=" /etc/sysconfig/i18n > lang1 sed -e 's/LANG="//g' lang1 > lang2 sed -e 's/"//g' lang2 > lang LANG=$(cat lang) rm -rf lang* #Untar application echo "Decompressing files..." mkdir -p $HTMLDIR/{files,home,tmp} chmod 0775 $HTMLDIR/{files,home,tmp} tar xzf $INSTALLDIR/gocom218s1.tar.gz -C $HTMLDIR case $UPDATE in 0) mv -f $HTMLDIR/groupoffice-com-2.18-stable-1 $HTMLDIR/html ;; *) cp -ufR $HTMLDIR/groupoffice-com-2.18-stable-1/* $HTMLDIR/html --reply=yes ;; esac rm -rf $HTMLDIR/groupoffice-com-2.18-stable-1 mkdir -p $HTMLDIR/html/local chmod 0775 $HTMLDIR/html/local #Prepare config settings if [ "$UPDATE" = "0" ]; then sed 's.gofficepassword.'$MYSQLPASS'.g' $INSTALLDIR/config.php > $HTMLDIR/html/config1.php sed "s/mydomain/$DOMAIN/g" $HTMLDIR/html/config1.php > $HTMLDIR/html/config2.php sed "s/mysmtpserver/$SRVNAME.$DOMAIN/g" $HTMLDIR/html/config2.php > $HTMLDIR/html/config.php sed "s/mydomain/$DOMAIN/g" $INSTALLDIR/auth_sources.inc > $HTMLDIR/html/auth_sources.inc rm $HTMLDIR/html/config1.php rm $HTMLDIR/html/config2.php case "$LANG" in de_DE) sed -e "s/'en-us'/'de'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; es_ES) sed -e "s/'en-us'/'es'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; fr_FR) sed -e "s/'en-us'/'fr'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; it_IT) sed -e "s/'en-us'/'it'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; sv_FI) sed -e "s/'en-us'/'sv'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; esac case "$LANG" in de_DE) sed -e "s/'223'/'81'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; es_ES) sed -e "s/'223'/'195'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; fr_FR) sed -e "s/'223'/'73'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; it_IT) sed -e "s/'223'/'105'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; sv_FI) sed -e "s/'223'/'203'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; esac case "$LANG" in de_DE) sed -e "s/'-5'/'+1'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; es_ES) sed -e "s/'-5'/'+1'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; fr_FR) sed -e "s/'-5'/'+1'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; it_IT) sed -e "s/'-5'/'+1'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; sv_FI) sed -e "s/'-5'/'+1'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; esac case "$LANG" in de_DE) sed -e "s/'-'/'.'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; es_ES) sed -e "s/'-'/'.'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; fr_FR) sed -e "s/'-'/'.'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; it_IT) sed -e "s/'-'/'.'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; sv_FI) sed -e "s/'-'/'.'/" $HTMLDIR/html/config.php.new >$HTMLDIR/html/config.php ;; esac case "$LANG" in de_DE) sed -e "s/'US$'/'EUR'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; es_ES) sed -e "s/'US$'/'EUR'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; fr_FR) sed -e "s/'US$'/'EUR'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; it_IT) sed -e "s/'US$'/'EUR'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; sv_FI) sed -e "s/'US$'/'EUR'/" $HTMLDIR/html/config.php >$HTMLDIR/html/config.php.new ;; esac case "$LANG" in de_DE) mv $HTMLDIR/html/config.php.new $HTMLDIR/html/config.php ;; es_ES) mv $HTMLDIR/html/config.php.new $HTMLDIR/html/config.php ;; fr_FR) mv $HTMLDIR/html/config.php.new $HTMLDIR/html/config.php ;; it_IT) mv $HTMLDIR/html/config.php.new $HTMLDIR/html/config.php ;; sv_FI) mv $HTMLDIR/html/config.php.new $HTMLDIR/html/config.php ;; esac chmod 644 $HTMLDIR/html/config.php chmod 644 $HTMLDIR/html/auth_sources.inc rm -rf $HTMLDIR/html/install fi chown -R root.www $HTMLDIR/* chown -R www.www $HTMLDIR/home/ #Creating DataBase echo "MySQL installation:" case $UPDATE in 0) echo "Creating MySQL User and DataBase..." sed -e "s/'youraddress@yourdomain.com'/'admin@$DOMAIN'/" $INSTALLDIR/$MYSQLDB.sql > $WORKDIR/$MYSQLDB.sql sed -e "s/'yourdomain.com'/'$DOMAINE'/" $WORKDIR/$MYSQLDB.sql > $WORKDIR/$MYSQLDB.sql.new mysqladmin -u root create $MYSQLDB mysql $MYSQLDB < $WORKDIR/$MYSQLDB.sql.new mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " mysqladmin flush-privileges rm -f $WORKDIR/$MYSQLDB.sql.new ;; *) echo "Fixing MySQL rights..." mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " mysqladmin flush-privileges ;; esac echo "Applying modifications to services..." /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /usr/local/bin/svc -h /service/httpd-e-smith echo "-------------------------------------------------------------------------------" case $UPDATE in 0) echo "GroupOffice Installation completed." echo "Reminder:" echo "- Website open globally" echo "- https mode enabled with automatic redirection" echo "- go to https://$DOMAIN/$URL" echo "- SME users can login with their 'user@$DOMAIN' and password" echo "- GO Admin = 'administrator@Group-Office database' + pw = 'admin'" echo "- Please change GO Admin password" ;; *) echo "GroupOffice update completed." echo "Reminder:" echo "- The old install was backed up and can be found in /opt/GO_RPM_BACKUP" echo " PLEASE MOVE THIS DIRECTORY TO A SAFE PLACE!!!" echo "- Website open globally" echo "- https mode enabled with automatic redirection" echo "- go to https://$DOMAIN/$URL" echo "- SME users can login with their 'user@$DOMAIN' and password" echo "- GO Admin = 'administrator@Group-Office database' + pw = 'admin'" echo "- Please change GO Admin password" ;; esac echo "-------------------------------------------------------------------------------" echo "Following DB parameters are allowed:" echo " # config setprop groupoffice HTTPS on/off" echo " # config setprop groupoffice PublicAccess local/global" echo " " echo "Don't forget to apply modifications with following commands:" echo " # expand-template /etc/httpd/conf/httpd.conf" echo " # svc -h /service/httpd-e-smith" echo " " echo "For more details, see http://wiki.contribs.org/GroupOffice" echo "-------------------------------------------------------------------------------" %preun INSTALLDIR=/usr/share/doc/groupoffice-com-2.18-stable-1/Sources if [ $1 = 0 ] ; then mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/GO-Full-Uninstall.sh /root/ fi %postun if [ $1 = 0 ] ; then echo "Restarting services..." /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /usr/local/bin/svc -h /service/httpd-e-smith echo " " echo "Uninstallation finished!" echo "If you want to completly remove it (installation files and MySQL user+database)" echo "please issue the following command at the prompt:" echo "# sh /root/GO-Full-Uninstall.sh" fi %files -f %{name}-%{version}-filelist %defattr(-,root,root)