[roundcubemail] - Update to 1.0.0 - provide the installer - cleanup some config options from previous version - requ

Remi Collet remi at fedoraproject.org
Thu May 8 15:08:00 UTC 2014


commit 0fe0630791a9b0bea6f8e98fa5bf77250854815a
Author: Remi Collet <remi at fedoraproject.org>
Date:   Thu May 8 17:08:21 2014 +0200

    - Update to 1.0.0
    - provide the installer
    - cleanup some config options from previous version
    - requires mailcap for /etc/mime.types
    - explicitly requires all needed extensions

 .gitignore                         |    1 +
 roundcubemail-0.9.0-confpath.patch |   23 ------
 roundcubemail-1.0.0-confpath.patch |   81 +++++++++++++++++++++
 roundcubemail-README.fedora        |   40 ----------
 roundcubemail-README.rpm           |   32 ++++++++
 roundcubemail.conf                 |   30 ++++++++
 roundcubemail.spec                 |  138 +++++++++++++++++++++---------------
 sources                            |    2 +-
 8 files changed, 227 insertions(+), 120 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5fea23e..43ba82e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ roundcubemail-0.3.1-dep.tar.gz
 /roundcubemail-0.9.3-dep.tar.gz
 /roundcubemail-0.9.4-dep.tar.gz
 /roundcubemail-0.9.5-dep.tar.gz
