From 7840065569de84a135711318d66e5bcf8827097e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 5 Jul 2015 07:54:26 +0200 Subject: owncloud: import 8.0.4 from rawhide --- owncloud-6.0.2-videoviewer_noplugins.patch | 11 + owncloud-7.0.3-opcache_invalidate.patch | 131 +++++ owncloud-8.0.0-disable_minify.patch | 18 + owncloud-8.0.0-drop-dropbox-autoloader.patch | 25 + owncloud-8.0.1-autoloader_paths.patch | 14 + owncloud-8.0.1-composer_includepath.patch | 10 + owncloud-8.0.3-dont_update_htacess.patch | 37 ++ owncloud-README.fedora | 78 +++ owncloud-access-httpd.conf.avail | 24 + owncloud-auth-any.inc | 12 + owncloud-auth-local.inc | 14 + owncloud-auth-none.inc | 12 + owncloud-config.php | 24 + owncloud-defaults.inc | 60 +++ owncloud-delete-nonfree.sh | 21 + owncloud-httpd.conf | 49 ++ owncloud-mysql.txt | 28 + owncloud-nginx.conf | 79 +++ owncloud-postgresql.txt | 43 ++ owncloud.spec | 765 +++++++++++++++++++++++++++ 20 files changed, 1455 insertions(+) create mode 100644 owncloud-6.0.2-videoviewer_noplugins.patch create mode 100644 owncloud-7.0.3-opcache_invalidate.patch create mode 100644 owncloud-8.0.0-disable_minify.patch create mode 100644 owncloud-8.0.0-drop-dropbox-autoloader.patch create mode 100644 owncloud-8.0.1-autoloader_paths.patch create mode 100644 owncloud-8.0.1-composer_includepath.patch create mode 100644 owncloud-8.0.3-dont_update_htacess.patch create mode 100644 owncloud-README.fedora create mode 100644 owncloud-access-httpd.conf.avail create mode 100644 owncloud-auth-any.inc create mode 100644 owncloud-auth-local.inc create mode 100644 owncloud-auth-none.inc create mode 100644 owncloud-config.php create mode 100644 owncloud-defaults.inc create mode 100755 owncloud-delete-nonfree.sh create mode 100644 owncloud-httpd.conf create mode 100644 owncloud-mysql.txt create mode 100644 owncloud-nginx.conf create mode 100644 owncloud-postgresql.txt create mode 100644 owncloud.spec diff --git a/owncloud-6.0.2-videoviewer_noplugins.patch b/owncloud-6.0.2-videoviewer_noplugins.patch new file mode 100644 index 0000000..fb8dfd5 --- /dev/null +++ b/owncloud-6.0.2-videoviewer_noplugins.patch @@ -0,0 +1,11 @@ +--- apps/files_videoviewer/js/mediaelement-and-player.min.js.orig 2014-03-04 21:35:13.921783071 +0100 ++++ apps/files_videoviewer/js/mediaelement-and-player.min.js 2014-03-04 21:39:40.528053899 +0100 +@@ -38,7 +38,7 @@ + this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id);mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}}; + mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},unregisterPluginElement:function(a){delete this.pluginMediaElements[a];delete this.htmlMediaElements[a]},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id); + b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,c)}},fireEvent:function(a,b,c){var d,e;if(a=this.pluginMediaElements[a]){b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}}}; +-mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,httpsBasicAuthSite:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,enablePseudoStreaming:false,pseudoStreamingStartQueryParam:"start",silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480, ++mejs.MediaElementDefaults={mode:"auto",plugins:["youtube","vimeo"],enablePluginDebug:false,httpsBasicAuthSite:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,enablePseudoStreaming:false,pseudoStreamingStartQueryParam:"start",silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480, + defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8,success:function(){},error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)}; + mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;l=typeof l=="undefined"||l===null||l==="false"? + "none":l;h=!(typeof h=="undefined"||h===null||h==="false");j=!(typeof j=="undefined"||j===null||j==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,h,l)}else if(k.method!=="")return this.createPlugin(k,c,e,h,l,j);else{this.createErrorMessage(k,c,e);return this}}, diff --git a/owncloud-7.0.3-opcache_invalidate.patch b/owncloud-7.0.3-opcache_invalidate.patch new file mode 100644 index 0000000..e6360aa --- /dev/null +++ b/owncloud-7.0.3-opcache_invalidate.patch @@ -0,0 +1,131 @@ +From 3b4823d89c03e54917ce6844dfbd227c8b4d6adc Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 12 Sep 2014 23:33:18 -0700 +Subject: [PATCH 1/3] add function to invalidate one opcache file, use it if + possible #9885 + +Issue #9885 appears to be triggered by ownCloud invalidating the entire +PHP opcache. Testing indicates it can be avoided by only invalidating the +single file that was written from the opcache, instead of clearing the +whole thing. In general it is more efficient to invalidate only the single +file that was changed, rather than the whole cache. + +This adds a deleteFromOpcodeCache() function which invalidates a single +file from the opcache if possible, returning true if the underlying +function returns true (which may mean 'success', or 'file does not exist', +or 'file exists but is not in opcache', all of which are OK to treat as +good for our purposes). It also changes writeData() in config.php to try +using deleteFromOpcodeCache() and only fall back on clearOpcodeCache() if +that fails. +--- + lib/private/config.php | 7 +++++-- + lib/private/util.php | 25 +++++++++++++++++++++++++ + 2 files changed, 30 insertions(+), 2 deletions(-) + +diff --git a/lib/private/config.php b/lib/private/config.php +index f054844..8bb2a5c 100644 +--- a/lib/private/config.php ++++ b/lib/private/config.php +@@ -207,8 +207,11 @@ private function writeData() { + flock($filePointer, LOCK_UN); + fclose($filePointer); + +- // Clear the opcode cache +- \OC_Util::clearOpcodeCache(); ++ // Try invalidating the opcache just for the file we wrote... ++ if (!\OC_Util::deleteFromOpcodeCache($this->configFilename)) { ++ // But if that doesn't work, clear the whole cache. ++ \OC_Util::clearOpcodeCache(); ++ } + } + } + +diff --git a/lib/private/util.php b/lib/private/util.php +index bee0a57..fa0c6f1 100644 +--- a/lib/private/util.php ++++ b/lib/private/util.php +@@ -1250,6 +1250,31 @@ public static function getTheme() { + } + + /** ++ * Clear a single file from the opcode cache ++ * This is useful for writing to the config file ++ * in case the opcode cache does not re-validate files ++ * Returns true if successful, false if unsuccessful: ++ * caller should fall back on clearing the entire cache ++ * with clearOpcodeCache() if unsuccessful ++ * ++ * @return bool true if underlying function returns true, otherwise false ++ */ ++ public static function deleteFromOpcodeCache($path=NULL) { ++ $ret = false; ++ if ($path) { ++ // APC >= 3.1.1 ++ if (function_exists('apc_delete_file')) { ++ $ret = @apc_delete_file($path); ++ } ++ // Zend OpCache >= 7.0.0, PHP >= 5.5.0 ++ if (function_exists('opcache_invalidate')) { ++ $ret = opcache_invalidate($path); ++ } ++ } ++ return $ret; ++ } ++ ++ /** + * Clear the opcode cache if one exists + * This is necessary for writing to the config file + * in case the opcode cache does not re-validate files + +From 8b2b0aae31fe084c3f8edbc6b307a39db03211c9 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 6 Nov 2014 18:05:20 -0800 +Subject: [PATCH 2/3] deleteFromOpcodeCache: make parameter mandatory, document + parameter + +Both pointed out in submission review by @bantu, thanks. +--- + lib/private/util.php | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/private/util.php b/lib/private/util.php +index fa0c6f1..0e1bb34 100644 +--- a/lib/private/util.php ++++ b/lib/private/util.php +@@ -1257,9 +1257,10 @@ public static function getTheme() { + * caller should fall back on clearing the entire cache + * with clearOpcodeCache() if unsuccessful + * ++ * @param string $path the path of the file to clear from the cache + * @return bool true if underlying function returns true, otherwise false + */ +- public static function deleteFromOpcodeCache($path=NULL) { ++ public static function deleteFromOpcodeCache($path) { + $ret = false; + if ($path) { + // APC >= 3.1.1 + +From 013feb8da052e7d8f2e1171fb6600d82b3c3ac29 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 6 Nov 2014 18:10:43 -0800 +Subject: [PATCH 3/3] writeData(): correct variable name for config file path + +It changed since we wrote this patch. +--- + lib/private/config.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/private/config.php b/lib/private/config.php +index 8bb2a5c..3e7fef4 100644 +--- a/lib/private/config.php ++++ b/lib/private/config.php +@@ -208,7 +208,7 @@ private function writeData() { + fclose($filePointer); + + // Try invalidating the opcache just for the file we wrote... +- if (!\OC_Util::deleteFromOpcodeCache($this->configFilename)) { ++ if (!\OC_Util::deleteFromOpcodeCache($this->configFilePath)) { + // But if that doesn't work, clear the whole cache. + \OC_Util::clearOpcodeCache(); + } + diff --git a/owncloud-8.0.0-disable_minify.patch b/owncloud-8.0.0-disable_minify.patch new file mode 100644 index 0000000..f1673a7 --- /dev/null +++ b/owncloud-8.0.0-disable_minify.patch @@ -0,0 +1,18 @@ +--- owncloud/lib/private/templatelayout.php 2015-02-18 11:23:48.588804666 -0800 ++++ owncloud/lib/private/templatelayout.php.new 2015-02-21 12:07:47.616822741 -0800 +@@ -5,7 +5,6 @@ + use Assetic\Filter\CssImportFilter; + use Assetic\Filter\CssMinFilter; + use Assetic\Filter\CssRewriteFilter; +-use Assetic\Filter\JSMinFilter; + use OC\Assetic\SeparatorFilter; // waiting on upstream + + /** +@@ -172,7 +171,6 @@ + ), $root, $file); + } + return new FileAsset($root . '/' . $file, array( +- new JSMinFilter(), + new SeparatorFilter(';') + ), $root, $file); + }, $jsFiles); diff --git a/owncloud-8.0.0-drop-dropbox-autoloader.patch b/owncloud-8.0.0-drop-dropbox-autoloader.patch new file mode 100644 index 0000000..45acd2c --- /dev/null +++ b/owncloud-8.0.0-drop-dropbox-autoloader.patch @@ -0,0 +1,25 @@ +diff --git a/apps/files_external/ajax/dropbox.php b/apps/files_external/ajax/dropbox.php +index db417de..a752ca1 100644 +--- a/apps/files_external/ajax/dropbox.php ++++ b/apps/files_external/ajax/dropbox.php +@@ -1,7 +1,5 @@ + add('Pimple', '/usr/share/php/Pimple'); ++ $loader->add('Sabre', '/usr/share/php'); ++ $loader->add('Sabre\VObject', '/usr/share/pear'); + } else { + OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); + // we can't use the template error page here, because this needs the diff --git a/owncloud-8.0.1-composer_includepath.patch b/owncloud-8.0.1-composer_includepath.patch new file mode 100644 index 0000000..f7b3a56 --- /dev/null +++ b/owncloud-8.0.1-composer_includepath.patch @@ -0,0 +1,10 @@ +--- owncloud/lib/base.php 2014-07-29 00:30:26.998084605 -0700 ++++ owncloud/lib/base.php.new 2014-07-29 00:35:08.579372364 -0700 +@@ -491,6 +491,7 @@ + $loader->add('Pimple', '/usr/share/php/Pimple'); + $loader->add('Sabre', '/usr/share/php'); + $loader->add('Sabre\VObject', '/usr/share/pear'); ++ $loader->setUseIncludePath(true); + } else { + OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); + // we can't use the template error page here, because this needs the diff --git a/owncloud-8.0.3-dont_update_htacess.patch b/owncloud-8.0.3-dont_update_htacess.patch new file mode 100644 index 0000000..db34f90 --- /dev/null +++ b/owncloud-8.0.3-dont_update_htacess.patch @@ -0,0 +1,37 @@ +diff --git a/lib/private/setup.php b/lib/private/setup.php +index e3a29b6..7eeeb92 100644 +--- a/lib/private/setup.php ++++ b/lib/private/setup.php +@@ -230,12 +230,6 @@ class OC_Setup { + // out that this is indeed an ownCloud data directory + file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.ocdata', ''); + +- // Update htaccess files for apache hosts +- if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) { +- self::updateHtaccess(); +- self::protectDataDirectory(); +- } +- + //and we are done + OC_Config::setValue('installed', true); + } +diff --git a/lib/private/updater.php b/lib/private/updater.php +index 08731c7..2b722e3 100644 +--- a/lib/private/updater.php ++++ b/lib/private/updater.php +@@ -202,15 +202,6 @@ class Updater extends BasicEmitter { + throw new \Exception('Updates between multiple major versions are unsupported.'); + } + +- // Update htaccess files for apache hosts +- if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) { +- try { +- \OC_Setup::updateHtaccess(); +- } catch (\Exception $e) { +- throw new \Exception($e->getMessage()); +- } +- } +- + // create empty file in data dir, so we can later find + // out that this is indeed an ownCloud data directory + // (in case it didn't exist before) diff --git a/owncloud-README.fedora b/owncloud-README.fedora new file mode 100644 index 0000000..41c2861 --- /dev/null +++ b/owncloud-README.fedora @@ -0,0 +1,78 @@ +ownCloud packaging notes +======================== + +Start +------ +After installation you should be able to access the login/configuration page +at the following URL: + +http://localhost/owncloud/ or http://localhost/ + +If not, make sure your webserver is running properly. + +Webserver +--------- +Currently ownCloud in Fedora supports httpd (Apache) and nginx. You must install +at least one webserver subpackage (owncloud-). These packages +include additional configuration files for the webservers. Remote access is +disabled by default. To enable access from any host for Apache **AFTER** you +complete the initial setup process, do this: + +ln -s /etc/httpd/conf.d/owncloud-access.conf.avail /etc/httpd/conf.d/z-owncloud-access.conf + +If you wish to adjust any of the settings it is recommended that you create +a new configuration file that will override owncloud.conf, rather than editing +it, so future changes to the packaged file will be respected on your server. +If you do not do this, please be careful to check for changes in the packaged +configuration file (especially on major ownCloud upgrades) and merge into +your modified configuration as appropriate. + +Database +-------- +You can choose between three databases: MySQL, PostgreSQL and SQLite. +For each of them there is an ownCloud subpackage (owncloud-). +You are required to install at least one of them. The packages only ensure +the necessary requirements to communicate with a database server of that type +are installed, they do not require the database server package itself, as +you may wish to use a remote database server. If you wish to use a local one, +you must ensure it is installed and configured. + +For larger installs you should use MySQL or PostgreSQL. + +If you choose MySQL or PostgreSQL, keep in mind that you must create a database +and user for ownCloud manually, before you can finish the setup process. The +README.postgresql and README.mysql files provide more details and help with +this. + +Configuration +------------- +You can find the main configuration file at '/etc/owncloud/config.php'. Until +you first access the server it will be just a small stub containing settings +that differ in this package from the upstream defaults. After you first access +ownCloud, the initial setup process will populate it with some more settings. +Other settings that can be provided in this file are documented at: +https://doc.owncloud.org/server/8.0/admin_manual/configuration/config_sample_php_parameters.html + +User Data +--------- +The default data directory is '/var/lib/owncloud/data'. Every file that is +uploaded by your users to ownCloud gets saved into this folder. Consider doing +a backup of this directory, together with the database and the main +configuration. Note that if you change this location, you must set appropriate +ownership and SELinux context attributes. + +Logging +------- +As specified by the configuration file, ownCloud sends messages to the system +logger, which means in a standard Fedora configuration it will log to the +systemd journal: try "journalctl -b | grep ownCloud". You can also change the +loglevel or switch to the built-in log mechanism of ownCloud. + +App Store +--------- +If you install additional third party apps using the built-in app store, you +can find them in the directory '/var/lib/owncloud/apps'. This functionality is +enabled by default. + + +For further information see http://owncloud.org/ and http://doc.owncloud.org/ diff --git a/owncloud-access-httpd.conf.avail b/owncloud-access-httpd.conf.avail new file mode 100644 index 0000000..70986dc --- /dev/null +++ b/owncloud-access-httpd.conf.avail @@ -0,0 +1,24 @@ +# If symlinked or copied to /etc/httpd/conf.d/z-owncloud-access.conf +# (or any other name that is alphabetically later than +# 'owncloud.conf'), this file will permit access to the ownCloud +# installation from any client. Ensure your deployment is correctly +# configured and secured before doing this! +# +# If you SYMLINK this file, you can rely on the ownCloud package to +# handle any future changes in the directory or URL hierarchy; this +# file will always achieve the high-level goal 'allow access to the +# ownCloud installation from any client'. If you COPY this file, you +# will have to check for changes to the original in future ownCloud +# package updates, and make any appropriate adjustments to your copy. + + + Include conf.d/owncloud-auth-any.inc + + + + Include conf.d/owncloud-auth-any.inc + + + + Include conf.d/owncloud-auth-any.inc + diff --git a/owncloud-auth-any.inc b/owncloud-auth-any.inc new file mode 100644 index 0000000..4744713 --- /dev/null +++ b/owncloud-auth-any.inc @@ -0,0 +1,12 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Allows access from any system. + + +# Apache 2.4 +Require all granted + + +# Apache 2.2 +Order Deny,Allow +Allow from all + diff --git a/owncloud-auth-local.inc b/owncloud-auth-local.inc new file mode 100644 index 0000000..69cfd00 --- /dev/null +++ b/owncloud-auth-local.inc @@ -0,0 +1,14 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Allows access only from local system. + + +# Apache 2.4 +Require local + + +# Apache 2.2 +Order Deny,Allow +Deny from all +Allow from 127.0.0.1 +Allow from ::1 + diff --git a/owncloud-auth-none.inc b/owncloud-auth-none.inc new file mode 100644 index 0000000..212315e --- /dev/null +++ b/owncloud-auth-none.inc @@ -0,0 +1,12 @@ +# Apache config snippet. To be used by /etc/httpd/conf.d/*.conf files +# with Include. Denies all access. + + +# Apache 2.4 +Require all denied + + +# Apache 2.2 +Order Deny,Allow +Deny from all + diff --git a/owncloud-config.php b/owncloud-config.php new file mode 100644 index 0000000..1140054 --- /dev/null +++ b/owncloud-config.php @@ -0,0 +1,24 @@ + "syslog", + "datadirectory" => "/var/lib/owncloud/data", + "updatechecker" => false, + "check_for_working_htaccess" => false, + "asset-pipeline.enabled" => false, + "assetdirectory" => '/var/lib/owncloud', + + "apps_paths" => array( + 0 => + array ( + 'path'=> '/usr/share/owncloud/apps', + 'url' => '/apps', + 'writable' => false, + ), + 1 => + array ( + 'path' => '/var/lib/owncloud/apps', + 'url' => '/apps-appstore', + 'writable' => true, + ), + ), +); diff --git a/owncloud-defaults.inc b/owncloud-defaults.inc new file mode 100644 index 0000000..f502ffd --- /dev/null +++ b/owncloud-defaults.inc @@ -0,0 +1,60 @@ +# These are based on the .htaccess file shipped by ownCloud, with +# appropriate adjustments for distribution packaging. Some directives +# that are irrelevant to the Fedora/EPEL ecosystem are omitted. This +# file contains directives that should be applied within the /owncloud +# filesystem; directives that should be applied site-wide when +# ownCloud is installed are placed directly in owncloud.conf. +# +# DO NOT EDIT THIS FILE DIRECTLY. To override any element of the +# packaged ownCloud configuration, create a new /etc/httpd/conf.d/ +# file which will be read later than 'owncloud.conf'. + +AllowOverride None + +ErrorDocument 403 /owncloud/core/templates/403.php +ErrorDocument 404 /owncloud/core/templates/404.php + + + + + SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1 + RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION + + + + + + php_value upload_max_filesize 10G + php_value post_max_size 10G + php_value memory_limit 512M + php_value mbstring.func_overload 0 + php_value always_populate_raw_post_data -1 + php_value default_charset 'UTF-8' + php_value output_buffering off + + SetEnv htaccessWorking true + + + +# The rewrites for legacy caldav and carddav URLs are omitted here +# because they do not work with Fedora's ownCloud directory layout. +# See https://github.com/owncloud/core/issues/243#issuecomment-75426453 + + RewriteEngine on + RewriteBase /owncloud/ + RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + RewriteRule ^remote/(.*) remote.php [QSA,L] + + +AddDefaultCharset utf-8 +Options -Indexes + + + ModPagespeed Off + + + + + Header set Cache-Control "max-age=7200, public" + + diff --git a/owncloud-delete-nonfree.sh b/owncloud-delete-nonfree.sh new file mode 100755 index 0000000..fe6c53c --- /dev/null +++ b/owncloud-delete-nonfree.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e + +SUFFIX=".tar.bz2" +ORIG_SOURCE=$1 +REPACK_SOURCE="$(basename $ORIG_SOURCE $SUFFIX)-repack${SUFFIX}" + +[ -d owncloud ] && rm -rf owncloud + +tar -xf $1 + +# delete jslint +pushd owncloud/apps/files_texteditor/js/vendor/ace/src-noconflict/ +sed -i '/^ \* JSHint, by JSHint Community\.$/,/^})()$/d' worker-javascript.js +popd + +# delete minify entirely as it's a mess that contains at least one instance +# of JSMin, which is under the same problematic license as jslint +rm -rf owncloud/3rdparty/mrclay/minify + +tar -cjf $REPACK_SOURCE owncloud +rm -rf owncloud diff --git a/owncloud-httpd.conf b/owncloud-httpd.conf new file mode 100644 index 0000000..886ac2d --- /dev/null +++ b/owncloud-httpd.conf @@ -0,0 +1,49 @@ +# DO NOT EDIT THIS FILE DIRECTLY. To override any element of the +# packaged ownCloud configuration, create a new /etc/httpd/conf.d/ +# file which will be read later than 'owncloud.conf'. +# +# As the initial setup wizard is active upon installation, access is +# initially allowed only from localhost. *AFTER* configuring the +# installation correctly and creating the admin account, to allow +# access from any host, do this: +# +# ln -s /etc/httpd/conf.d/owncloud-access.conf.avail /etc/httpd/conf.d/z-owncloud-access.conf + +Alias /owncloud/apps-appstore /var/lib/owncloud/apps +Alias /owncloud/assets /var/lib/owncloud/assets +Alias /owncloud /usr/share/owncloud + +# Allows compliant CalDAV / CardDAV clients to be configured using only +# the domain name. For more details see # http://tools.ietf.org/html/rfc6764 + +Redirect 301 /.well-known/carddav /owncloud/remote.php/carddav +Redirect 301 /.well-known/caldav /owncloud/remote.php/caldav + + + Include conf.d/owncloud-auth-local.inc + Include conf.d/owncloud-defaults.inc + + Include conf.d/owncloud-auth-none.inc + + + + + Include conf.d/owncloud-auth-local.inc + Include conf.d/owncloud-defaults.inc + + + + Include conf.d/owncloud-auth-local.inc + Include conf.d/owncloud-defaults.inc + + +# For safety, explicitly deny any access to these locations. +# Upstream's .htaccess does something similar with mod_rewrite. + + + Include conf.d/owncloud-auth-none.inc + + + + Include conf.d/owncloud-auth-none.inc + diff --git a/owncloud-mysql.txt b/owncloud-mysql.txt new file mode 100644 index 0000000..23b0ac6 --- /dev/null +++ b/owncloud-mysql.txt @@ -0,0 +1,28 @@ +Configure MariaDB / MySQL for ownCloud +====================================== + +To use MariaDB / MySQL as database backend, you need to do the following: + +1. Make sure that your mysql service is configured and running properly. If this + is a fresh install, you will need to run "systemctl enable mysqld.service; + systemctl start mysqld.service" (or mariadb.service) as root. It's also + strongly advised to run "mysql_secure_installation" after starting the + database for the first time. + +2. Log in to the database as privileged user to create the database and a + dedicated user account for ownCloud: + $ mysql -u root -p + CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; + CREATE DATABASE IF NOT EXISTS owncloud; + GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password'; + Choose identifier and password accordingly. + +Now you can launch the ownCloud setup screen, select MySQL in the advanced +settings and fill in your credentials. + +References +========== + +https://fedoraproject.org/wiki/MariaDB +https://mariadb.com/kb/en/mariadb/documentation/ +http://doc.owncloud.org/server/7.0/admin_manual/configuration/configuration_database.html diff --git a/owncloud-nginx.conf b/owncloud-nginx.conf new file mode 100644 index 0000000..3bd235b --- /dev/null +++ b/owncloud-nginx.conf @@ -0,0 +1,79 @@ +# server { +# listen 80; +# server_name cloud.example.com; +# return 301 https://$server_name$request_uri; # enforce https +# } + +server { +# listen 443 ssl; + listen 80; + server_name localhost; + + allow 127.0.0.1; + deny all; + +# ssl_certificate /etc/ssl/nginx/cloud.example.com.crt; +# ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key; + + # Path to the root of your installation + root /usr/share/owncloud/; + + client_max_body_size 10G; # set max upload size + fastcgi_buffers 64 4K; + + rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; + rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; + rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; + + index index.php; + error_page 403 /core/templates/403.php; + error_page 404 /core/templates/404.php; + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location ~ ^/apps-appstore/(.*)$ { + alias /var/lib/owncloud/apps/$1; + } + + location ~ ^/assets/(.*)$ { + alias /var/lib/owncloud/assets/$1; + } + + location ~ ^/(data|config|\.ht|db_structure\.xml|README) { + deny all; + } + + location / { + # The following 2 rules are only needed with webfinger + rewrite ^/.well-known/host-meta /public.php?service=host-meta last; + rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; + + rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; + rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; + + rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; + + try_files $uri $uri/ index.php; + } + + location ~ ^(.+?\.php)(/.*)?$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; +# fastcgi_param HTTPS on; + fastcgi_pass php-fpm; + } + + # Optional: set long EXPIRES header on static assets + location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { + expires 30d; + # Optional: Don't log access to assets + access_log off; + } + +} diff --git a/owncloud-postgresql.txt b/owncloud-postgresql.txt new file mode 100644 index 0000000..f2b8a73 --- /dev/null +++ b/owncloud-postgresql.txt @@ -0,0 +1,43 @@ +Configure PostgreSQL for ownCloud +================================= + +To use PostgreSQL as database backend, you need to do the following: + +1. Make sure that your PostgreSQL service is configured and running properly. + If this is a fresh install, you will need to run "postgresql-setup initdb" + as root, then "systemctl enable postgresql.service; systemctl start + postgresql.service". For more details on initial configuration of PostgreSQL + in Fedora, see https://fedoraproject.org/wiki/PostgreSQL + +2. Log in to PostgreSQL as system user to create the database and a dedicated + user account for ownCloud: + # su - -c "psql" postgres + CREATE USER username WITH PASSWORD 'password'; + CREATE DATABASE owncloud TEMPLATE template0 ENCODING 'UNICODE'; + ALTER DATABASE owncloud OWNER TO username; + GRANT ALL PRIVILEGES ON DATABASE owncloud TO username; + Choose identifier and password accordingly. + +3. ownCloud talks to PostgreSQL via TCP/IP, so you need to configure an + appropriate authentication mechanism in /var/lib/pgsql/data/pg_hba.conf. + For a simple configuration with ownCloud and PostgreSQL on the same host, + set the METHOD for the lines that apply to localhost TCP/IP connections + to "password". ownCloud does *not* use a socket to communicate with the + database, so the 'local' line in pg_hba.conf does *not* apply to it. + Note that this will result in the password being sent unencrypted from + ownCloud to the PostgreSQL server. For more details, see + http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html. + +4. You also need to allow the web server to communicate with the database by + TCP/IP: SELinux disallows this by default. Run: + # setsebool -P httpd_can_network_connect_db on + +Now you can launch the ownCloud setup screen, select PostgreSQL in the advanced +settings and fill in your credentials. + +References +========== + +https://fedoraproject.org/wiki/PostgreSQL +http://www.postgresql.org/docs +http://doc.owncloud.org/server/7.0/admin_manual/configuration/configuration_database.html diff --git a/owncloud.spec b/owncloud.spec new file mode 100644 index 0000000..4037e62 --- /dev/null +++ b/owncloud.spec @@ -0,0 +1,765 @@ +Name: owncloud +Version: 8.0.4 +Release: 3%{?dist} +Summary: Private file sync and share server + +License: AGPLv3+ and MIT and BSD and CC-BY and CC-BY-SA and GPLv3 and Public Domain and (MPLv1.1 or GPLv2+ or LGPLv2+) and (MIT or GPL+) and (MIT or GPLv2) and ASL 2.0 and LGPLv3 +URL: http://owncloud.org +# Tarball with non-free sources stripped. To generate: +# ./owncloud-delete-nonfree.sh %%{name}-%%{version}.tar.bz2 +Source0: %{name}-%{version}-repack.tar.bz2 +# orig source: https://download.owncloud.org/community/%%{name}-%%{version}.tar.bz2 +# sha256sum: https://download.owncloud.org/community/%%{name}-%%{version}.tar.bz2.sha256 +# snapshot source: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz +Source1: %{name}-httpd.conf +Source2: %{name}-access-httpd.conf.avail +Source6: %{name}-nginx.conf +# Config snippets +Source100: %{name}-auth-any.inc +Source101: %{name}-auth-local.inc +Source102: %{name}-auth-none.inc +Source103: %{name}-defaults.inc +# packaging notes and doc +Source3: %{name}-README.fedora +Source4: %{name}-mysql.txt +Source5: %{name}-postgresql.txt +# config.php containing just settings we want to specify, OwnCloud's +# initial setup will fill out other settings appropriately +Source7: %{name}-config.php + +# used to repack the source tarball +Source42: %{name}-delete-nonfree.sh + +# Adjust mediaelement not to use its SWF and Silverlight plugins. This +# changes 'plugins:["flash,"silverlight","youtube","vimeo"]' to +# 'plugins:["youtube","vimeo"]' +Patch1: %{name}-6.0.2-videoviewer_noplugins.patch +# Ugly way to deal with Pimple 1.x's lack of PSR-0 compliance. Also forces the +# paths to Sabre deps: /usr/share/php for most of Sabre (to ensure php-sabre-dav +# package, 1.8 version, is used), /usr/share/pear for Sabre\VObject (to ensure +# php-sabredav-Sabre_VObject package, 2.1 version, is used). Please be careful +# and *test* if changing this; test with all versions of all Sabre packages +# installed to make sure it DTRT. Keep an eye on upstream for future changes +# also. +Patch2: %{name}-8.0.1-autoloader_paths.patch +# Turn on include path usage for the Composer autoloader (so it'll find +# systemwide PSR-0 and PSR-4 compliant libraries) +# Upstream wouldn't likely take this, they probably only care about their +# bundled copies +Patch3: %{name}-8.0.1-composer_includepath.patch +# Drop use of dropbox's unnecessary autoloader (composer will find the +# systemwide copy). This is not upstreamable, but see +# https://github.com/owncloud/core/pull/12113 with similar effect for 8.1+ +Patch4: %{name}-8.0.0-drop-dropbox-autoloader.patch +# Submitted upstream: https://github.com/owncloud/core/pull/11056 +# Be less heavy-handed about clearing the opcache after editing config.php +# Avoids triggering a crash in php-opcache: https://github.com/owncloud/core/issues/9885 +Patch5: %{name}-7.0.3-opcache_invalidate.patch +# Drop use of aws-sdk's dead autoloader (composer will find the systemwide copy) +Patch6: 0001-drop-AWS-autoloader.patch +# Disable JS minification (uses non-free JSMin minifier) +Patch7: owncloud-8.0.0-disable_minify.patch +# Stop OC from trying to do stuff to .htaccess files. Just calm down, OC. +# Distributors are on the case. +Patch8: owncloud-8.0.3-dont_update_htacess.patch + +BuildArch: noarch + +# expand pear macros on install +BuildRequires: php-pear + +Requires: %{name}-webserver = %{version}-%{release} +Requires: %{name}-database = %{version}-%{release} + +# Core PHP libs/extensions required by OC core +Requires: php-curl +Requires: php-dom +Requires: php-exif +Requires: php-fileinfo +Requires: php-gd +Requires: php-iconv +Requires: php-json +Requires: php-ldap +Requires: php-mbstring +Requires: php-openssl +Requires: php-pcre +Requires: php-pdo +Requires: php-session +Requires: php-simplexml +Requires: php-xmlwriter +Requires: php-spl +Requires: php-zip +%if 0%{?fedora} || 0%{?rhel} > 6 +Requires: php-filter +%endif + +# External PHP libs required by OC core +# "kriswallsmith/assetic": "1.2.*@dev" +Requires: php-composer(kriswallsmith/assetic) >= 1.2 +Requires: php-composer(kriswallsmith/assetic) < 1.3 +Requires: php-getid3 +# states 5.2.8 exactly, but will work with 5.2.9 or later +Requires: php-composer(phpmailer/phpmailer) +# "pimple/pimple": "~3.0" +Requires: php-composer(pimple/pimple) >= 3.0 +Requires: php-composer(pimple/pimple) < 4.0 +Requires: php-opencloud +Requires: php-composer(doctrine/dbal) >= 2.5.0 +Requires: php-composer(doctrine/dbal) < 2.6 +# "symfony/console": "~2.5" +Requires: php-composer(symfony/console) >= 2.5.0 +Requires: php-composer(symfony/console) < 3.0 +# "symfony/routing": "~2.5" +Requires: php-composer(symfony/routing) >= 2.5.0 +Requires: php-composer(symfony/routing) < 3.0 + +# NB: this will also pull in php-compose(guzzle/guzzle), which is in OC's +# 3rdparty directory. OC sort of has a direct dependency on it but in fact +# it's innately tied to the use of php-opencloud and php-aws-sdk and would +# drop out without those. +# NB 2: also required by apps/files_external +#Requires: php-composer(rackspace/php-opencloud) >= 1.9.2 +Requires: php-opencloud >= 1.9.2 + +# "bantu/ini-get-wrapper": "v1.0.1" +Requires: php-composer(bantu/ini-get-wrapper) >= 1.0.1 +# "ircmaxell/random-lib": "v1.0.0" +# Also pulls in ircmaxell/security-lib which is a dep +Requires: php-composer(ircmaxell/random-lib) >= 1.0.0 +# "natxet/CssMin": "dev-master" +Requires: php-composer(natxet/CssMin) >= 3.0.2 + +## SabreDAV +#Requires: php-composer(sabre/dav) >= 1.8.0 +Requires: php-sabre-dav >= 1.8.0 +# OwnCloud uses vobject directly as well as dav, and it is not at all compatible +# with 3.x; calendar 'rework' branch will fix this when it lands, probably 9.x +Requires: php-pear(pear.sabredav.org/Sabre_VObject) >= 2.0.0 + +## apps/files_external +Requires: php-pear(pear.dropbox-php.com/Dropbox) +Requires: php-pear(phpseclib.sourceforge.net/Net_SFTP) +# Not pulled via Composer but manually dumped into files_external/3rdparty +Requires: php-google-apiclient >= 1.0.3 +Requires: php-aws-sdk >= 2.7.0 + +%if 0%{?rhel} +Requires(post): policycoreutils-python +Requires(postun): policycoreutils-python +%endif + +%description +ownCloud gives you universal access to your files through a web interface or +WebDAV. It also provides a platform to easily view & sync your contacts, +calendars and bookmarks across all your devices and enables basic editing right +on the web. ownCloud is extendable via a simple but powerful API for +applications and plugins. + + +%package httpd +Summary: Httpd integration for ownCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# PHP dependencies +Requires: php + +%description httpd +%{summary}. + + +%package nginx +Summary: Nginx integration for ownCloud + +Provides: %{name}-webserver = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +# PHP dependencies +Requires: php-fpm nginx + +%description nginx +%{summary}. + + +%package mysql +Summary: MySQL database support for ownCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +Requires: php-mysql + +%description mysql +This package ensures the necessary dependencies are in place for ownCloud to +work with MySQL / MariaDB databases. It does not require a MySQL / MariaDB +server to be installed, as you may well wish to use a remote database +server. + +If you want the database to be on the same system as ownCloud itself, you must +also install and enable a MySQL / MariaDB server package. See README.mysql for +more details. + +%package postgresql +Summary: PostgreSQL database support for ownCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +Requires: php-pgsql + +%description postgresql +This package ensures the necessary dependencies are in place for ownCloud to +work with a PostgreSQL database. It does not require the PostgreSQL server +package to be installed, as you may well wish to use a remote database +server. + +If you want the database to be on the same system as ownCloud itself, you must +also install and enable the PostgreSQL server package. See README.postgresql +for more details. + + +%package sqlite +Summary: SQLite 3 database support for ownCloud + +Provides: %{name}-database = %{version}-%{release} +Requires: %{name} = %{version}-%{release} +Requires: php-sqlite3 php-pcre + +%description sqlite +This package ensures the necessary dependencies are in place for ownCloud to +work with an SQLite 3 database stored on the local system. + + +%prep +%setup -q -n %{name} +# Fix line endings of a file we're about to patch +sed -i 's/\r$//' apps/files_encryption/lib/crypt.php +#patch1 +%patch1 -p0 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 + +# prepare package doc +cp %{SOURCE3} README.fedora +cp %{SOURCE4} README.mysql +cp %{SOURCE5} README.postgresql + + +# Strip bundled libraries from global 3rdparty dir +rm -r 3rdparty/{bantu,doctrine,guzzle,ircmaxell/random-lib,ircmaxell/security-lib,james-heinrich,kriswallsmith,natxet,pear,phpmailer/phpmailer/*,phpseclib,pimple,rackspace,sabre,symfony} +rm 3rdparty/{PEAR,PEAR5}.php +# we need to symlink some annoying files back here, though...direct file +# autoloading sucks. "files" sections of "autoload" statements in +# composer.json files cause composer to basically hardcode the path to a +# given file and require that exact path *every time the autoloader is +# invoked*: I can't see an elegant way around that. "classmap" does much +# the same. If we unbundle *all* of the 'files' or 'classmap' bundled +# deps in such a way that they're laid out exactly the same as upstream +# relative to /usr/share/php, then instead of doing this we could patch +# $vendorDir in the composer loader files to be /usr/share/php. +mkdir -p 3rdparty/kriswallsmith/assetic/src +mkdir -p 3rdparty/natxet/CssMin/src +mkdir -p 3rdparty/phpseclib/phpseclib/phpseclib/Crypt +mkdir -p 3rdparty/james-heinrich/getid3/getid3 + +# individual core apps now bundle libs as well - yay +#rm -r apps/search_lucene/3rdparty/Zend +rm -r apps/files_external/3rdparty/{Dropbox,google-api-php-client,aws-sdk-php} + +# ===== BUNDLING NOTES ===== + +## 3rdparty/patchwork - https://github.com/nicolas-grekas/Patchwork-UTF8 +# "patchwork/utf8": "~1.1" +# +# Used to set a UTF-8 locale (function isSetLocaleWorking does not +# just test whether setlocale works, it actually asks Patchwork to +# set a locale) and for its pure PHP implementation of the Normalizer +# class otherwise found in php-intl. See lib/private/util.php +# Patch from adamw to use php-intl's if available: +# https://github.com/owncloud/core/pull/6620 +# We'd also have to set a UTF-8 locale some other way to entirely +# replace OC's use of Patchwork. + +## 3rdparty/mcnetic/phpzipstreamer - https://github.com/McNetic/PHPZipStreamer +# "mcnetic/phpzipstreamer": "dev-master" +# +# OC's copy is somewhat behind upstream, and slightly forked: they imported +# it on 2014-02-20, and added a downstream patch to make it work with +# PHP 5.3 on 2014-03-17: +# https://github.com/owncloud/3rdparty/commit/da3c9f651a26cf076249ebf25c477e3791e69ca3 +# Upstream implemented a different fix against PHP 5.3 on 2014-03-14: +# https://github.com/McNetic/PHPZipStreamer/commit/0af57cc0d113b27e44455be4be690908c4909d78 +# but OC has never synced with that fix. See: +# https://github.com/owncloud/core/pull/3439 + +## apps/files_external/3rdparty/smb4php - forked php class from +# http://www.phpclasses.org/package/4129-PHP-Stream-wrapper-to-access-Windows-shared-files.html +# Replaced by https://github.com/icewind1991/SMB post-8.0 + +## 3rdparty/punic - https://github.com/punic/punic +# "punic/punic": "1.1.0" +# +# Used in date localization: lib/private/l10n.php +# Should be straightforward to unbundle + +# ===== END BUNDLING NOTES ===== + +# clean up content +for f in {l10n.pl,init.sh,setup_owncloud.sh,image-optimization.sh,install_dependencies.sh}; do + find . -name "$f" -exec rm {} \; +done +find . -size 0 -exec rm {} \; + +# Drop pre-compiled binary lumps: Flash and Silverlight +# This means that Flash/Silverlight video/audio fallbacks in the +# 'media' and 'videoviewer' apps are not available. +# To re-introduce these they would have to be built from the +# source as part of this package build, they cannot be shipped +# pre-compiled. - AdamW, 2013/08 +# https://fedoraproject.org/wiki/Packaging:Guidelines#No_inclusion_of_pre-built_binaries_or_libraries +rm apps/files_videoviewer/js/flashmediaelement.swf +rm apps/files_videoviewer/js/silverlightmediaelement.xap + +# let's not ship upstream's 'updater' app, which has zero chance of working and +# a big chance of blowing things up +rm -r apps/updater + + +%build +# Nothing to build + + +%install +install -dm 755 %{buildroot}%{_datadir}/%{name} + +# create owncloud datadir +mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/data +# create writable app dir for appstore +mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/apps +# create owncloud sysconfdir +mkdir -p %{buildroot}%{_sysconfdir}/%{name} + +# install content +for d in $(find . -mindepth 1 -maxdepth 1 -type d | grep -v config); do + cp -a "$d" %{buildroot}%{_datadir}/%{name} +done + +for f in {*.php,*.xml,*.html,occ,robots.txt}; do + install -pm 644 "$f" %{buildroot}%{_datadir}/%{name} +done + +# set default config +install -pm 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/config.php + +# symlink config dir +ln -sf %{_sysconfdir}/%{name} %{buildroot}%{_datadir}/%{name}/config + +# httpd config +install -Dpm 644 %{SOURCE1} \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf +install -Dpm 644 %{SOURCE2} \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}-access.conf.avail +install -Dpm 644 %{SOURCE100} %{SOURCE101} %{SOURCE102} %{SOURCE103} \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/ + +# nginx config +install -Dpm 644 %{SOURCE6} \ + %{buildroot}%{_sysconfdir}/nginx/conf.d/%{name}.conf + +# symlink 3rdparty libs - if possible +# global +ln -s %{_datadir}/php/PHPMailer/class.{phpmailer.php,pop3.php,smtp.php} %{buildroot}%{_datadir}/%{name}/3rdparty/phpmailer/phpmailer +ln -s %{_datadir}/php/Assetic/functions.php %{buildroot}%{_datadir}/%{name}/3rdparty/kriswallsmith/assetic/src/functions.php +ln -s %{_datadir}/pear/Crypt/Random.php %{buildroot}%{_datadir}/%{name}/3rdparty/phpseclib/phpseclib/phpseclib/Crypt/Random.php +ln -s %{_datadir}/php/natxet/CssMin/src/CssMin.php %{buildroot}%{_datadir}/%{name}/3rdparty/natxet/CssMin/src/ +ln -s %{_datadir}/php/getid3/getid3.php %{buildroot}%{_datadir}/%{name}/3rdparty/james-heinrich/getid3/getid3/ + + +%if 0%{?rhel} < 7 +%post +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +restorecon -R %{_sysconfdir}/%{name} || : +restorecon -R %{_localstatedir}/lib/%{name} || : + +%postun +if [ $1 -eq 0 ] ; then +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}/config.php' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_sysconfdir}/%{name}' 2>/dev/null || : +semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || : +fi +%endif + + +%post httpd +%if 0%{?fedora} || 0%{?rhel} > 6 +/usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || : +%else +/sbin/service httpd reload > /dev/null 2>&1 || : +%endif + +%postun httpd +if [ $1 -eq 0 ]; then +%if 0%{?fedora} || 0%{?rhel} > 6 + /usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || : +%else + /sbin/service httpd reload > /dev/null 2>&1 || : +%endif +fi + +%post nginx +%if 0%{?fedora} || 0%{?rhel} > 6 + /usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : + /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : +%else + /sbin/service nginx reload > /dev/null 2>&1 || : + /sbin/service php-fpm reload > /dev/null 2>&1 || : +%endif + +%postun nginx +if [ $1 -eq 0 ]; then +%if 0%{?fedora} || 0%{?rhel} > 6 + /usr/bin/systemctl reload nginx.service > /dev/null 2>&1 || : + /usr/bin/systemctl reload php-fpm.service > /dev/null 2>&1 || : +%else + /sbin/service nginx reload > /dev/null 2>&1 || : + /sbin/service php-fpm reload > /dev/null 2>&1 || : +%endif +fi + + +%files +%doc AUTHORS COPYING-AGPL README.fedora config/config.sample.php + +%dir %attr(-,apache,apache) %{_sysconfdir}/%{name} +# contains sensitive data (dbpassword, passwordsalt) +%config(noreplace) %attr(0600,apache,apache) %{_sysconfdir}/%{name}/config.php + +%{_datadir}/%{name} +%dir %attr(0755,apache,apache) %{_localstatedir}/lib/%{name} +# user data must not be world readable +%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data +%attr(-,apache,apache) %{_localstatedir}/lib/%{name}/apps + + +%files httpd +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%{_sysconfdir}/httpd/conf.d/%{name}-access.conf.avail +%{_sysconfdir}/httpd/conf.d/*.inc + +%files nginx +%config(noreplace) %{_sysconfdir}/nginx/conf.d/%{name}.conf + +%files mysql +%doc README.mysql +%files postgresql +%doc README.postgresql +%files sqlite + + +%changelog +* Sat Jul 04 2015 Shawn Iwinski - 8.0.4-3 +- Fix Symfony max version (2.6 changed to 3.0) + +* Thu Jun 18 2015 Fedora Release Engineering - 8.0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Jun 09 2015 Adam Williamson - 8.0.4-1 +- new release 8.0.4 + +* Mon May 04 2015 Adam Williamson - 8.0.3-2 +- disable the htaccess fiddling stuff harder + +* Fri May 01 2015 Adam Williamson - 8.0.3-1 +- new release 8.0.3 + +* Sat Apr 25 2015 Igor Gnatenko +- Fix nginx conf to serve static apps-appstore + +* Fri Apr 24 2015 Igor Gnatenko +- Use php handler from php-fpm nginx conf + +* Sun Mar 15 2015 Adam Williamson - 8.0.2-1 +- new release 8.0.2 + +* Fri Mar 06 2015 Adam Williamson - 8.0.1-0.2.rc1 +- backport some significant app store fixes from upstream stable8 + +* Fri Mar 06 2015 Adam Williamson - 8.0.1-0.1.rc1 +- update to 8.0.1rc1 + +* Mon Feb 23 2015 Adam Williamson - 8.0.0-6 +- extend the htaccess patch to cover updater as well as initial setup +- rebase apache config stuff again, private dir denials only on 8.x branch + +* Mon Feb 23 2015 Adam Williamson - 8.0.0-5 +- simplify dropbox autoloader patch (just drop it entirely a la AWS) + +* Mon Feb 23 2015 Adam Williamson - 8.0.0-4 +- unbundle php-natxet-cssmin, add getid3 to the list of symlink hacks + +* Mon Feb 23 2015 Adam Williamson - 8.0.0-3 +- merge second version of Apache/Nginx config changes into 8.x build +- backport upstream PR #14119 to fix OC for DBAL 2.5.1 + +* Sun Feb 22 2015 Adam Williamson - 7.0.4-3 +- revise and strengthen Apache configuration layout, fix external apps +- fix external apps for Nginx + +* Sun Feb 22 2015 Adam Williamson - 8.0.0-2 +- Initial version of Apache/Nginx config changes later re-done in 7.0.4-3 + +* Sat Feb 21 2015 Adam Williamson - 8.0.0-1 +- new release 8.0.0 +- rediff patches, adjust for new bundled libs, etc etc + +* Sat Dec 20 2014 Adam Williamson - 7.0.4-2 +- backport upstream support for google PHP lib 1.x and unbundle it + +* Tue Dec 09 2014 Adam Williamson - 7.0.4-1 +- new release 7.0.4 + +* Tue Nov 25 2014 Adam Williamson - 7.0.3-3 +- fix dropbox autoload patch (thanks Tomas Dolezal) #1168082 + +* Tue Nov 11 2014 Adam Williamson - 7.0.3-2 +- drop unnecessary bits from 3rdparty_includes.patch +- split Dropbox loading changes into a separate patch (submitted upstream) + +* Mon Nov 10 2014 Adam Williamson - 7.0.3-1 +- new release 7.0.3 + +* Wed Oct 29 2014 Adam Williamson - 7.0.2-4 +- db sub-packages should not depend on db server packages +- improve README +- improve db sub-package descriptions +- don't check for new versions or working .htaccess files + +* Tue Oct 28 2014 Adam Williamson - 7.0.2-3 +- drop unnecessary deps: php-gmp (#1152438) and Net_Curl(#999720) +- re-arrange deps in spec to be the way I like 'em + +* Tue Sep 09 2014 Adam Williamson - 7.0.2-2 +- 10927.patch: backport fix for an upgrade bug (upstream #10762) + +* Thu Aug 28 2014 Adam Williamson - 7.0.2-1 +- update to 7.0.2 +- update patch for using Composer autoloader with 3rdparty deps + +* Wed Aug 20 2014 Adam Williamson - 7.0.1-2 +- make php directives in httpd config conditional on mod_php (FPM compat) + +* Wed Aug 20 2014 Adam Williamson - 7.0.1-1 +- update to 7.0.1 +- drop contact_type.patch (merged upstream) + +* Tue Jul 29 2014 Adam Williamson - 7.0.0-6 +- do not ship upstream's 'updater' app (it'll only lead to tears) +- don't patch and ship OC's sample config, write a stub instead + +* Tue Jul 29 2014 Adam Williamson - 7.0.0-5 +- fix up sabre paths right this time + +* Tue Jul 29 2014 Adam Williamson - 7.0.0-4 +- more autoloader tweaking +- use composer not OC autoloader for legacy 3rdparty includes (core#9643) +- specify explicit paths to Sabre deps + +* Sun Jul 27 2014 Adam Williamson - 7.0.0-3 +- update apache config for OC 7 changes +- drop unneeded isoft/mssql-bundle from 3rdparty + +* Sun Jul 27 2014 Adam Williamson - 7.0.0-2 +- opcache_invalidate.patch: avoid triggering a crash in the PHP opcache +- contact_type.patch: fix selection of current field type in contact view + +* Thu Jul 24 2014 Adam Williamson - 7.0.0-1 +- 7.0.0 +- rediff 3rdparty_includes.patch +- update 3rdparty strip commands and dependencies for upstream changes +- update dependencies + +* Mon Jun 30 2014 Gregor Tätzner - 6.0.4-1 +- 6.0.4 + +* Sat Jun 07 2014 Fedora Release Engineering - 6.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 01 2014 Gregor Tätzner - 6.0.3-1 +- 6.0.3 +- update symfony routing patch + +* Tue Mar 04 2014 Gregor Tätzner - 6.0.2-1 +- 6.0.2 + +* Mon Feb 24 2014 Adam Williamson - 6.0.1-3 +- set a minimum ver on the DBAL req for safety (using with 2.3 is dangerous) + +* Mon Jan 27 2014 Adam Williamson - 6.0.1-2 +- unbundle phpseclib (packaged now) + +* Thu Jan 23 2014 Gregor Tätzner - 6.0.1-1 +- 6.0.1 + +* Tue Jan 14 2014 Gregor Tätzner - 6.0.0a-9 +- fix routing with symfony 2.3 + +* Fri Jan 10 2014 Adam Williamson - 6.0.0a-8 +- make a warning OC keeps triggering into a debug message + +* Thu Jan 9 2014 Adam Williamson - 6.0.0a-7 +- re-enable irods, patch loading of it, add dependency on it + +* Fri Jan 3 2014 Adam Williamson - 6.0.0a-6 +- disable irods a bit harder + +* Fri Jan 3 2014 Adam Williamson - 6.0.0a-5 +- drop non-existent OC_User_IMAP from config file + +* Fri Jan 3 2014 Adam Williamson - 6.0.0a-4 +- apps_3rdparty_includes: fix more 3rdparty loading stuff +- disable_irods: disable storage app's irods (it's broken) + +* Mon Dec 30 2013 Adam Williamson - 6.0.0a-3 +- tar-include, blowfish-include, dropbox-include: fix more paths + +* Mon Dec 30 2013 Adam Williamson - 6.0.0a-2 +- dropbox-include.patch: fix loading of system copy of php-Dropbox + +* Sun Dec 22 2013 Adam Williamson - 6.0.0a-1 +- 6.0.0a + +* Sun Dec 22 2013 Gregor Tätzner - 6.0.0-1 +- 6.0.0 + +* Fri Dec 20 2013 Adam Williamson - 5.0.14a-2 +- Correct location of php-symfony-routing: #1045301 + +* Fri Dec 20 2013 Adam Williamson - 5.0.14a-1 +- 5.0.14a + +* Sat Nov 16 2013 Gregor Tätzner - 5.0.13-1 +- 5.0.13 + +* Tue Oct 08 2013 Gregor Tätzner - 5.0.12-1 +- 5.0.12 + +* Tue Sep 24 2013 Gregor Tätzner - 5.0.11-2 +- keep MDB2/pgsql driver, genuine version causes upgrade problems (RBZ#962082) + +* Sat Sep 07 2013 Gregor Tätzner - 5.0.11-1 +- 5.0.11 + +* Wed Sep 04 2013 Gregor Tätzner - 5.0.10-4 +- unbundle sabredav again + +* Fri Aug 23 2013 Adam Williamson - 5.0.10-3 +- patch mediaelement not to try and use its plugins + +* Fri Aug 23 2013 Adam Williamson - 5.0.10-2 +- drop binary Flash and Silverlight blobs: #1000257 +- don't ship source of jplayer in the binary package + +* Sun Aug 18 2013 Gregor Tätzner - 5.0.10-1 +- 5.0.10 + +* Thu Aug 15 2013 Gregor Tätzner - 4.5.13-2 +- RBZ #962082 keep 3rdparty pqsql mdb2 driver + +* Sat Aug 03 2013 Fedora Release Engineering - 5.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jul 23 2013 Gregor Tätzner - 5.0.9-2 +- buildreq: php-pear (RBZ #987279) + +* Tue Jul 16 2013 Gregor Tätzner - 5.0.9-1 +- major upgrade to 5.0.9 +- symlink 3rdparty libs and drop most of the patches +- new deps: php-ZendFramework symfony + +* Sat Jun 08 2013 Gregor Tätzner - 4.5.12-1 +- 4.5.12 + +* Thu May 16 2013 Gregor Tätzner - 4.5.11-2 +- RBZ #963701: require mdb2-mysql not mysqli + +* Thu May 16 2013 Gregor Tätzner - 4.5.11-1 +- 4.5.11 + +* Tue Apr 23 2013 Gregor Tätzner - 4.5.10-1 +- 4.5.10 + +* Sat Apr 13 2013 Gregor Tätzner - 4.5.9-1 +- 4.5.9 +- disable remote access by default + +* Fri Mar 15 2013 Gregor Tätzner - 4.5.8-1 +- 4.5.8 +- unbundle dropbox-php +- log to syslog +- include nginx config + +* Mon Feb 25 2013 Gregor Tätzner - 4.5.7-2 +- added script for re-creating stripped tarball +- new httpd.conf for httpd 2.4 + +* Sun Feb 24 2013 Gregor Tätzner - 4.5.7-1 +- 4.5.7 + +* Sun Jan 13 2013 Gregor Tätzner - 4.0.8-7 +- fixed selinux file context on rhel + +* Sat Dec 08 2012 Gregor Tätzner - 4.0.8-6 +- unbundled phpass and php-when +- added database setup instructions + +* Thu Nov 08 2012 Gregor Tätzner - 4.0.8-5 +- moved included sqlite3 driver to owncloud-sqlite +- unbundled php-cloudfiles +- reworked runtime requirements + +* Sun Nov 04 2012 Gregor Tätzner - 4.0.8-4 +- repacked source tarball (deleted jslint code) + +* Sat Nov 03 2012 Gregor Tätzner - 4.0.8-3 +- added missing licenses +- obliterated jslint code from aceeditor + +* Fri Nov 02 2012 Gregor Tätzner - 4.0.8-2 +- updated license field +- added README.fedora + +* Thu Oct 18 2012 Gregor Tätzner - 4.0.8-1 +- owncloud-4.0.8 + +* Fri Oct 12 2012 Gregor Tätzner - 4.0.7-5 +- unbundle php-getid3 +- remove conf dir access check + +* Tue Oct 02 2012 Gregor Tätzner - 4.0.7-4 +- require rsyslog +- switched log type back to 'owncloud' + +* Sun Sep 23 2012 Gregor Tätzner - 4.0.7-3 +- unbundled Archive/Tar.php, Guess.php, phpmailer +- created virtual packages for supported databases +- added logrotate script + +* Thu Sep 20 2012 Gregor Tätzner - 4.0.7-2 +- moved httpd files and sciptlets into own subpackage +- redirected log output to /var/log/owncloud.log +- deleted unecessary files + +* Wed Sep 19 2012 Gregor Tätzner - 4.0.7-1 +- updated to version 4.0.7 + +* Fri Apr 06 2012 Felix Kaechele - 3.0.1-1 +- initial package + -- cgit