/[packages]/updates/5/roundcubemail/current/SPECS/roundcubemail.spec
ViewVC logotype

Contents of /updates/5/roundcubemail/current/SPECS/roundcubemail.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1006128 - (show annotations) (download)
Mon Apr 25 14:58:16 2016 UTC (7 years, 11 months ago) by spuhler
File size: 10013 byte(s)
- upgrade to version 1.0.9
  * This fixes security issue CVE-2015-2181, CVE-2015-8864, CVE-2016-4069
1 %global __requires_exclude pear\\(vendor/autoload.php\\)|pear\\(xmlapi.php\\)|pear\\(Console/CommandLine.php\\)
2 ## pear(xmlapi.php) may need to be packaged, but for the time being a bug has been filed
3 %define oname %{name}-%{version}
4
5 %global php_inidir %{_sysconfdir}/php.d
6
7 # Paths. Do not include trailing slash
8 %global roundcube %{_datadir}/roundcubemail
9 %global roundcube_plugins %{roundcube}/plugins
10 %global roundcube_conf %{_sysconfdir}/roundcubemail
11 %global roundcube_log %{_logdir}/roundcubemail
12 %global roundcube_lib %{_localstatedir}/lib/roundcubemail
13
14 Name: roundcubemail
15 Version: 1.0.9
16 Release: %mkrel 1
17 Summary: Round Cube Webmail is a browser-based multilingual IMAP client
18 Group: System/Servers
19 License: GPLv3
20 # Use the -dep tarballs. These use system copies of the PHP stuff
21 # rather than including them, which is better for our purposes.
22 # - AdamW 2007/07
23 URL: http://www.roundcube.net/
24 Source0: http://downloads.sourceforge.net/%{name}/%{oname}.tar.gz
25 Source1: roundcubemail.conf
26 Source2: roundcubemail.logrotate
27 Source3: roundcubemail-README.mageia
28 # Elegantly handle removal of moxieplayer Flash binary in tinymce
29 # media plugin (see "Drop precompiled flash" in %%prep)
30 Patch0: roundcubemail-0.9.3-no_swf.patch
31 Epoch: 1
32 BuildRequires: pcre-devel
33 Requires: apache-mod_php
34 Requires: php-gd
35 Requires: php-gettext
36 Requires: php-iconv
37 Requires: php-mbstring
38 Requires: php-mcrypt
39 Requires: php-openssl
40 Requires: php-session
41 Requires: php-pdo_mysql
42 Requires: php-pear-Auth_SASL
43 Requires: php-pear-Mail_Mime
44 Requires: php-pear-Mail_mimeDecode
45 Requires: php-pear-Net_SMTP
46 Requires: php-pear-Net_LDAP2
47 Requires: php-pear-Net_Sieve
48 Requires: php-pear-Net_Socket
49 Requires: php-pear-MDB2
50 Requires: php-pear-Net_IDNA2
51 Requires(pre): php-pear >= 1.9.0
52 Requires: php-xml
53 Requires: php-pear-Crypt_GPG
54 # The installer suggests the use of these, but they're not
55 # required - AdamW 2011/01
56 Recommends: php-fileinfo
57 Recommends: php-intl
58 Recommends: php-pear-MDB2_Driver_mysql
59 Recommends: php-zip
60 BuildArch: noarch
61
62 %description
63 RoundCube Webmail is a browser-based multilingual IMAP client with an
64 application-like user interface. It provides full functionality you
65 expect from an e-mail client, including MIME support, address book,
66 folder manipulation, message searching and spell checking.
67 RoundCube Webmail is written in PHP and requires a database: MariaDB,
68 PostgreSQL and SQLite are known to work.
69 The user interface is fully skinnable using XHTML and CSS 2.
70
71 %prep
72 %setup -q -n %{oname}
73 %patch0 -p1
74
75 # remove any reference to sqlite in config file so people don't mistakely
76 # assume it works
77 sed -i '/sqlite/d' config/defaults.inc.php
78 sed -i 's/\r//' SQL/mssql.initial.sql
79
80 # Drop precompiled flash
81 find . -type f -name '*.swf' | xargs rm -f
82
83 # Wipe bbcode plugin from bundled TinyMCE to make doubleplus sure we cannot
84 # be vulnerable to CVE-2012-4230, unaddressed upstream
85 echo "CVE-2012-4230: removing tinymce bbcode plugin, check path if this fails."
86 test -d program/js/*mce/plugins/bbcode && rm -rf program/js/*mce/plugins/bbcode || exit 1
87
88
89 %build
90
91 %install
92 install -d %{buildroot}%{roundcube}
93 cp -pr ./* %{buildroot}%{roundcube}
94 cp -a ./.htaccess %{buildroot}%{roundcube}/.htaccess
95 # Remove settings from .htaccess we don't want
96 sed -i \
97 -e '/memory_limit/d' \
98 -e '/post_max_size/d' \
99 -e '/upload_max_filesize/d' \
100 %{buildroot}%{roundcube}/.htaccess
101
102 rm -rf %{buildroot}%{roundcube}/installer
103
104 mkdir -p %{buildroot}%{_webappconfdir}
105 cp -pr %SOURCE1 %{buildroot}%{_webappconfdir}
106
107
108 mkdir -p %{buildroot}%{roundcube_conf}
109 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
110 cp -pr %SOURCE2 %{buildroot}%{_sysconfdir}/logrotate.d/roundcubemail
111
112 mkdir -p %{buildroot}%{roundcube_lib}/plugins/enigma
113 mkdir -p %{buildroot}%{roundcube_log}
114
115 # use dist files as config files
116 mv %{buildroot}%{roundcube}/config/config.inc.php.sample %{buildroot}%{roundcube_conf}/config.inc.php
117 mv %{buildroot}%{roundcube}/config/defaults.inc.php %{buildroot}%{roundcube_conf}/defaults.inc.php
118 # keep any other config files too
119 mv %{buildroot}%{roundcube}/config/* %{buildroot}%{roundcube_conf}/
120 rm -rf %{buildroot}%{roundcube}/config
121 rm -rf %{buildroot}%{roundcube}/logs
122 rm -rf %{buildroot}%{roundcube}/temp
123
124 pushd %{buildroot}%{roundcube}
125 ln -s ../../..%{roundcube_conf} config
126 ln -s ../../..%{roundcube_log} logs
127 ln -s ../../..%{roundcube_lib} temp
128 popd
129
130 # Enigma
131 mv %{buildroot}%{roundcube_plugins}/enigma/config.inc.php.dist %{buildroot}%{roundcube_conf}/enigma.inc.php
132 rm -rf %{buildroot}%{roundcube_plugins}/enigma/config.inc.php
133 pushd %{buildroot}%{roundcube_plugins}/enigma
134 ln -s ../../../../..%{roundcube_conf}/enigma.inc.php config.inc.php
135 rm -rf home/
136 ln -s ../../../../..%{roundcube_lib}/plugins/enigma/ home
137 popd
138 mkdir -p %{buildroot}%{roundcube_lib}/plugins/enigma
139
140 # ACL plugin
141 mv %{buildroot}%{roundcube_plugins}/acl/config.inc.php.dist %{buildroot}%{roundcube_conf}/acl.inc.php
142 rm -rf %{buildroot}%{roundcube_plugins}/acl/config.inc.php
143 pushd %{buildroot}%{roundcube_plugins}/acl/
144 ln -s ../../../../..%{roundcube_conf}/acl.inc.php config.inc.php
145 popd
146
147 # Managesieve plugin
148 mv %{buildroot}%{roundcube_plugins}/managesieve/config.inc.php.dist %{buildroot}%{roundcube_conf}/managesieve.inc.php
149 pushd %{buildroot}%{roundcube_plugins}/managesieve/
150 ln -s ../../../../..%{roundcube_conf}/managesieve.inc.php config.inc.php
151 popd
152
153 # Password plugin
154 mv %{buildroot}%{roundcube_plugins}/password/config.inc.php.dist %{buildroot}%{roundcube_conf}/password.inc.php
155 pushd %{buildroot}%{roundcube_plugins}/password/
156 ln -s ../../../../..%{roundcube_conf}/password.inc.php config.inc.php
157 popd
158
159 # clean up the buildroot
160 rm -rf %{buildroot}%{roundcube}/{CHANGELOG,INSTALL,LICENSE,README,UPGRADING,SQL}
161
162 # Fix anything executable that does not have a shebang
163 for file in `find %{buildroot}/%{roundcube} -type f -perm /a+x`; do
164 [ -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 644 $file
165 done
166
167 # Find files with a shebang that do not have executable permissions
168 for file in `find %{buildroot}/%{roundcube} -type f ! -perm /a+x`; do
169 [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 755 $file
170 done
171
172 # Find files that have non-standard-executable-perm
173 find %{buildroot}/%{roundcube} -type f -perm /g+wx -exec chmod -v g-w {} \;
174
175 # Find files that are not readable
176 find %{buildroot}/%{roundcube} -type f ! -perm /go+r -exec chmod -v go+r {} \;
177
178 #
179 # Exclude the following external libraries
180 #
181 # php-pear-Net-IDNA2
182 rm -rf %{buildroot}/%{roundcube}/program/lib/Net/IDNA2/ \
183 %{buildroot}/%{roundcube}/program/lib/Net/IDNA2.php
184 # php-pear-Net-SMTP
185 rm -rf %{buildroot}/%{roundcube}/program/lib/Net/SMTP.php
186 # php-pear-Net-Socket
187 rm -rf %{buildroot}/%{roundcube}/program/lib/Net/Socket.php
188 # php-pear-Mail
189 rm -rf %{buildroot}/%{roundcube}/program/lib/Mail/
190 # php-pear-MDB2
191 rm -rf %{buildroot}/%{roundcube}/program/lib/MDB2/ \
192 %{buildroot}/%{roundcube}/program/lib/MDB2.php
193 # php-pear
194 rm -rf %{buildroot}/%{roundcube}/program/lib/PEAR.php \
195 %{buildroot}/%{roundcube}/program/lib/PEAR5.php
196 # php-pear-Net-Sieve
197 rm -rf %{buildroot}/%{roundcube_plugins}/managesieve/lib/Net
198
199
200 %pre
201 # needed if you have kolab installed
202 if [ -f "/etc/roundcubemail/kolab.inc.php" ]; then
203 mv /etc/roundcubemail/kolab.inc.php /etc/roundcubemail/libkolab.inc.php
204 fi
205
206 if [ -L %{roundcube_plugins}/enigma/home -a ! -d %{roundcube_plugins}/enigma/home ]; then
207 rm -rf %{roundcube_plugins}/enigma/home >/dev/null 2>&1 || :
208 fi
209
210
211
212 %post
213 # replace default des string in config file for better security
214 function makedesstr () {
215 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
216 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)
217
218 max=${#chars[*]}
219
220 for i in `seq 1 24`; do
221 let rand=${RANDOM}%%${max}
222 str="${str}${chars[$rand]}"
223 done
224 echo $str
225 }
226
227 sed -i "s/rcmail-\!24ByteDESkey\*Str/`makedesstr`/" /etc/roundcubemail/defaults.inc.php || : &> /dev/null
228
229 sed -i -r -e "s/.*(\s*define\(\s*'RCMAIL_VERSION'\s*,\s*').*('\);)/\1%{version}-%{release}\2/g" \
230 %{roundcube}/program/include/iniset.php || :
231
232 if [ -f "%{php_inidir}/99_apcu.ini" ]; then
233 if [ ! -z "`grep ^apcu.enabled=1 %{php_inidir}/99_apc.ini`" ]; then
234
235 /sbin/systemctl condrestart %{httpd_name}
236
237 fi
238 fi
239
240 /usr/share/roundcubemail/bin/updatedb.sh \
241 --dir /usr/share/doc/roundcubemail/SQL/ \
242 --package roundcube || : \
243 >/dev/null 2>&1
244
245 exit 0
246
247 cat > README.urpmi <<EOF
248 WARNING: when upgrading from <= 0.9.5 the old configuration files named
249 main.inc.php and db.inc.php are now deprecated and should be replaced
250 with one single config.inc.php file. Run the ./bin/update.sh script to
251 get this conversion done or manually merge the files.
252 Also see the UPGRADE file in the doc section.
253 NOTE: the new config.inc.php should only contain options that differ
254 from the ones listed in defaults.inc.php.
255 EOF
256
257 %files
258 %doc CHANGELOG INSTALL LICENSE README.md SQL UPGRADING
259 %{_datadir}/%{name}
260 %dir %{_sysconfdir}/%{name}
261 %attr(0755,root,apache)%{_logdir}/%{name}
262 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
263 # Lets write out them specifically, so we can see when additional files are added (or deleted)
264 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/acl.inc.php
265 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/defaults.inc.php
266 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
267 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/enigma.inc.php
268 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/managesieve.inc.php
269 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/mimetypes.php
270 %attr(0640,root,apache)%config(noreplace) %{_sysconfdir}/%{name}/password.inc.php
271 %config(noreplace) %{_webappconfdir}/%{name}.conf
272 %attr(0775,root,apache) %dir %{_localstatedir}/lib/roundcubemail
273 %attr(0770,root,apache) %dir %{_localstatedir}/lib/roundcubemail/plugins
274 %attr(0770,root,apache) %dir %{_localstatedir}/lib/roundcubemail/plugins/enigma
275

  ViewVC Help
Powered by ViewVC 1.1.30