+/roundcubemail-1.0.0-dep.tar.gz
diff --git a/roundcubemail-1.0.0-confpath.patch b/roundcubemail-1.0.0-confpath.patch
new file mode 100644
index 0000000..8256f06
--- /dev/null
+++ b/roundcubemail-1.0.0-confpath.patch
@@ -0,0 +1,81 @@
+diff -up roundcubemail-1.0.0-dep/config/defaults.inc.php.rpm roundcubemail-1.0.0-dep/config/defaults.inc.php
+--- roundcubemail-1.0.0-dep/config/defaults.inc.php.rpm	2014-04-06 16:13:17.000000000 +0200
++++ roundcubemail-1.0.0-dep/config/defaults.inc.php	2014-05-08 16:30:40.712838264 +0200
+@@ -293,10 +293,10 @@ $config['user_aliases'] = false;
+ 
+ // use this folder to store log files (must be writeable for apache user)
+ // This is used by the 'file' log driver.
+-$config['log_dir'] = RCUBE_INSTALL_PATH . 'logs/';
++$config['log_dir'] = '/var/log/roundcubemail/';
+ 
+ // use this folder to store temp files (must be writeable for apache user)
+-$config['temp_dir'] = RCUBE_INSTALL_PATH . 'temp/';
++$config['temp_dir'] = '/var/lib/roundcubemail/';
+ 
+ // expire files in temp_dir after 48 hours
+ // possible units: s, m, h, d, w
+@@ -474,7 +474,7 @@ $config['mime_magic'] = null;
+ // This is used to derive mime-types from the filename extension or vice versa.
+ // Such a file is usually part of the apache webserver. If you don't find a file named mime.types on your system,
+ // download it from http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+-$config['mime_types'] = null;
++$config['mime_types'] = '/etc/mime.types';
+ 
+ // path to imagemagick identify binary
+ $config['im_identify_path'] = null;
+diff -up roundcubemail-1.0.0-dep/installer/index.php.rpm roundcubemail-1.0.0-dep/installer/index.php
+--- roundcubemail-1.0.0-dep/installer/index.php.rpm	2014-04-06 16:13:17.000000000 +0200
++++ roundcubemail-1.0.0-dep/installer/index.php	2014-05-08 16:30:40.712838264 +0200
+@@ -41,7 +41,7 @@ ini_set('display_errors', 1);
+ 
+ define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
+ define('RCUBE_INSTALL_PATH', INSTALL_PATH);
+-define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/');
++define('RCUBE_CONFIG_DIR', '/etc/roundcubemail/');
+ 
+ $include_path  = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
+ $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
+diff -up roundcubemail-1.0.0-dep/installer/rcube_install.php.rpm roundcubemail-1.0.0-dep/installer/rcube_install.php
+--- roundcubemail-1.0.0-dep/installer/rcube_install.php.rpm	2014-05-08 16:30:44.987857419 +0200
++++ roundcubemail-1.0.0-dep/installer/rcube_install.php	2014-05-08 16:30:54.986902235 +0200
+@@ -490,7 +490,6 @@ class rcube_install
+     $types = array(
+       'application/zip'   => 'zip',
+       'application/x-tar' => 'tar',
+-      'application/java-archive' => 'jar',
+       'image/gif'     => 'gif',
+       'image/svg+xml' => 'svg',
+     );
+diff -up roundcubemail-1.0.0-dep/program/include/iniset.php.rpm roundcubemail-1.0.0-dep/program/include/iniset.php
+--- roundcubemail-1.0.0-dep/program/include/iniset.php.rpm	2014-04-06 16:13:17.000000000 +0200
++++ roundcubemail-1.0.0-dep/program/include/iniset.php	2014-05-08 16:30:40.712838264 +0200
+@@ -29,7 +29,7 @@ if (!defined('INSTALL_PATH')) {
+ }
+ 
+ if (!defined('RCMAIL_CONFIG_DIR')) {
+-    define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
++    define('RCMAIL_CONFIG_DIR', '/etc/roundcubemail');
+ }
+ 
+ if (!defined('RCUBE_LOCALIZATION_DIR')) {
+@@ -37,7 +37,7 @@ if (!defined('RCUBE_LOCALIZATION_DIR'))
+ }
+ 
+ define('RCUBE_INSTALL_PATH', INSTALL_PATH);
+-define('RCUBE_CONFIG_DIR',  RCMAIL_CONFIG_DIR.'/');
++define('RCUBE_CONFIG_DIR', '/etc/roundcubemail/');
+ 
+ 
+ // RC include folders MUST be included FIRST to avoid other
+diff -up roundcubemail-1.0.0-dep/program/lib/Roundcube/bootstrap.php.rpm roundcubemail-1.0.0-dep/program/lib/Roundcube/bootstrap.php
+--- roundcubemail-1.0.0-dep/program/lib/Roundcube/bootstrap.php.rpm	2014-04-06 16:13:18.000000000 +0200
++++ roundcubemail-1.0.0-dep/program/lib/Roundcube/bootstrap.php	2014-05-08 16:30:40.712838264 +0200
+@@ -66,7 +66,7 @@ if (!defined('RCUBE_INSTALL_PATH')) {
+ }
+ 
+ if (!defined('RCUBE_CONFIG_DIR')) {
+-    define('RCUBE_CONFIG_DIR', RCUBE_INSTALL_PATH . 'config/');
++    define('RCUBE_CONFIG_DIR', '/etc/roundcubemail/');
+ }
+ 
+ if (!defined('RCUBE_PLUGINS_DIR')) {
diff --git a/roundcubemail-README.rpm b/roundcubemail-README.rpm
new file mode 100644
index 0000000..b57cc83
--- /dev/null
+++ b/roundcubemail-README.rpm
@@ -0,0 +1,32 @@
+Additional installation and update information:
+
+Upstream documentation: http://trac.roundcube.net/wiki
+
+Notice
+- temporary files are stored in /var/lib/roundcubemail
+- logs files are stored in /var/log/roundcubemail
+- configuration files are stored in /etc/roundcubemail
+
+As those directories are not served by the web server,
+there is no need to protect them.
+
+
+
+The installer is available at http://localhost/roundcubemail/installer
+
+Access is only authorized from the server, locally.
+You can enlarge access for installation, but remember to secure it
+again once configured (upstream recommend to drop the directory).
+
+The Wemail is available at http://localhost/roundcubemail
+
+You can enlarde permission once configured.
+
+Set /etc/httpd/conf.d/roundcubemail.conf
+
+
+WARNING: when upgrading from < 1.0 the old configuration files named main.inc.php
+and db.inc.php are now deprecated and should be replaced with one single config.inc.php file.
+Run the ./bin/update.sh script to get this conversion done or manually merge the files.
+
+NOTE: the new config.inc.php should only contain options that differ from the ones listed in defaults.inc.php.
diff --git a/roundcubemail.conf b/roundcubemail.conf
index 5911949..5b67c20 100644
--- a/roundcubemail.conf
+++ b/roundcubemail.conf
@@ -4,6 +4,9 @@
 
 Alias /roundcubemail /usr/share/roundcubemail
 
+# Define who can access the Webmail
+# You can enlarge permissions once configured
+
 <Directory /usr/share/roundcubemail/>
     <IfModule mod_authz_core.c>
         # Apache 2.4
@@ -17,3 +20,30 @@ Alias /roundcubemail /usr/share/roundcubemail
         Allow from ::1
     </IfModule>
 </Directory>
+
+# Define who can access the installer
+# keep this secured once configured
+
+<Directory /usr/share/roundcubemail/installer/>
+    <IfModule mod_authz_core.c>
+        # Apache 2.4
+        Require local
+    </IfModule>
+    <IfModule !mod_authz_core.c>
+        # Apache 2.2
+        Order Deny,Allow
+        Deny from all
+        Allow from 127.0.0.1
+        Allow from ::1
+    </IfModule>
+</Directory>
+
+# Those directories should not be viewed by Web clients.
+<Directory /usr/share/roundcubemail/bin/>
+    Order Allow,Deny
+    Deny from all
+</Directory>
+<Directory /usr/share/roundcubemail/plugins/enigma/home/>
+    Order Allow,Deny
+    Deny from all
+</Directory>
diff --git a/roundcubemail.spec b/roundcubemail.spec
index 487b19a..753ebb5 100644
--- a/roundcubemail.spec
+++ b/roundcubemail.spec
@@ -1,11 +1,11 @@
 %define roundcubedir %{_datadir}/roundcubemail
 %global _logdir /var/log  
 Name: roundcubemail
-Version:  0.9.5
+Version:  1.0.0
 Release:  1%{?dist}
 Summary: Round Cube Webmail is a browser-based multilingual IMAP client
 
-Group: Applications/System         
+Group: Applications/System
 # Since 0.8 beta, the main code has been GPLv3+ with exceptions and
 # skins CC-BY-SA.
 # Plugins are a mix of GPLv3+ and GPLv2. The Enigma plugin contains a
@@ -22,29 +22,50 @@ URL: http://www.roundcube.net
 Source0: http://downloads.sourceforge.net/roundcubemail/roundcubemail-%{version}-dep.tar.gz
 Source1: roundcubemail.conf
 Source2: roundcubemail.logrotate
-Source4: roundcubemail-README.fedora
+Source4: roundcubemail-README.rpm
 # Elegantly handle removal of moxieplayer Flash binary in tinymce
-# media plugin (see "Drop precompiled flash" in %pre)
+# media plugin (see "Drop precompiled flash" in %%prep)
 Patch0: roundcubemail-0.9.3-no_swf.patch
 
 # Non-upstreamable: Adjusts config path to Fedora policy
-Patch6: roundcubemail-0.9.0-confpath.patch
+Patch1: roundcubemail-1.0.0-confpath.patch
 
 BuildArch: noarch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)
