1 |
# $Id: smeserver-egroupware.spec,v 1.1 2013/06/01 12:41:24 unnilennium Exp $ |
# $Id: smeserver-egroupware.spec,v 1.5 2013/12/12 22:38:13 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 4 |
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 |
|
Patch0: smeserver-egroupware-1.8.005-g2datapath.patch |
19 |
|
Patch1: smeserver-egroupware-1.8.005-deletescript.patch |
20 |
URL: http://www.egroupware.org |
URL: http://www.egroupware.org |
21 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
22 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
23 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
24 |
Requires: e-smith-base, e-smith-release >= 8 |
Requires: e-smith-base, e-smith-release >= 8 |
25 |
Patch0: smeserver-egroupware-1.4.004-tmp_dir.patch |
Requires: eGroupware >= 1.8 |
26 |
|
Requires: eGroupware-gallery >= 1.8 |
27 |
|
|
28 |
%description |
%description |
29 |
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. |
30 |
eGroupWare is a free enterprise ready groupware software for your network. |
eGroupWare is a free enterprise ready groupware software for your network. |
31 |
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. |
32 |
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 |
41 |
|
|
42 |
|
|
43 |
%changelog |
%changelog |
44 |
|
* Fri Dec 13 2013 JP Pialasse <tests@pialasse.com> 1.8.005-4.sme |
45 |
|
- fixed deletion script see [SME: 8040] comment 25 |
46 |
|
|
47 |
|
* Thu Dec 12 2013 JP Pialasse <tests@pialasse.com> 1.8.005-3.sme |
48 |
|
- upgrade to eGroupware 1.8 using opensuse rpm for Centos5 |
49 |
|
- built for eGroupware-1.8.005.20131007 |
50 |
|
- see [SME: 8040] |
51 |
|
- 2 revert back some configuration in spec |
52 |
|
- will need to move to an event |
53 |
|
- 3 fix tmp and sess directory |
54 |
|
- fix default g2data path |
55 |
|
|
56 |
* 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 |
57 |
- fix upload dir not defined [SME 7653] |
- fix upload dir not defined [SME 7653] |
58 |
- updated e-smith-release >8 |
- updated e-smith-release >8 |
140 |
|
|
141 |
%setup |
%setup |
142 |
%patch0 -p1 |
%patch0 -p1 |
143 |
|
%patch1 -p1 |
144 |
|
|
145 |
|
|
146 |
%build |
%build |
147 |
# Creating templates2adjust |
# Creating templates2adjust |
148 |
perl createlinks |
perl createlinks |
149 |
|
|
150 |
|
|
151 |
|
### now in archive |
152 |
# Default DB parameters |
# Default DB parameters |
153 |
DEFAULTS1=root/etc/e-smith/db/configuration/defaults/egroupware |
#DEFAULTS1=root/etc/e-smith/db/configuration/defaults/egroupware |
154 |
DEFAULTS2=root/etc/e-smith/db/accounts/defaults/egroupware |
#DEFAULTS2=root/etc/e-smith/db/accounts/defaults/egroupware |
155 |
mkdir -p $DEFAULTS1 |
#mkdir -p $DEFAULTS1 |
156 |
mkdir -p $DEFAULTS2 |
#mkdir -p $DEFAULTS2 |
157 |
echo "egroupware" > $DEFAULTS1/DbName |
#echo "egroupware" > $DEFAULTS1/DbName |
158 |
echo "egwuser" > $DEFAULTS1/DbUser |
#echo "egwuser" > $DEFAULTS1/DbUser |
159 |
echo "on" > $DEFAULTS1/HTTPS |
#echo "on" > $DEFAULTS1/HTTPS |
160 |
echo "eGroupWare" > $DEFAULTS1/Name |
#echo "eGroupWare" > $DEFAULTS1/Name |
161 |
echo "global" > $DEFAULTS1/PublicAccess |
#echo "global" > $DEFAULTS1/PublicAccess |
162 |
echo "url" > $DEFAULTS1/type |
#echo "url" > $DEFAULTS1/type |
163 |
echo "reserved" > $DEFAULTS2/type |
#echo "reserved" > $DEFAULTS2/type |
164 |
|
|
165 |
|
|
166 |
%install |
%install |
167 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
168 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
169 |
rm -f %{name}-%{version}-filelist |
rm -f %{name}-%{version}-filelist |
170 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
171 |
|
|grep -v egroupware_tmp |grep -v egroupware_sess \ |
172 |
|
> %{name}-%{version}-filelist |
173 |
|
|
174 |
|
echo "%dir %attr(0755,www,www) /usr/share/egroupware_tmp">> %{name}-%{version}-filelist |
175 |
|
echo "%dir %attr(0755,www,www) /usr/share/egroupware_sess">> %{name}-%{version}-filelist |
176 |
|
|
177 |
|
|
178 |
%clean |
%clean |
189 |
;; |
;; |
190 |
*) |
*) |
191 |
echo "Updating eGroupware... Please wait!" |
echo "Updating eGroupware... Please wait!" |
192 |
echo "Backup folder: /opt/eGW_RPM_BACKUP" |
# echo "Backup folder: /opt/eGW_RPM_BACKUP" |
193 |
mkdir -p /opt/eGW_RPM_BACKUP |
mkdir -p /opt/eGW_RPM_BACKUP |
194 |
cd /opt |
# cd /opt |
195 |
echo "Backing up installation files..." |
# echo "Backing up installation files..." |
196 |
tar -czf /opt/eGW_RPM_BACKUP/egroupware.tar.gz egroupware |
# tar -czf /opt/eGW_RPM_BACKUP/egroupware.tar.gz egroupware |
197 |
echo "Backing up MySQL database..." |
echo "Backing up MySQL database..." |
198 |
mysqldump egroupware > /opt/eGW_RPM_BACKUP/egroupware.sql |
mysqldump egroupware > /opt/eGW_RPM_BACKUP/egroupware$(date +%Y-%m-%d).sql |
199 |
/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 |
200 |
;; |
;; |
201 |
esac |
esac |
203 |
|
|
204 |
%post |
%post |
205 |
# Initializing SME DB |
# Initializing SME DB |
206 |
/etc/e-smith/events/actions/initialize-default-databases |
echo "Initializing SME DB" |
207 |
|
/etc/e-smith/events/actions/initialize-default-databases 2>/dev/null |
208 |
|
echo " " |
209 |
|
|
210 |
# Variables |
# Variables |
211 |
DOMAIN=$(/sbin/e-smith/db configuration get DomainName) |
DOMAIN=$(/sbin/e-smith/db configuration get DomainName) |
212 |
EGPASS=$(/sbin/e-smith/db configuration getprop egroupware DbPassword) |
EGPASS=$(/sbin/e-smith/db configuration getprop egroupware DbPassword) |
213 |
UPDATE=$(ls /opt | grep -c egroupware) |
UPDATE=$(ls /usr/share/ | grep -c egroupware) |
214 |
|
|
215 |
echo "Decompressing files..." |
#echo "Decompressing files..." |
216 |
mkdir -p /opt/egroupware/{files/g2data,backup,tmp} |
#mkdir -p /opt/egroupware/{files/g2data,backup,tmp} |
217 |
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 |
218 |
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 |
219 |
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 |
220 |
cp -f /usr/share/doc/eGroupWare-1.4.004/Sources/phpSysInfo/config.php /opt/egroupware/html/phpsysinfo/ |
echo "Preparing phpSysInfo..." |
221 |
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/ |
222 |
|
cp -f /usr/share/doc/eGroupWare-1.8.005/Sources/phpSysInfo/Redhat.png /usr/share/egroupware/phpsysinfo/images/ |
223 |
echo "Cleaning Install..." |
|
224 |
rm -rf /opt/egroupware/egroupware |
#echo "Cleaning Install..." |
225 |
rm -rf /opt/egroupware/html/debian |
#rm -rf /opt/egroupware/egroupware |
226 |
rm -f /opt/egroupware/html/.htaccess |
#rm -rf /opt/egroupware/html/debian |
227 |
|
#rm -f /opt/egroupware/html/.htaccess |
228 |
echo "Setting file access rules:" |
|
229 |
cd /opt/egroupware |
#echo "Setting file access rules:" |
230 |
echo " - Changing owner recursivly..." |
#cd /opt/egroupware |
231 |
chown -R root:root /opt/egroupware/html |
#echo " - Changing owner recursivly..." |
232 |
echo " - Recursive CHMOD 755 on folders..." |
#chown -R root:root /opt/egroupware/html |
233 |
find html -type d -exec chmod 755 {} \; |
#echo " - Recursive CHMOD 755 on folders..." |
234 |
echo " - Recursive CHMOD 644 on files..." |
#find html -type d -exec chmod 755 {} \; |
235 |
find html -type f -exec chmod 644 {} \; |
#echo " - Recursive CHMOD 644 on files..." |
236 |
echo " - Customization of CHMOD for a few folders..." |
#find html -type f -exec chmod 644 {} \; |
237 |
chmod 770 /opt/egroupware/backup |
#echo " - Customization of CHMOD for a few folders..." |
238 |
chmod 770 /opt/egroupware/files |
#chmod 770 /opt/egroupware/backup |
239 |
chmod 770 /opt/egroupware/files/g2data |
#chmod 770 /opt/egroupware/files |
240 |
chmod 770 /opt/egroupware/tmp |
#chmod 770 /opt/egroupware/files/g2data |
241 |
chown www:www /opt/egroupware/backup |
#chmod 770 /opt/egroupware/tmp |
242 |
chown www:www /opt/egroupware/files |
#chown www:www /opt/egroupware/backup |
243 |
chown www:www /opt/egroupware/files/g2data |
#chown www:www /opt/egroupware/files |
244 |
chown www:www /opt/egroupware/tmp |
#chown www:www /opt/egroupware/files/g2data |
245 |
|
#chown www:www /opt/egroupware/tmp |
246 |
if [ "$UPDATE" = "0" ] ; then |
|
247 |
echo "Preparing Site-Mgr..." |
# fixed this one adding .php, not sure if still necessary |
248 |
cd /opt/egroupware/html |
#if [ "$UPDATE" = "0" ] ; then |
249 |
ln -s sitemgr/sitemgr-link |
# echo "Preparing Site-Mgr..." |
250 |
fi |
# cd /usr/share/egroupware |
251 |
|
# ln -s sitemgr/sitemgr-link.php |
252 |
|
#fi |
253 |
|
|
254 |
echo "Preparing header.inc.php..." |
echo "Preparing header.inc.php..." |
255 |
case $UPDATE in |
# if first install |
256 |
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 |
257 |
*) mv -f /opt/egroupware/html/header.inc.php /opt/egroupware/ 2>/dev/null ;; |
# 0) |
258 |
esac |
sed 's.egwpass.'$EGPASS'.g' /usr/share/doc/eGroupWare-1.8.005/Sources/header.inc.php > /usr/share/egroupware/header.inc.php |
259 |
chown www:www /opt/egroupware/header.inc.php |
echo " done!" |
260 |
chmod 640 /opt/egroupware/header.inc.php |
fi |
261 |
cd /opt/egroupware/html |
# *) mv -f /opt/egroupware/html/header.inc.php /opt/egroupware/ 2>/dev/null ;; |
262 |
ln -s ../header.inc.php 2>/dev/null |
#esacc |
263 |
|
#chown www:www /opt/egroupware/header.inc.php |
264 |
|
#chmod 640 /opt/egroupware/header.inc.php |
265 |
|
#cd /opt/egroupware/html |
266 |
|
#ln -s ../header.inc.php 2>/dev/null |
267 |
|
echo " " |
268 |
|
|
269 |
|
# the integration is complete Ithink now..... |
270 |
echo "Preparing Gallery2..." |
echo "Preparing Gallery2..." |
271 |
if [ -f /opt/egroupware/html/gallery/gallery2/config.php ] ; then |
if [ -f /usr/share/egroupware/gallery/gallery2/config.php ] ; then |
272 |
touch /opt/egroupware/html/gallery/gallery2/config.php |
touch /usr/share/egroupware/gallery/gallery2/config.php |
273 |
else |
else |
274 |
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 |
275 |
fi |
fi |
276 |
chmod 640 /opt/egroupware/html/gallery/gallery2/config.php |
|
277 |
chown www:www /opt/egroupware/html/gallery/gallery2/config.php |
chmod 640 /usr/share/egroupware/gallery/gallery2/config.php |
278 |
|
chown www:www /usr/share/egroupware/gallery/gallery2/config.php |
279 |
echo " " |
echo " " |
280 |
|
|
281 |
|
### this one will be done by event |
282 |
echo "MySQL installation:" |
echo "MySQL installation:" |
283 |
if [ "$UPDATE" = "0" ] ; then |
#if [ "$UPDATE" = "0" ] ; then |
284 |
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/ |
285 |
fi |
#fi |
286 |
/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 |
287 |
|
/sbin/e-smith/expand-template /etc/e-smith/sql/init/81egw_default |
288 |
/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 |
289 |
/etc/rc.d/init.d/mysql.init start |
/etc/rc.d/init.d/mysql.init start |
290 |
echo " " |
echo " " |
349 |
|
|
350 |
%preun |
%preun |
351 |
if [ $1 = 0 ] ; then |
if [ $1 = 0 ] ; then |
352 |
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/ |
353 |
fi |
fi |
354 |
|
|
355 |
|
|