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

  ViewVC Help
Powered by ViewVC 1.1.30