-Requires: php, webserver
+Requires: httpd
+Requires: mod_php
+Requires: php-curl
+Requires: php-date
+Requires: php-dom
 Requires: php-fileinfo
+Requires: php-gd
+Requires: php-hash
+Requires: php-iconv
+Requires: php-intl
+Requires: php-json
+Requires: php-ldap
 Requires: php-mbstring
 Requires: php-mcrypt
 Requires: php-mysql
+Requires: php-pcre
+Requires: php-posix
 Requires: php-pdo
-Requires: php-pear-Auth-SASL
-Requires: php-pear-Mail-mimeDecode
-Requires: php-pear-Mail-Mime
-Requires: php-pear-Net-IDNA2
-Requires: php-pear-Net-SMTP
-Requires: php-pear-Net-Socket
+Requires: php-pspell
+Requires: php-session
+Requires: php-simplexml
+Requires: php-sockets
+Requires: php-spl
 Requires: php-xml
+Requires: php-pear(Auth_SASL)       >= 1.0.6
+Requires: php-pear(Mail_Mime)       >= 1.8.1
+Requires: php-pear(Net_SMTP)
+Requires: php-pear(Net_Sieve)       >= 1.3.2
+Requires: php-pear(Mail_mimeDecode) >= 1.5.5
+Requires: php-pear(Net_IDNA2)       >= 0.1.1
+# not available php-pear(Crypt_GPG) >= 1.2.0
+# mailcap for /etc/mime.types
+Requires: mailcap
+
 
 %description
 RoundCube Webmail is a browser-based multilingual IMAP client
