1 |
%global __requires_exclude pear\\(vendor/autoload.php\\)|pear\\(xmlapi.php\\) |
2 |
## pear(xmlapi.php) may need to be packaged, but for the time being a bug has been filed |
3 |
|
4 |
# Paths. Do not include trailing slash |
5 |
%global roundcube %{_datadir}/roundcubemail |
6 |
%global roundcube_plugins %{roundcube}/plugins |
7 |
%global roundcube_conf %{_sysconfdir}/roundcubemail |
8 |
%global roundcube_log %{_logdir}/roundcubemail |
9 |
%global roundcube_lib %{_localstatedir}/lib/roundcubemail |
10 |
|
11 |
# disable python byte compiler |
12 |
%global _python_bytecompile_extra 0 |
13 |
# skip dependancy |
14 |
%define __requires_exclude TinyCPConnector.php |
15 |
|
16 |
Name: roundcubemail |
17 |
Version: 1.6.6 |
18 |
Release: %mkrel 1 |
19 |
Summary: Round Cube Webmail is a browser-based multilingual IMAP client |
20 |
Group: System/Servers |
21 |
License: GPLv3 |
22 |
# Use the -dep tarballs. These use system copies of the PHP stuff |
23 |
# rather than including them, which is better for our purposes. |
24 |
# - AdamW 2007/07 |
25 |
URL: https://www.roundcube.net/ |
26 |
Source0: https://github.com/roundcube/roundcubemail/releases/download/%{version}/%{name}-%{version}-complete.tar.gz |
27 |
Source1: roundcubemail.conf |
28 |
Source2: roundcubemail.logrotate |
29 |
Source3: roundcubemail-README.mageia |
30 |
Patch1: py2-fix.patch |
31 |
Epoch: 1 |
32 |
Requires: php-webinterface |
33 |
Requires: php-curl |
34 |
Requires: php-dom |
35 |
Requires: php-fileinfo |
36 |
Requires: php-filter |
37 |
Requires: php-gd |
38 |
Requires: php-hash |
39 |
Requires: php-iconv |
40 |
Requires: php-intl |
41 |
Requires: php-json |
42 |
Requires: php-ldap |
43 |
Requires: php-mbstring |
44 |
Requires: php-openssl |
45 |
Requires: php-pcre |
46 |
Requires: php-pdo |
47 |
Requires: php-session |
48 |
Requires: php-simplexml |
49 |
Requires: php-sockets |
50 |
Requires: php-xml |
51 |
Requires: php-pear >= 1.10.1 |
52 |
Requires: php-pear-Auth_SASL >= 1.1.0 |
53 |
Requires: php-pear-Console_CommandLine |
54 |
Requires: php-pear-Crypt_GPG >= 1.6.0 |
55 |
Requires: php-pear-Net_Socket >= 1.2.1 |
56 |
Requires: php-pear-Mail_Mime >= 1.10.0 |
57 |
Requires: php-pear-Net_SMTP >= 1.7.1 |
58 |
Requires: php-pear-Net_Sieve >= 1.4.0 |
59 |
Requires: php-pear-Net_LDAP2 >= 2.2.0 |
60 |
Requires(pre): php-pear >= 1.9.0 |
61 |
Requires: php-exif |
62 |
Suggests: php-zip |
63 |
Suggests: php-enchant |
64 |
Provides: roundcubemail-skin-larry |
65 |
Provides: roundcubemail-skin-classic |
66 |
Provides: roundcubemail-plugin-jqueryui |
67 |
Provides: roundcubemail-plugin-acl |
68 |
BuildArch: noarch |
69 |
BuildRequires: mercurial |
70 |
|
71 |
%description |
72 |
RoundCube Webmail is a browser-based multilingual IMAP client with an |
73 |
application-like user interface. It provides full functionality you |
74 |
expect from an e-mail client, including MIME support, address book, |
75 |
folder manipulation, message searching and spell checking. |
76 |
RoundCube Webmail is written in PHP and requires a database: MariaDB, |
77 |
PostgreSQL and SQLite are known to work. |
78 |
The user interface is fully skinnable using XHTML and CSS 2. |
79 |
|
80 |
%prep |
81 |
%autosetup -S hg |
82 |
|
83 |
find . -type f -name \.htaccess -print | xargs rm -f |
84 |
find . -type f -name '*.orig' -print | xargs rm -f |
85 |
|
86 |
# Wipe bbcode plugin from bundled TinyMCE to make doubleplus sure we cannot |
87 |
# be vulnerable to CVE-2012-4230, unaddressed upstream |
88 |
echo "CVE-2012-4230: removing tinymce bbcode plugin, check path if this fails." |
89 |
test -d program/js/*mce/plugins/bbcode && rm -rf program/js/*mce/plugins/bbcode || exit 1 |
90 |
|
91 |
%build |
92 |
|
93 |
%install |
94 |
install -d %{buildroot}%{roundcube} |
95 |
cp -pr ./* %{buildroot}%{roundcube} |
96 |
|
97 |
mkdir -p %{buildroot}%{_webappconfdir} |
98 |
cp -pr %SOURCE1 %{buildroot}%{_webappconfdir} |
99 |
|
100 |
|
101 |
mkdir -p %{buildroot}%{roundcube_conf} |
102 |
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d |
103 |
cp -pr %SOURCE2 %{buildroot}%{_sysconfdir}/logrotate.d/roundcubemail |
104 |
|
105 |
mkdir -p %{buildroot}%{roundcube_lib}/plugins/enigma |
106 |
mkdir -p %{buildroot}%{roundcube_log} |
107 |
|
108 |
# use dist files as config files |
109 |
mv %{buildroot}%{roundcube}/config/config.inc.php.sample \ |
110 |
%{buildroot}%{roundcube_conf}/config.inc.php |
111 |
mv %{buildroot}%{roundcube}/config/defaults.inc.php \ |
112 |
%{buildroot}%{roundcube_conf}/defaults.inc.php |
113 |
# keep any other config files too |
114 |
mv %{buildroot}%{roundcube}/config/* %{buildroot}%{roundcube_conf}/ |
115 |
rm -rf %{buildroot}%{roundcube}/config |
116 |
rm -rf %{buildroot}%{roundcube}/logs |
117 |
rm -rf %{buildroot}%{roundcube}/temp |
118 |
|
119 |
pushd %{buildroot}%{roundcube} |
120 |
ln -s ../../..%{roundcube_conf} config |
121 |
ln -s ../../..%{roundcube_log} logs |
122 |
ln -s ../../..%{roundcube_lib} temp |
123 |
popd |
124 |
|
125 |
# Enigma |
126 |
mv %{buildroot}%{roundcube_plugins}/enigma/config.inc.php.dist %{buildroot}%{roundcube_conf}/enigma.inc.php |
127 |
rm -rf %{buildroot}%{roundcube_plugins}/enigma/{config.inc.php,tests} |
128 |
pushd %{buildroot}%{roundcube_plugins}/enigma |
129 |
ln -s ../../../../..%{roundcube_conf}/enigma.inc.php config.inc.php |
130 |
rm -rf home/ |
131 |
ln -s ../../../../..%{roundcube_lib}/plugins/enigma/ home |
132 |
popd |
133 |
mkdir -p %{buildroot}%{roundcube_lib}/plugins/enigma |
134 |
|
135 |
# ACL plugin |
136 |
mv %{buildroot}%{roundcube_plugins}/acl/config.inc.php.dist %{buildroot}%{roundcube_conf}/acl.inc.php |
137 |
rm -rf %{buildroot}%{roundcube_plugins}/acl/{config.inc.php,tests} |
138 |
pushd %{buildroot}%{roundcube_plugins}/acl/ |
139 |
ln -s ../../../../..%{roundcube_conf}/acl.inc.php config.inc.php |
140 |
popd |
141 |
|
142 |
# Managesieve plugin |
143 |
mv %{buildroot}%{roundcube_plugins}/managesieve/config.inc.php.dist %{buildroot}%{roundcube_conf}/managesieve.inc.php |
144 |
rm -rf %{buildroot}%{roundcube_plugins}/managesieve/tests |
145 |
pushd %{buildroot}%{roundcube_plugins}/managesieve/ |
146 |
ln -s ../../../../..%{roundcube_conf}/managesieve.inc.php config.inc.php |
147 |
popd |
148 |
|
149 |
# Password plugin |
150 |
mv %{buildroot}%{roundcube_plugins}/password/config.inc.php.dist %{buildroot}%{roundcube_conf}/password.inc.php |
151 |
rm -rf %{buildroot}%{roundcube_plugins}/password/tests |
152 |
pushd %{buildroot}%{roundcube_plugins}/password/ |
153 |
ln -s ../../../../..%{roundcube_conf}/password.inc.php config.inc.php |
154 |
popd |
155 |
|
156 |
# clean up the buildroot |
157 |
rm -f %{buildroot}%{roundcube}/{CHANGELOG,INSTALL,LICENSE,README.md,UPGRADING} |
158 |
rm -f %{buildroot}%{roundcube}/composer.json-dist |
159 |
|
160 |
# |
161 |
# Exclude the following external libraries |
162 |
# |
163 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/net_idna2 |
164 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/net_ldap2 |
165 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/net_smtp |
166 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/net_socket |
167 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/net_sieve |
168 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/pear-core-minimal |
169 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/mail_mime |
170 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/auth_sasl |
171 |
rm -rf %{buildroot}/%{roundcube}/vendor/pear/console_commandline |
172 |
|
173 |
%pre |
174 |
# needed if you have kolab installed |
175 |
if [ -f "/etc/roundcubemail/kolab.inc.php" ]; then |
176 |
mv /etc/roundcubemail/kolab.inc.php /etc/roundcubemail/libkolab.inc.php |
177 |
fi |
178 |
|
179 |
if [ -L %{roundcube_plugins}/enigma/home -a ! -d %{roundcube_plugins}/enigma/home ]; then |
180 |
rm -rf %{roundcube_plugins}/enigma/home >/dev/null 2>&1 || : |
181 |
fi |
182 |
|
183 |
%post |
184 |
if [ "$1" = 1 ]; then |
185 |
# replace default des string in config file for better security |
186 |
chars=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A |
187 |
B C D E F G H I J K L M N O P Q R S T U V W X Y Z) |
188 |
|
189 |
max=${#chars[*]} |
190 |
|
191 |
for i in `seq 1 24`; do |
192 |
let rand=${RANDOM}%%${max} |
193 |
key="${key}${chars[$rand]}" |
194 |
done |
195 |
|
196 |
sed -i \ |
197 |
-e "s/\$config\['des_key'\] = '[^']\+';/\$config['des_key'] = '$key';/" \ |
198 |
-e "/YOUR KEY MUST BE DIFFERENT/d" \ |
199 |
/etc/roundcubemail/config.inc.php || : &> /dev/null |
200 |
fi |
201 |
|
202 |
%files |
203 |
%doc INSTALL LICENSE README.md SQL UPGRADING |
204 |
%{_datadir}/%{name} |
205 |
%dir %{_sysconfdir}/%{name} |
206 |
%attr(0755,apache,apache)%{_logdir}/%{name} |
207 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
208 |
# Lets write out them specifically, so we can see when additional files are added (or deleted) |
209 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/acl.inc.php |
210 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/defaults.inc.php |
211 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/config.inc.php |
212 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/enigma.inc.php |
213 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/managesieve.inc.php |
214 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/mimetypes.php |
215 |
%attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/password.inc.php |
216 |
%config(noreplace) %{_webappconfdir}/%{name}.conf |
217 |
%attr(0755,apache,apache) %dir %{_localstatedir}/lib/roundcubemail |
218 |
%attr(0750,apache,apache) %dir %{_localstatedir}/lib/roundcubemail/plugins |
219 |
%attr(0750,apache,apache) %dir %{_localstatedir}/lib/roundcubemail/plugins/enigma |
220 |
|