[roundcubemail] - update to 1.1.0 - provide Nginx configuration - use %license

Remi Collet remi at fedoraproject.org
Wed Feb 18 07:03:27 UTC 2015


commit f38d059a89cadc2768438f1d6e6277104843b5c0
Author: Remi Collet <remi at fedoraproject.org>
Date:   Wed Feb 18 08:03:14 2015 +0100

    - update to 1.1.0
    - provide Nginx configuration
    - use %license

 .gitignore                                         |    1 +
 roundcubemail-0.9.3-no_swf.patch                   |    6 --
 ...ath.patch => roundcubemail-1.1.0-confpath.patch |   39 ++++++------
 roundcubemail-1.1.0-no_swf.patch                   |    6 ++
 roundcubemail.conf => roundcubemail.httpd          |    0
 roundcubemail.nginx                                |   47 +++++++++++++
 roundcubemail.spec                                 |   69 +++++++++++++++++---
 sources                                            |    2 +-
 8 files changed, 134 insertions(+), 36 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 52e49d0..36d734c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@
 /roundcubemail-1.0.3-dep.tar.gz
 /roundcubemail-1.0.4-dep.tar.gz
 /roundcubemail-1.0.5-dep.tar.gz
+/roundcubemail-1.1.0.tar.gz
diff --git a/roundcubemail-1.0.3-confpath.patch b/roundcubemail-1.1.0-confpath.patch
similarity index 52%
rename from roundcubemail-1.0.3-confpath.patch
rename to roundcubemail-1.1.0-confpath.patch
index aa30a79..c015e52 100644
--- a/roundcubemail-1.0.3-confpath.patch
+++ b/roundcubemail-1.1.0-confpath.patch
@@ -1,43 +1,44 @@
-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)
+diff -up roundcubemail-1.1.0/config/defaults.inc.php.orig roundcubemail-1.1.0/config/defaults.inc.php
+--- roundcubemail-1.1.0/config/defaults.inc.php.orig	2015-02-16 17:39:52.274132735 +0100
++++ roundcubemail-1.1.0/config/defaults.inc.php	2015-02-16 17:46:10.336534781 +0100
+@@ -321,11 +321,11 @@ $config['user_aliases'] = false;
+ // use this folder to store log files
+ // must be writeable for the user who runs PHP process (Apache user if mod_php is being used)
  // 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)
+ // use this folder to store temp files
+ // must be writeable for the user who runs PHP process (Apache user if mod_php is being used)
 -$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;
+@@ -511,7 +511,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
+ // path to imagemagick identify binary (if not set we'll use Imagick or GD extensions)
  $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
+diff -up roundcubemail-1.1.0/installer/index.php.orig roundcubemail-1.1.0/installer/index.php
+--- roundcubemail-1.1.0/installer/index.php.orig	2015-02-16 17:39:52.274132735 +0100
++++ roundcubemail-1.1.0/installer/index.php	2015-02-16 17:41:44.115547278 +0100
 @@ -41,7 +41,7 @@ ini_set('display_errors', 1);
  
- define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
+ define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');
  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/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
+diff -up roundcubemail-1.1.0/program/include/iniset.php.orig roundcubemail-1.1.0/program/include/iniset.php
+--- roundcubemail-1.1.0/program/include/iniset.php.orig	2015-02-08 14:48:56.000000000 +0100
++++ roundcubemail-1.1.0/program/include/iniset.php	2015-02-16 17:39:52.274132735 +0100
 @@ -29,7 +29,7 @@ if (!defined('INSTALL_PATH')) {
  }
  
@@ -56,9 +57,9 @@ diff -up roundcubemail-1.0.0-dep/program/include/iniset.php.rpm roundcubemail-1.
  
  
  // 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
+diff -up roundcubemail-1.1.0/program/lib/Roundcube/bootstrap.php.orig roundcubemail-1.1.0/program/lib/Roundcube/bootstrap.php
+--- roundcubemail-1.1.0/program/lib/Roundcube/bootstrap.php.orig	2015-02-08 14:48:56.000000000 +0100
++++ roundcubemail-1.1.0/program/lib/Roundcube/bootstrap.php	2015-02-16 17:39:52.274132735 +0100
 @@ -66,7 +66,7 @@ if (!defined('RCUBE_INSTALL_PATH')) {
  }
  
