1 |
%define name smeserver-typo3 |
2 |
%define version 4.1.1 |
3 |
%define release 2 |
4 |
%define rpmver 4.0.4 |
5 |
|
6 |
Summary: Typo3 Content Management System Web Application for SME Server 7.x based on Typo3-4.1.1 |
7 |
Name: %{name} |
8 |
Version: %{version} |
9 |
Release: %{release}%{?dist} |
10 |
License: GPL |
11 |
Group: /Web/Applications |
12 |
Source: %{name}-%{version}.tar.gz |
13 |
URL: http://www.typo3.org |
14 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
15 |
BuildArchitectures: noarch |
16 |
Requires: e-smith-base, e-smith-release >= 7 |
17 |
BuildRequires: e-smith-devtools |
18 |
|
19 |
%description |
20 |
This RPM is an unofficial addon for the SME Server 7.x. |
21 |
The target audience is the Linux/E-smith administrator |
22 |
who wants to add CMS package . |
23 |
Typo3 is a full-featured content management system that can be used for |
24 |
everything from simple websites to complex corporate application. |
25 |
After installation open your webbrowser your local site |
26 |
http://your_e-smith-server_adress/index.php |
27 |
|
28 |
|
29 |
|
30 |
%changelog |
31 |
* Sun Apr 29 2007 Dietmar Berteld <dietmar@berteld.com> |
32 |
- [4.1.1-2] More security, chmod 400 to the install folder, |
33 |
MySQL-user rights |
34 |
|
35 |
* Sat Apr 14 2007 Dietmar Berteld <dietmar@berteld.com> |
36 |
- [4.1.1-1] New Typo3-Base = 4.1.1, |
37 |
Change location to /opt/typo3, |
38 |
Simpler method to create MySQL-Datebase |
39 |
* Mon Jan 08 2007 Dietmar Berteld <dietmar@berteld.com> |
40 |
- [4.0.4-1] New Typo3-Base = 4.04, |
41 |
Change location for custom-template to /etc/e-smith/templates |
42 |
Adding more rights to the user typo3user: ALTER, INDEX |
43 |
for easy upgrade the typo3-installation |
44 |
|
45 |
* Thu Dec 14 2006 Dietmar Berteld <dietmar@berteld.com> |
46 |
- [4.0.3-2] Delete the lat-ibays method for creating ibays |
47 |
|
48 |
* Thu Dec 14 2006 Dietmar Berteld <dietmar@berteld.com> |
49 |
- [4.0.3-1] Initial version |
50 |
|
51 |
%prep |
52 |
rm -rf $RPM_BUILD_ROOT |
53 |
|
54 |
%setup |
55 |
|
56 |
%build |
57 |
|
58 |
%install |
59 |
/bin/rm -rf $RPM_BUILD_ROOT |
60 |
(/usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) |
61 |
/bin/rm -f %{name}-%{version}-filelist |
62 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
63 |
|
64 |
|
65 |
%files -f %{name}-%{version}-filelist |
66 |
|
67 |
%defattr(-,root,root) |
68 |
|
69 |
%clean |
70 |
rm -rf $RPM_BUILD_ROOT |
71 |
|
72 |
%pre |
73 |
|
74 |
%post |
75 |
|
76 |
|
77 |
# Generating password |
78 |
echo "Generating password..." |
79 |
passok=0 |
80 |
while [ "$passok" != "1" ] ; do |
81 |
openssl genrsa 32 > /root/pass.txt |
82 |
pass=$(grep -v "PRIVATE KEY" < /root/pass.txt) |
83 |
echo test > /root/pass.txt |
84 |
sed -e "s/test/$pass/" /root/pass.txt >/root/pass.new |
85 |
passok=$(grep -c $pass < /root/pass.new) |
86 |
done |
87 |
typo3pass=$pass |
88 |
echo "Password is : $typo3pass" |
89 |
rm -f /root/pass.txt |
90 |
rm -f /root/pass.new |
91 |
|
92 |
|
93 |
# Creating the database |
94 |
echo "Creating database 'typo3' and user 'typo3user'" |
95 |
mysqladmin -u root create typo3 |
96 |
mysql typo3 < typo3.sql |
97 |
mysql -e " grant create, select, insert, update, delete, drop, index, alter on typo3.* \ |
98 |
to 'typo3user'@'localhost' \ |
99 |
identified by '$typo3pass' " |
100 |
mysqladmin flush-privileges |
101 |
|
102 |
# Untar the application to /opt |
103 |
echo "Untar typo3" |
104 |
cd /opt |
105 |
tar xzf dummy-4.1.1.tar.gz |
106 |
tar xzf typo3_src-4.1.1.tar.gz |
107 |
mv dummy-4.1.1 typo3 |
108 |
mv typo3_src-4.1.1 typo3 |
109 |
mv localconf.php /opt/typo3/typo3conf |
110 |
mv l10n.tgz /opt/typo3/typo3conf/l10n |
111 |
cd /opt/typo3 |
112 |
rm -rf typo3_src |
113 |
ln -s typo3_src-4.1.1 typo3_src |
114 |
rm -rf /opt/dummy-4.1.1.tar.gz |
115 |
rm -rf /opt/typo3_src-4.1.1.tar.gz |
116 |
cd /opt/typo3/typo3conf/l10n |
117 |
tar xfz l10n.tgz |
118 |
rm -rf l10n.tgz |
119 |
|
120 |
cd /opt/typo3 |
121 |
echo "Changing rights" |
122 |
chgrp -R www fileadmin typo3conf typo3temp uploads |
123 |
chmod -R g+w,o-rwx fileadmin typo3conf typo3temp uploads |
124 |
chgrp -R www /opt/typo3/typo3/ext |
125 |
chmod -R g+w,o-rwx /opt/typo3/typo3/ext |
126 |
chmod -R 400 /opt/typo3/typo3/install |
127 |
rm -rf /smeserver-typo3-4.1.1-2.spec |
128 |
rm -rf /typo3.sql |
129 |
|
130 |
|
131 |
# Change typo3-Password |
132 |
cd /opt/typo3/typo3conf |
133 |
sed 's.typo3password.'$typo3pass'.g' localconf.php > config_neu.php |
134 |
variable=$(/sbin/e-smith/db configuration get DomainName) |
135 |
sed "s/mydomain/$variable/g" config_neu.php > localconf.php |
136 |
rm config_neu.php |
137 |
|
138 |
# Custom template fragment |
139 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
140 |
/etc/rc7.d/S86httpd-e-smith sigusr1 |
141 |
|
142 |
echo "-----------------------------------------------------------" |
143 |
echo "Typo3-Frontend: " |
144 |
echo "go to http://your_e-smith-server/typo3" |
145 |
echo " " |
146 |
echo "Typo3-Backend:" |
147 |
echo "go to http://your_e-smith-server/typo3/typo3" |
148 |
echo "Username : admin" |
149 |
echo "Password : password" |
150 |
echo " " |
151 |
echo "Please change the admin-password. " |
152 |
|
153 |
|
154 |
%preun |
155 |
# This section deletes the database |
156 |
echo "Deleting database 'typo3' and user 'typo3user'" |
157 |
mysql -u root -e "DROP DATABASE typo3" |
158 |
mysql -u root -e "REVOKE ALL PRIVILEGES ON typo3.* FROM 'typo3user'@'localhost';" |
159 |
mysql -u root -e "DROP USER typo3user@localhost;" |
160 |
|
161 |
# Delete folder /opt/typo3 |
162 |
echo "Deleting folder 'typo3'" |
163 |
rm -rf /opt/typo3 |
164 |
|
165 |
# Delete custom template fragment |
166 |
/sbin/e-smith/expand-template etc/httpd/conf/httpd.conf |
167 |
/etc/rc7.d/S86httpd-e-smith sigusr1 |
168 |
|
169 |
%postun |
170 |
|
171 |
|