[packages/owncloud] Move webservers config to separate files

wiget wiget at pld-linux.org
Thu Aug 30 17:59:36 CEST 2012


commit 83880b0eef43b5102b04882b09bd57fc05c44df6
Author: Artur Frysiak <artur at frysiak.net>
Date:   Thu Aug 30 17:54:14 2012 +0200

    Move webservers config to separate files

 apache.conf   | 21 +++++++++++++++++++++
 lighttpd.conf |  6 ++++++
 owncloud.spec | 41 +++++------------------------------------
 3 files changed, 32 insertions(+), 36 deletions(-)
---
diff --git a/owncloud.spec b/owncloud.spec
index 2974490..8b9a1d0 100644
--- a/owncloud.spec
+++ b/owncloud.spec
@@ -7,6 +7,8 @@ Group:		Applications/WWW
 Source0:	http://owncloud.org/releases/%{name}-%{version}.tar.bz2
 # Source0-md5:	7fdbe0113621730a6787afdc7ebb529f
 Source1:	config.php
+Source2:	apache.conf
+Source3:	lighttpd.conf
 Patch0:		system-pear.patch
 URL:		http://owncloud.org
 BuildRequires:	rpmbuild(macros) >= 1.268
@@ -60,39 +62,6 @@ ownCloud server on their devices.
 %setup -q -n %{name}
 %patch0 -p1
 
-cat > apache.conf <<'EOF'
-Alias /%{name} %{_appdir}
-<Directory %{_appdir}>
-	ErrorDocument 403 /%{name}/core/templates/403.php
-	ErrorDocument 404 /%{name}/core/templates/404.php
-	<IfModule mod_php5.c>
-		php_value upload_max_filesize 512M
-		php_value post_max_size 512M
-		php_value memory_limit 512M
-	</IfModule>
-	<IfModule mod_rewrite.c>
-		RewriteEngine on
-		RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
-		RewriteRule ^.well-known/host-meta /%{name}/public.php?service=host-meta [QSA,L]
-		RewriteRule ^.well-known/carddav /%{name}/remote.php/carddav/ [R]
-		RewriteRule ^.well-known/caldav /%{name}/remote.php/caldav/ [R]
-		RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
-		RewriteRule ^remote/(.*) remote.php [QSA,L]
-	</IfModule>
-	Options -Indexes
-	Allow from all
-</Directory>
-EOF
-
-cat > lighttpd.conf <<'EOF'
-alias.url += (
-    "/%{name}" => "%{_appdir}",
-)
-$HTTP["url"] =~ "^/%{name}($|/)" {
-     dir-listing.activate = "disable"
-}
-EOF
-
 # remove bundled 3rdparty libs
 %{__rm} -r 3rdparty/{class.phpmailer.php,class.smtp.php,Archive,Console,Crypt_Blowfish,MDB2,MDB2.php,XML}
 # PEAR-core
@@ -106,9 +75,9 @@ cp -pdR *.php db_structure.xml 3rdparty apps core files l10n lib ocs search sett
 ln -s %{_sysconfdir}/config $RPM_BUILD_ROOT%{_appdir}/config
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config/config.php
 
-cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
-cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
 install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
 
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 0000000..9ee80c0
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,21 @@
+Alias /owncloud /usr/share/owncloud
+<Directory /usr/share/owncloud>
+	ErrorDocument 403 /owncloud/core/templates/403.php
+	ErrorDocument 404 /owncloud/core/templates/404.php
+	<IfModule mod_php5.c>
+		php_value upload_max_filesize 512M
+		php_value post_max_size 512M
+		php_value memory_limit 512M
+	</IfModule>
+	<IfModule mod_rewrite.c>
+		RewriteEngine on
+		RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+		RewriteRule ^.well-known/host-meta /owncloud/public.php?service=host-meta [QSA,L]
+		RewriteRule ^.well-known/carddav /owncloud/remote.php/carddav/ [R]
+		RewriteRule ^.well-known/caldav /owncloud/remote.php/caldav/ [R]
+		RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
+		RewriteRule ^remote/(.*) remote.php [QSA,L]
+	</IfModule>
+	Options -Indexes
+	Allow from all
+</Directory>
diff --git a/lighttpd.conf b/lighttpd.conf
new file mode 100644
index 0000000..88c38b8
--- /dev/null
+++ b/lighttpd.conf
@@ -0,0 +1,6 @@
+alias.url += (
+    "/owncloud" => "/usr/share/owncloud",
+)
+$HTTP["url"] =~ "^/owncloud($|/)" {
+     dir-listing.activate = "disable"
+}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/owncloud.git/commitdiff/c50fa9d23c37044e4f929f481d7b8405630c9469



More information about the pld-cvs-commit mailing list