@@ -56,45 +77,37 @@ requires a database: MySQL, PostgreSQL and SQLite are known to
 work. The user interface is fully skinnable using XHTML and
 CSS 2.
 
+
 %prep
 %setup -q -n roundcubemail-%{version}-dep
 %patch0 -p1
-%patch6 -p1
+%patch1 -p1
 
 # fix permissions and remove any .htaccess files
 find . -type f -print | xargs chmod a-x
 find . -name \.htaccess -print | xargs rm -f
 
-# fixup paths to use the right paths
-sed -i 's|temp/|${_tmppath}|' config/main.inc.php.dist
-sed -i 's|config/|%{_sysconfdir}/roundcubemail/|' config/main.inc.php.dist
-sed -i 's|logs/|%{_logdir}/roundcubemail/|' config/main.inc.php.dist
+# Fix shebang
+chmod +x bin/*sh
+sed -e '/^#!/s:/usr/bin/env php:/usr/bin/php:' \
+    -i bin/*sh
 
 # ??? - Jon, this could do with a comment; fixing carriage returns? (adamw)
 sed -i 's/\r//' SQL/mssql.initial.sql
 
-#Drop precompiled flash
+# Drop precompiled flash
 find . -type f -name '*.swf' | xargs rm -f
 
+
 %build
+# Nothing
 
-%install
 
+%install
 rm -rf %{buildroot}
 install -d %{buildroot}%{roundcubedir}
 cp -pr * %{buildroot}%{roundcubedir}
 
-#ln -s ../../../pear/PEAR.php %{buildroot}%{roundcubedir}/program/lib/PEAR.php
-#ln -s ../../../pear/Auth %{buildroot}%{roundcubedir}/program/lib/Auth
-#ln -s ../../../pear/DB %{buildroot}%{roundcubedir}/program/lib/DB
-#ln -s ../../../pear/DB.php %{buildroot}%{roundcubedir}/program/lib/DB.php
-#ln -s ../../../pear/Mail %{buildroot}%{roundcubedir}/program/lib/Mail
-#ln -s ../../../pear/Net %{buildroot}%{roundcubedir}/program/lib/Net
-
-# drop the installer and the update.sh script which depends on it
-rm -rf %{buildroot}%{roundcubedir}/installer
-rm -f %{buildroot}%{roundcubedir}/bin/update.sh
-
 mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
 cp -pr %SOURCE1 %{buildroot}%{_sysconfdir}/httpd/conf.d
 
@@ -102,56 +115,69 @@ mkdir -p %{buildroot}%{_sysconfdir}/roundcubemail
 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
 cp -pr %SOURCE2 %{buildroot}%{_sysconfdir}/logrotate.d/roundcubemail
 
+# Log files
 mkdir -p %{buildroot}/var/log/roundcubemail
+# Temp files
+mkdir -p %{buildroot}/var/lib/roundcubemail
+
+cp -pr %SOURCE4 README.rpm
 
-cp -pr %SOURCE4 .
+# create empty files for ghost to not remove OLD config (0.9.x)
+touch %{buildroot}%{_sysconfdir}/roundcubemail/db.inc.php
+touch %{buildroot}%{_sysconfdir}/roundcubemail/main.inc.php
+# create empty files for ghost for the NEW config
+touch %{buildroot}%{_sysconfdir}/roundcubemail/config.inc.php
 
-# use dist files as config files
-mv %{buildroot}%{roundcubedir}/config/db.inc.php.dist %{buildroot}%{_sysconfdir}/roundcubemail/db.inc.php
-mv %{buildroot}%{roundcubedir}/config/main.inc.php.dist %{buildroot}%{_sysconfdir}/roundcubemail/main.inc.php
 # keep any other config files too
 mv %{buildroot}%{roundcubedir}/config/* %{buildroot}%{_sysconfdir}/roundcubemail/
 
 # clean up the buildroot
 rm -rf %{buildroot}%{roundcubedir}/{config,logs,temp}
-rm -rf %{buildroot}%{roundcubedir}/{CHANGELOG,INSTALL,LICENSE,README,UPGRADING,SQL}
+rm -rf %{buildroot}%{roundcubedir}/{CHANGELOG,INSTALL,LICENSE,README,UPGRADING}
 
-%clean
-rm -rf %{buildroot}
 
-%post
-# replace default des string in config file for better security
-function makedesstr
-(
-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
-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)
+%pre
+# Drop some old config options to ensure new defaults are used
+if [ -f %{_sysconfdir}/%{name}/main.inc.php ]; then
+  sed -e "/'temp_dir'/d" \
+      -e "/'mime_types'/d" \
+      -e "/'log_dir'/d" \
+      -i %{_sysconfdir}/%{name}/main.inc.php
+fi
 
-max=${#chars[*]}
 
-for i in `seq 1 24`; do
-    let rand=${RANDOM}%%${max}
-    str="${str}${chars[$rand]}"
-done
-echo $str
-)
-
-sed -i "s/rcmail-\!24ByteDESkey\*Str/`makedesstr`/" /etc/roundcubemail/main.inc.php || : &> /dev/null
-exit 0
+%clean
+rm -rf %{buildroot}
 
 
 %files
 %defattr(-,root,root,-)
-%doc CHANGELOG INSTALL LICENSE README.md UPGRADING SQL roundcubemail-README.fedora
+%doc CHANGELOG INSTALL LICENSE README.md UPGRADING README.rpm
 %{roundcubedir}
 %dir %{_sysconfdir}/%{name}
-%attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.inc.php
-%attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/main.inc.php
+# OLD config files from previous version
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/db.inc.php
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/main.inc.php
+# NEW config file
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
+# Default upstream values, overwritten on update
 %attr(0640,root,apache) %{_sysconfdir}/%{name}/mimetypes.php
+%attr(0640,root,apache) %{_sysconfdir}/%{name}/defaults.inc.php
+%attr(0640,root,apache) %{_sysconfdir}/%{name}/config.inc.php.sample
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/roundcubemail.conf
 %attr(0775,root,apache) %dir /var/log/roundcubemail
+%attr(0775,root,apache) %dir /var/lib/roundcubemail
 %config(noreplace) %{_sysconfdir}/logrotate.d/roundcubemail
 
+
 %changelog
+* Thu May  8 2014 Remi Collet <remi at fedoraproject.org> - 1.0.0-2
+- Update to 1.0.0
+- provide the installer
+- cleanup some config options from previous version
+- requires mailcap for /etc/mime.types
+- explicitly requires all needed extensions
+
 * Tue Oct 22 2013 Jon Ciesla <limburgher at gmail.com> - 0.9.5-1
 - Fix for CVE-2013-6172, BZ 1021735, 1021965.
 
diff --git a/sources b/sources
index 6f7a02d..5ecde27 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-7383f81a75bcbe8ea00d882f6be4834c  roundcubemail-0.9.5-dep.tar.gz
+f2656f48ea2560e18c44fcf44715f0e0  roundcubemail-1.0.0-dep.tar.gz


More information about the scm-commits mailing list