%define name smeserver-typo3 %define version 4.1.1 %define release 2 %define rpmver 4.0.4 Summary: Typo3 Content Management System Web Application for SME Server 7.x based on Typo3-4.1.1 Name: %{name} Version: %{version} Release: %{release}%{?dist} License: GPL Group: /Web/Applications Source: %{name}-%{version}.tar.gz URL: http://www.typo3.org 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 CMS package . Typo3 is a full-featured content management system that can be used for everything from simple websites to complex corporate application. After installation open your webbrowser your local site http://your_e-smith-server_adress/index.php %changelog * Sun Apr 29 2007 Dietmar Berteld - [4.1.1-2] More security, chmod 400 to the install folder, MySQL-user rights * Sat Apr 14 2007 Dietmar Berteld - [4.1.1-1] New Typo3-Base = 4.1.1, Change location to /opt/typo3, Simpler method to create MySQL-Datebase * Mon Jan 08 2007 Dietmar Berteld - [4.0.4-1] New Typo3-Base = 4.04, Change location for custom-template to /etc/e-smith/templates Adding more rights to the user typo3user: ALTER, INDEX for easy upgrade the typo3-installation * Thu Dec 14 2006 Dietmar Berteld - [4.0.3-2] Delete the lat-ibays method for creating ibays * Thu Dec 14 2006 Dietmar Berteld - [4.0.3-1] Initial version %prep rm -rf $RPM_BUILD_ROOT %setup %build %install /bin/rm -rf $RPM_BUILD_ROOT (/usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) /bin/rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist %defattr(-,root,root) %clean rm -rf $RPM_BUILD_ROOT %pre %post # Generating password echo "Generating password..." passok=0 while [ "$passok" != "1" ] ; do openssl genrsa 32 > /root/pass.txt pass=$(grep -v "PRIVATE KEY" < /root/pass.txt) echo test > /root/pass.txt sed -e "s/test/$pass/" /root/pass.txt >/root/pass.new passok=$(grep -c $pass < /root/pass.new) done typo3pass=$pass echo "Password is : $typo3pass" rm -f /root/pass.txt rm -f /root/pass.new # Creating the database echo "Creating database 'typo3' and user 'typo3user'" mysqladmin -u root create typo3 mysql typo3 < typo3.sql mysql -e " grant create, select, insert, update, delete, drop, index, alter on typo3.* \ to 'typo3user'@'localhost' \ identified by '$typo3pass' " mysqladmin flush-privileges # Untar the application to /opt echo "Untar typo3" cd /opt tar xzf dummy-4.1.1.tar.gz tar xzf typo3_src-4.1.1.tar.gz mv dummy-4.1.1 typo3 mv typo3_src-4.1.1 typo3 mv localconf.php /opt/typo3/typo3conf mv l10n.tgz /opt/typo3/typo3conf/l10n cd /opt/typo3 rm -rf typo3_src ln -s typo3_src-4.1.1 typo3_src rm -rf /opt/dummy-4.1.1.tar.gz rm -rf /opt/typo3_src-4.1.1.tar.gz cd /opt/typo3/typo3conf/l10n tar xfz l10n.tgz rm -rf l10n.tgz cd /opt/typo3 echo "Changing rights" chgrp -R www fileadmin typo3conf typo3temp uploads chmod -R g+w,o-rwx fileadmin typo3conf typo3temp uploads chgrp -R www /opt/typo3/typo3/ext chmod -R g+w,o-rwx /opt/typo3/typo3/ext chmod -R 400 /opt/typo3/typo3/install rm -rf /smeserver-typo3-4.1.1-2.spec rm -rf /typo3.sql # Change typo3-Password cd /opt/typo3/typo3conf sed 's.typo3password.'$typo3pass'.g' localconf.php > config_neu.php variable=$(/sbin/e-smith/db configuration get DomainName) sed "s/mydomain/$variable/g" config_neu.php > localconf.php rm config_neu.php # Custom template fragment /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf /etc/rc7.d/S86httpd-e-smith sigusr1 echo "-----------------------------------------------------------" echo "Typo3-Frontend: " echo "go to http://your_e-smith-server/typo3" echo " " echo "Typo3-Backend:" echo "go to http://your_e-smith-server/typo3/typo3" echo "Username : admin" echo "Password : password" echo " " echo "Please change the admin-password. " %preun # This section deletes the database echo "Deleting database 'typo3' and user 'typo3user'" mysql -u root -e "DROP DATABASE typo3" mysql -u root -e "REVOKE ALL PRIVILEGES ON typo3.* FROM 'typo3user'@'localhost';" mysql -u root -e "DROP USER typo3user@localhost;" # Delete folder /opt/typo3 echo "Deleting folder 'typo3'" rm -rf /opt/typo3 # Delete custom template fragment /sbin/e-smith/expand-template etc/httpd/conf/httpd.conf /etc/rc7.d/S86httpd-e-smith sigusr1 %postun