diff --git a/roundcubemail-1.1.0-no_swf.patch b/roundcubemail-1.1.0-no_swf.patch
new file mode 100644
index 0000000..838742f
--- /dev/null
+++ b/roundcubemail-1.1.0-no_swf.patch
@@ -0,0 +1,6 @@
+--- roundcubemail-1.1.0/program/js/tinymce/plugins/media/plugin.min.js.old	2015-02-16 17:30:22.000000000 +0100
++++ roundcubemail-1.1.0/program/js/tinymce/plugins/media/plugin.min.js	2015-02-16 17:34:23.000000000 +0100
+@@ -1 +1 @@
+-tinymce.PluginManager.add("media",function(a,b){function c(a){return-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),c.value(g)):(f=Math.round(g/j*f),b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",
 filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:b},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:b},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var n={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};n[m]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){
 this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},n]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=a.convertURL(b+"/moxieplayer.swf","movie"),tinymce.each(l,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c
 ++)d=d.replace("$"+c,function(){return b[c]});e.source1=d,e.type=a.type,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type?f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"></iframe>':"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<scrip
 t src="'+e.source1+'"></script>':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),("iframe"==a||"object"==a||"embed"==a||"video"==a||"audio"==a)&&(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.so
 urce1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){c.comment(a)},cdata:function(a){c.cdata(a)},text:function(a,b){c.text(a,b)},start:function(a,b,d){if("script"!=a&&"noscript"!=a){for(var e=0;e<b.length;e++)if(0===b[e].name.indexOf("on"))return;c.start(a,b,d)}},end:function(a){"script"!=a&&"noscript"!=a&&c.end(a)}},new tinymce.html.Schema({})).parse(b),c.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxP
 arser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}var l=[{regex:/youtu\.be\/([\w\-.]+)/,type:"ifr
 ame",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}],m=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),
 function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b,c){for(var e,f,g,h,i,j,k,l,m=b.length;m--;)if(f=b[m],f.parent&&("script"!=f.name||(l=d(f.attr("src"))))){for(g=new tinymce.html.Node("img",1),g.shortEnded=!0,l&&(l.width&&f.attr("width",l.width.toString()),l.height&&f.attr("height",l.height.toString())),j=f.attributes,e=j.length;e--;)h=j[e].name,i=j[e].value,"width"!==h&&"height"!==h&&"style"!==h&&(("data"==h||"src"==h)&&(i=a.convertURL(i,h)),g.attr("data-mce-p-"+h,i));k=f.firstChild&&f.firstChild.value,k&&(g.attr("data-mce-html",escape(k)),g.firstChild=null),g.attr({width:f.attr("width")||"300",height:f.attr("height")||("audio"==c?"30":"150"),style:f.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),f.replace(g)}}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k=a.length;k--;)if(c=a[k],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1
 ),"audio"!=i&&"script"!=i&&d.attr({width:c.attr("width"),height:c.attr("height")}),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var l=f[e].name;0===l.indexOf("data-mce-p-")&&d.attr(l.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");("audio"==b||"script"==b)&&a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),a.addMenuItem("media",{icon:"media",text:"Insert video",onclick:e,context:"insert",prependToContext:!0})})
 ;
+\ Pas de fin de ligne à la fin du fichier
++tinymce.PluginManager.add("media",function(a,b){function c(a){return-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),c.value(g)):(f=Math.round(g/j*f),b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",
 filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:b},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:b},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var n={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};n[m]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){
 this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},n]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=false,tinymce.each(l,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c++)d=d.replace("$"+c,function(){retur
 n b[c]});e.source1=d,e.type=a.type,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type?f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"></iframe>':"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<script src="'+e.source1+'"></script>':f=a.
 settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),("iframe"==a||"object"==a||"embed"==a||"video"==a||"audio"==a)&&(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.sour
 ce2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){c.comment(a)},cdata:function(a){c.cdata(a)},text:function(a,b){c.text(a,b)},start:function(a,b,d){if("script"!=a&&"noscript"!=a){for(var e=0;e<b.length;e++)if(0===b[e].name.indexOf("on"))return;c.start(a,b,d)}},end:function(a){"script"!=a&&"noscript"!=a&&c.end(a)}},new tinymce.html.Schema({})).parse(b),c.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_
 comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}var l=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.c
 om/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&amp;byline=0"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}],m=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNod
 eFilter("iframe,video,audio,object,embed,script",function(b,c){for(var e,f,g,h,i,j,k,l,m=b.length;m--;)if(f=b[m],f.parent&&("script"!=f.name||(l=d(f.attr("src"))))){for(g=new tinymce.html.Node("img",1),g.shortEnded=!0,l&&(l.width&&f.attr("width",l.width.toString()),l.height&&f.attr("height",l.height.toString())),j=f.attributes,e=j.length;e--;)h=j[e].name,i=j[e].value,"width"!==h&&"height"!==h&&"style"!==h&&(("data"==h||"src"==h)&&(i=a.convertURL(i,h)),g.attr("data-mce-p-"+h,i));k=f.firstChild&&f.firstChild.value,k&&(g.attr("data-mce-html",escape(k)),g.firstChild=null),g.attr({width:f.attr("width")||"300",height:f.attr("height")||("audio"==c?"30":"150"),style:f.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),f.replace(g)}}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k=a.length;k--;)if(c=a[k],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&d.attr({wi
 dth:c.attr("width"),height:c.attr("height")}),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var l=f[e].name;0===l.indexOf("data-mce-p-")&&d.attr(l.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");("audio"==b||"script"==b)&&a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),a.addMenuItem("media",{icon:"media",text:"Insert video",onclick:e,context:"insert",prependToContext:!0})});
diff --git a/roundcubemail.conf b/roundcubemail.httpd
similarity index 100%
rename from roundcubemail.conf
rename to roundcubemail.httpd
diff --git a/roundcubemail.nginx b/roundcubemail.nginx
new file mode 100644
index 0000000..8866792
--- /dev/null
+++ b/roundcubemail.nginx
@@ -0,0 +1,47 @@
+location = /roundcubemail {
+    alias /usr/share/roundcubemail/;
+}
+
+location /roundcubemail/ {
+    root /usr/share;
+    index index.php;
+
+    location ~ ^/roundcubemail/bin/(.+)$ {
+        deny all;
+    }
+    location ~ ^/roundcubemail/plugins/enigma/home/(.+)$ {
+        deny all;
+    }
+
+    # Define who can access the installer
+    # keep this secured once configured
+
+    location ~ ^/roundcubemail/installer/(.+\.php)$ {
+        allow 127.0.0.1;
+        allow ::1;
+        deny all;
+
+        try_files $uri =404;
+        fastcgi_intercept_errors on;
+        include        fastcgi_params;
+        fastcgi_param  SERVER_NAME      $host;
+        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+        fastcgi_pass   php-fpm;
+    }
+
+    # Define who can access the Webmail
+    # You can enlarge permissions once configured
+
+    location ~ ^/roundcubemail/(.+\.php)$ {
+        allow 127.0.0.1;
+        allow ::1;
+        deny all;
+
+        try_files $uri =404;
+        fastcgi_intercept_errors on;
+        include        fastcgi_params;
+        fastcgi_param  SERVER_NAME      $host;
+        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+        fastcgi_pass   php-fpm;
+    }
+}
diff --git a/roundcubemail.spec b/roundcubemail.spec
index a6bfdb3..4f2826b 100644
--- a/roundcubemail.spec
+++ b/roundcubemail.spec
@@ -1,7 +1,14 @@
+%if 0%{?fedora} >= 21
+# support for apache / nginx / php-fpm
+%global with_phpfpm 1
+%else
+%global with_phpfpm 0
+%endif
+
 %define roundcubedir %{_datadir}/roundcubemail
 %global _logdir /var/log  
 Name: roundcubemail
-Version:  1.0.5
+Version:  1.1.0
 Release:  1%{?dist}
 Summary: Round Cube Webmail is a browser-based multilingual IMAP client
 
@@ -19,21 +26,29 @@ Group: Applications/System
 # http://www.tinymce.com/
 License: GPLv3+ with exceptions and GPLv3+ and GPLv2 and LGPLv2+ and CC-BY-SA and (MIT or GPLv2)
 URL: http://www.roundcube.net
-Source0: https://downloads.sourceforge.net/roundcubemail/roundcubemail-%{version}-dep.tar.gz
-Source1: roundcubemail.conf
+Source0: https://downloads.sourceforge.net/roundcubemail/roundcubemail-%{version}.tar.gz
+Source1: roundcubemail.httpd
+Source3: roundcubemail.nginx
 Source2: roundcubemail.logrotate
 Source4: roundcubemail-README.rpm
 # Elegantly handle removal of moxieplayer Flash binary in tinymce
 # media plugin (see "Drop precompiled flash" in %%prep)
-Patch0: roundcubemail-0.9.3-no_swf.patch
+Patch0: roundcubemail-1.1.0-no_swf.patch
 
 # Non-upstreamable: Adjusts config path to Fedora policy
-Patch1: roundcubemail-1.0.3-confpath.patch
+Patch1: roundcubemail-1.1.0-confpath.patch
 
 BuildArch: noarch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)
+%if %{with_phpfpm}
+Requires:  webserver
+Requires:  nginx-filesystem
+Requires:  httpd-filesystem
+Requires:  php(httpd)
+%else
 Requires: httpd
 Requires: mod_php
+%endif
 Requires: php-curl
 Requires: php-date
 Requires: php-dom
@@ -64,6 +79,7 @@ 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
+# Net_LDAP2, Net_LDAP3
 # mailcap for /etc/mime.types
 Requires: mailcap
 
@@ -98,7 +114,7 @@ CSS 2.
 
 
 %prep
-%setup -q -n roundcubemail-%{version}-dep
+%setup -q -n roundcubemail-%{version}
 %patch0 -p1
 %patch1 -p1
 rm -f config/defaults.inc.php.orig
@@ -123,6 +139,22 @@ find . -type f -name '*.swf' | xargs rm -f
 echo "CVE-2012-4230: removing tinymce bbcode plugin, check path if this fails."
 test -d program/js/*mce/plugins/bbcode && rm -rf program/js/*mce/plugins/bbcode || exit 1
 
+# Create simple autoloader for PEAR
+mkdir vendor
+cat << EOF | tee vendor/autoload.php
+<?php
+spl_autoload_register(
+	function (\$class) {
+		if (strpos(\$class, '.') === false) {
+			\$file = str_replace('_', '/', \$class).'.php';
+			if (\$path = stream_resolve_include_path(\$file)) {
+				require_once(\$path);
+			}
+		}
+	}
+);
+EOF
+
 
 %build
 # Nothing
@@ -133,8 +165,13 @@ rm -rf %{buildroot}
 install -d %{buildroot}%{roundcubedir}
 cp -pr * %{buildroot}%{roundcubedir}
 
-mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
-cp -pr %SOURCE1 %{buildroot}%{_sysconfdir}/httpd/conf.d
+# Apache with mod_php or php-fpm
+install -Dpm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
+
+%if %{with_phpfpm}
+# Nginx with php-fpm
+install -Dpm 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/nginx/default.d/%{name}.conf
+%endif
 
 mkdir -p %{buildroot}%{_sysconfdir}/roundcubemail
 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
@@ -159,6 +196,7 @@ 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}
+rm     %{buildroot}%{roundcubedir}/{composer.json-dist,Dockerfile}
 
 
 %pre
@@ -177,7 +215,10 @@ rm -rf %{buildroot}
 
 %files
 %defattr(-,root,root,-)
-%doc CHANGELOG INSTALL LICENSE README.md UPGRADING README.rpm
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc CHANGELOG INSTALL README.md UPGRADING README.rpm
+%doc composer.json-dist
 %{roundcubedir}
 %dir %{_sysconfdir}/%{name}
 # OLD config files from previous version
@@ -189,13 +230,21 @@ rm -rf %{buildroot}
 %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
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
+%if %{with_phpfpm}
+%config(noreplace) %{_sysconfdir}/nginx/default.d/%{name}.conf
+%endif
 %attr(0775,root,apache) %dir /var/log/roundcubemail
 %attr(0775,root,apache) %dir /var/lib/roundcubemail
 %config(noreplace) %{_sysconfdir}/logrotate.d/roundcubemail
 
 
 %changelog
+* Mon Feb 16 2015 Remi Collet <remi at fedoraproject.org> - 1.1.0-1
+- update to 1.1.0
+- provide Nginx configuration (Fedora >= 21)
+- use %%license
+
 * Thu Feb 05 2015 Jon Ciesla <limburgher at gmail.com> - 1.0.5-1
 - Fix for security issues.
 
diff --git a/sources b/sources
index 5ae304c..17985b4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4330d94b07575f3623147dcd4a91e2a5  roundcubemail-1.0.5-dep.tar.gz
+784b001753cebb9d0db59142f22e1764  roundcubemail-1.1.0.tar.gz


More information about the scm-commits mailing list