1 |
# $Id: smeserver-egroupware.spec,v 1.1 2013/06/01 12:41:24 unnilennium Exp $ |
# $Id: smeserver-egroupware.spec,v 1.3 2013/12/12 17:03:05 unnilennium Exp $ |
2 |
# Authority: cool34000 |
# Authority: cool34000 |
3 |
# Name: Sylvain Gomez |
# Name: Sylvain Gomez |
4 |
|
|
5 |
%define name smeserver-egroupware |
%define name smeserver-egroupware |
6 |
%define version 1.4.004 |
%define version 1.8.005 |
7 |
%define release 2 |
%define release 2 |
8 |
%define rpmver 4.0.4 |
%define rpmver 4.0.4 |
9 |
|
|
10 |
|
|
11 |
Summary: eGroupware web application for SME >7 |
Summary: eGroupware web application for SME >=8 |
12 |
Name: %{name} |
Name: %{name} |
13 |
Version: %{version} |
Version: %{version} |
14 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
15 |
License: GPL |
License: GPL |
16 |
Group: Web/Application |
Group: Web/Application |
17 |
Source: %{name}-%{version}.tar.gz |
Source: %{name}-%{version}.tgz |
18 |
URL: http://www.egroupware.org |
URL: http://www.egroupware.org |
19 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
20 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
21 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
22 |
Requires: e-smith-base, e-smith-release >= 8 |
Requires: e-smith-base, e-smith-release >= 8 |
23 |
Patch0: smeserver-egroupware-1.4.004-tmp_dir.patch |
Requires: eGroupware >= 1.8 |
24 |
|
Requires: eGroupware-gallery >= 1.8 |
25 |
|
|
26 |
%description |
%description |
27 |
This RPM is an unofficial addon for the SME Server 7.x and above. |
This RPM is an unofficial addon for the SME Server 8.x and above. |
28 |
eGroupWare is a free enterprise ready groupware software for your network. |
eGroupWare is a free enterprise ready groupware software for your network. |
29 |
It enables you to manage contacts, appointments, todos and many more for your whole business. |
It enables you to manage contacts, appointments, todos and many more for your whole business. |
30 |
eGroupWare is a groupware server. It comes with a native web-interface which allowes to access |
eGroupWare is a groupware server. It comes with a native web-interface which allowes to access |
39 |
|
|
40 |
|
|
41 |
%changelog |
%changelog |
42 |
|
* Thu Dec 12 2013 JP Pialasse <tests@pialasse.com> 1.8.005-2.sme |
43 |
|
- upgrade to eGroupware 1.8 using opensuse rpm for Centos5 |
44 |
|
- built for eGroupware-1.8.005.20131007 |
45 |
|
- see [SME: 8040] |
46 |
|
- revert back some configuration in spec |
47 |
|
- will need to move to an event |
48 |
|
|
49 |
* Tue Jun 04 2013 JP Pialasse <tests@pialasse.com> 1.4.004-2.sme |
* Tue Jun 04 2013 JP Pialasse <tests@pialasse.com> 1.4.004-2.sme |
50 |
- fix upload dir not defined [SME 7653] |
- fix upload dir not defined [SME 7653] |
51 |
- updated e-smith-release >8 |
- updated e-smith-release >8 |
132 |
|
|
133 |
|
|
134 |
%setup |
%setup |
135 |
%patch0 -p1 |
#%patch0 -p1 |
136 |
|
|
137 |
%build |
%build |
138 |
# Creating templates2adjust |
# Creating templates2adjust |
139 |
perl createlinks |
perl createlinks |
140 |
|
|
141 |
|
|
142 |
|
### now in archive |
143 |
# Default DB parameters |
# Default DB parameters |
144 |
DEFAULTS1=root/etc/e-smith/db/configuration/defaults/egroupware |
#DEFAULTS1=root/etc/e-smith/db/configuration/defaults/egroupware |
145 |
DEFAULTS2=root/etc/e-smith/db/accounts/defaults/egroupware |
#DEFAULTS2=root/etc/e-smith/db/accounts/defaults/egroupware |
146 |
mkdir -p $DEFAULTS1 |
#mkdir -p $DEFAULTS1 |
147 |
mkdir -p $DEFAULTS2 |
#mkdir -p $DEFAULTS2 |
148 |
echo "egroupware" > $DEFAULTS1/DbName |
#echo "egroupware" > $DEFAULTS1/DbName |
149 |
echo "egwuser" > $DEFAULTS1/DbUser |
#echo "egwuser" > $DEFAULTS1/DbUser |
150 |
echo "on" > $DEFAULTS1/HTTPS |
#echo "on" > $DEFAULTS1/HTTPS |
151 |
echo "eGroupWare" > $DEFAULTS1/Name |
#echo "eGroupWare" > $DEFAULTS1/Name |
152 |
echo "global" > $DEFAULTS1/PublicAccess |
#echo "global" > $DEFAULTS1/PublicAccess |
153 |
echo "url" > $DEFAULTS1/type |
#echo "url" > $DEFAULTS1/type |
154 |
echo "reserved" > $DEFAULTS2/type |
#echo "reserved" > $DEFAULTS2/type |
155 |
|
|
156 |
|
|
157 |
%install |
%install |
175 |
;; |
;; |
176 |
*) |
*) |
177 |
echo "Updating eGroupware... Please wait!" |
echo "Updating eGroupware... Please wait!" |
178 |
echo "Backup folder: /opt/eGW_RPM_BACKUP" |
# echo "Backup folder: /opt/eGW_RPM_BACKUP" |
179 |
mkdir -p /opt/eGW_RPM_BACKUP |
mkdir -p /opt/eGW_RPM_BACKUP |
180 |
cd /opt |
# cd /opt |
181 |
echo "Backing up installation files..." |
# echo "Backing up installation files..." |
182 |
tar -czf /opt/eGW_RPM_BACKUP/egroupware.tar.gz egroupware |
# tar -czf /opt/eGW_RPM_BACKUP/egroupware.tar.gz egroupware |
183 |
echo "Backing up MySQL database..." |
echo "Backing up MySQL database..." |
184 |
mysqldump egroupware > /opt/eGW_RPM_BACKUP/egroupware.sql |
mysqldump egroupware > /opt/eGW_RPM_BACKUP/egroupware$(date +%Y-%m-%d).sql |
185 |
/sbin/e-smith/db configuration show egroupware > /opt/eGW_RPM_BACKUP/config.txt |
/sbin/e-smith/db configuration show egroupware > /opt/eGW_RPM_BACKUP/config.txt |
186 |
;; |
;; |
187 |
esac |
esac |
189 |
|
|
190 |
%post |
%post |
191 |
# Initializing SME DB |
# Initializing SME DB |
192 |
/etc/e-smith/events/actions/initialize-default-databases |
echo "Initializing SME DB" |
193 |
|
/etc/e-smith/events/actions/initialize-default-databases 2>/dev/null |
194 |
|
echo " " |
195 |
|
|
196 |
# Variables |
# Variables |
197 |
DOMAIN=$(/sbin/e-smith/db configuration get DomainName) |
DOMAIN=$(/sbin/e-smith/db configuration get DomainName) |
198 |
EGPASS=$(/sbin/e-smith/db configuration getprop egroupware DbPassword) |
EGPASS=$(/sbin/e-smith/db configuration getprop egroupware DbPassword) |
199 |
UPDATE=$(ls /opt | grep -c egroupware) |
UPDATE=$(ls /usr/share/ | grep -c egroupware) |
200 |
|
|
201 |
echo "Decompressing files..." |
#echo "Decompressing files..." |
202 |
mkdir -p /opt/egroupware/{files/g2data,backup,tmp} |
#mkdir -p /opt/egroupware/{files/g2data,backup,tmp} |
203 |
tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-1.4.004.tar.gz -C /opt/egroupware |
#tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-1.4.004.tar.gz -C /opt/egroupware |
204 |
tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-egw-pear-1.4.004.tar.gz -C /opt/egroupware |
#tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-egw-pear-1.4.004.tar.gz -C /opt/egroupware |
205 |
tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-gallery-1.4.004.tar.gz -C /opt/egroupware |
#tar xzf /usr/share/doc/eGroupWare-1.4.004/Sources/eGroupWare-gallery-1.4.004.tar.gz -C /opt/egroupware |
206 |
cp -f /usr/share/doc/eGroupWare-1.4.004/Sources/phpSysInfo/config.php /opt/egroupware/html/phpsysinfo/ |
echo "Preparing phpSysInfo..." |
207 |
cp -f /usr/share/doc/eGroupWare-1.4.004/Sources/phpSysInfo/Redhat.png /opt/egroupware/html/phpsysinfo/images/ |
cp -f /usr/share/doc/eGroupWare-1.8.005/Sources/phpSysInfo/config.php /usr/share/egroupware/phpsysinfo/ |
208 |
|
cp -f /usr/share/doc/eGroupWare-1.8.005/Sources/phpSysInfo/Redhat.png /usr/share/egroupware/phpsysinfo/images/ |
209 |
echo "Cleaning Install..." |
|
210 |
rm -rf /opt/egroupware/egroupware |
#echo "Cleaning Install..." |
211 |
rm -rf /opt/egroupware/html/debian |
#rm -rf /opt/egroupware/egroupware |
212 |
rm -f /opt/egroupware/html/.htaccess |
#rm -rf /opt/egroupware/html/debian |
213 |
|
#rm -f /opt/egroupware/html/.htaccess |
214 |
echo "Setting file access rules:" |
|
215 |
cd /opt/egroupware |
#echo "Setting file access rules:" |
216 |
echo " - Changing owner recursivly..." |
#cd /opt/egroupware |
217 |
chown -R root:root /opt/egroupware/html |
#echo " - Changing owner recursivly..." |
218 |
echo " - Recursive CHMOD 755 on folders..." |
#chown -R root:root /opt/egroupware/html |
219 |
find html -type d -exec chmod 755 {} \; |
#echo " - Recursive CHMOD 755 on folders..." |
220 |
echo " - Recursive CHMOD 644 on files..." |
#find html -type d -exec chmod 755 {} \; |
221 |
find html -type f -exec chmod 644 {} \; |
#echo " - Recursive CHMOD 644 on files..." |
222 |
echo " - Customization of CHMOD for a few folders..." |
#find html -type f -exec chmod 644 {} \; |
223 |
chmod 770 /opt/egroupware/backup |
#echo " - Customization of CHMOD for a few folders..." |
224 |
chmod 770 /opt/egroupware/files |
#chmod 770 /opt/egroupware/backup |
225 |
chmod 770 /opt/egroupware/files/g2data |
#chmod 770 /opt/egroupware/files |
226 |
chmod 770 /opt/egroupware/tmp |
#chmod 770 /opt/egroupware/files/g2data |
227 |
chown www:www /opt/egroupware/backup |
#chmod 770 /opt/egroupware/tmp |
228 |
chown www:www /opt/egroupware/files |
#chown www:www /opt/egroupware/backup |
229 |
chown www:www /opt/egroupware/files/g2data |
#chown www:www /opt/egroupware/files |
230 |
chown www:www /opt/egroupware/tmp |
#chown www:www /opt/egroupware/files/g2data |
231 |
|
#chown www:www /opt/egroupware/tmp |
232 |
if [ "$UPDATE" = "0" ] ; then |
|
233 |
echo "Preparing Site-Mgr..." |
# fixed this one adding .php, not sure if still necessary |
234 |
cd /opt/egroupware/html |
#if [ "$UPDATE" = "0" ] ; then |
235 |
ln -s sitemgr/sitemgr-link |
# echo "Preparing Site-Mgr..." |
236 |
fi |
# cd /usr/share/egroupware |
237 |
|
# ln -s sitemgr/sitemgr-link.php |
238 |
|
#fi |
239 |
|
|
240 |
echo "Preparing header.inc.php..." |
echo "Preparing header.inc.php..." |
241 |
case $UPDATE in |
# if first install |
242 |
0) sed 's.egwpass.'$EGPASS'.g' /usr/share/doc/eGroupWare-1.4.004/Sources/header.inc.php > /opt/egroupware/header.inc.php ;; |
if [ "$1" = "1" ] ; then |
243 |
*) mv -f /opt/egroupware/html/header.inc.php /opt/egroupware/ 2>/dev/null ;; |
# 0) |
244 |
esac |
sed 's.egwpass.'$EGPASS'.g' /usr/share/doc/eGroupWare-1.8.005/Sources/header.inc.php > /usr/share/egroupware/header.inc.php |
245 |
chown www:www /opt/egroupware/header.inc.php |
echo " done!" |
246 |
chmod 640 /opt/egroupware/header.inc.php |
fi |
247 |
cd /opt/egroupware/html |
# *) mv -f /opt/egroupware/html/header.inc.php /opt/egroupware/ 2>/dev/null ;; |
248 |
ln -s ../header.inc.php 2>/dev/null |
#esacc |
249 |
|
#chown www:www /opt/egroupware/header.inc.php |
250 |
|
#chmod 640 /opt/egroupware/header.inc.php |
251 |
|
#cd /opt/egroupware/html |
252 |
|
#ln -s ../header.inc.php 2>/dev/null |
253 |
|
echo " " |
254 |
|
|
255 |
|
# the integration is complete Ithink now..... |
256 |
echo "Preparing Gallery2..." |
echo "Preparing Gallery2..." |
257 |
if [ -f /opt/egroupware/html/gallery/gallery2/config.php ] ; then |
if [ -f /usr/share/egroupware/gallery/gallery2/config.php ] ; then |
258 |
touch /opt/egroupware/html/gallery/gallery2/config.php |
touch /usr/share/egroupware/gallery/gallery2/config.php |
259 |
else |
else |
260 |
sed 's.egwpass.'$EGPASS'.g' /usr/share/doc/eGroupWare-1.4.004/Sources/Gallery2/config.php > /opt/egroupware/html/gallery/gallery2/config.php |
sed 's.egwpass.'$EGPASS'.g' /usr/share/doc/eGroupWare-1.8.005/Sources/Gallery2/config.php > /usr/share/egroupware/gallery/gallery2/config.php |
261 |
fi |
fi |
262 |
chmod 640 /opt/egroupware/html/gallery/gallery2/config.php |
|
263 |
chown www:www /opt/egroupware/html/gallery/gallery2/config.php |
chmod 640 /usr/share/egroupware/gallery/gallery2/config.php |
264 |
|
chown www:www /usr/share/egroupware/gallery/gallery2/config.php |
265 |
echo " " |
echo " " |
266 |
|
|
267 |
|
### this one will be done by event |
268 |
echo "MySQL installation:" |
echo "MySQL installation:" |
269 |
if [ "$UPDATE" = "0" ] ; then |
#if [ "$UPDATE" = "0" ] ; then |
270 |
cp /usr/share/doc/eGroupWare-1.4.004/Sources/81egw_database.sql /etc/e-smith/sql/init/ |
# cp /usr/share/doc/eGroupWare-1.4.004/Sources/81egw_database.sql /etc/e-smith/sql/init/ |
271 |
fi |
#fi |
272 |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80egw_mysql.sql |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80egw_mysql.sql |
273 |
|
/sbin/e-smith/expand-template /etc/e-smith/sql/init/81egw_default |
274 |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/81egw_domain.sql |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/81egw_domain.sql |
275 |
/etc/rc.d/init.d/mysql.init start |
/etc/rc.d/init.d/mysql.init start |
276 |
echo " " |
echo " " |
335 |
|
|
336 |
%preun |
%preun |
337 |
if [ $1 = 0 ] ; then |
if [ $1 = 0 ] ; then |
338 |
mv /usr/share/doc/eGroupWare-1.4.004/Sources/DO_NOT_USE_OR_DELETE/eGW-Full-Uninstall.sh /root/ |
mv /usr/share/doc/eGroupWare-1.8.005/Sources/DO_NOT_USE_OR_DELETE/eGW-Full-Uninstall.sh /root/ |
339 |
fi |
fi |
340 |
|
|
341 |
|
|