/[packages]/cauldron/roundcubemail/current/SPECS/roundcubemail.spec
ViewVC logotype

Annotation of /cauldron/roundcubemail/current/SPECS/roundcubemail.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30