Browse Source

new package

master
parent
commit
89d5aa9d4e
  1. 98
      owncloud/owncloud-apache.conf
  2. 19
      owncloud/owncloud.patch
  3. 128
      owncloud/owncloud.spec
  4. 61
      owncloud/rc.owncloud

98
owncloud/owncloud-apache.conf

@ -0,0 +1,98 @@
##
## owncloud-apache.conf -- Wordpress Apache Custom Configuration
##
ServerRoot @l_prefix@
ServerAdmin root@@l_hostname@.@l_domainname@
ServerName @l_hostname@.@l_domainname@
ServerTokens Prod
User @l_rusr@
Group @l_rgrp@
Listen 127.0.0.1:8081
# runtime files
PidFile @l_prefix@/var/owncloud/run/owncloud-apache.pid
ScoreBoardFile @l_prefix@/var/owncloud/run/owncloud-apache.sb
LockFile @l_prefix@/var/owncloud/run/owncloud-apache.lck
# include apache-php
Include @l_prefix@/etc/apache/apache.d/apache-php.conf
# include apache-extfwd
Include @l_prefix@/etc/apache/apache.d/apache-extfwd.conf
# server behaviour
Timeout 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 15
MaxRequestsPerChild 500
HostnameLookups off
UseCanonicalName on
# access logging
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog @l_prefix@/var/owncloud/log/owncloud-apache.access.log common
# error logging
LogLevel warn
ErrorLog @l_prefix@/var/owncloud/log/owncloud-apache.error.log
ServerSignature on
# secure root directory
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
# browser specifics
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
# SSL/TLS support
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLMutex sem
SSLSessionCache shmcb:@l_prefix@/var/owncloud/run/owncloud-apache.scache(512000)
SSLSessionCacheTimeout 300
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
<Files ~ "\.(cgi|shtml|phtml|php?)$">
SSLOptions +StdEnvVars
</Files>
<Directory "@l_prefix@/cgi">
SSLOptions +StdEnvVars
</Directory>
</IfModule>
# configure WordPress
AddType application/x-httpd-php .php
php_admin_flag safe_mode 0
php_admin_flag magic_quotes_gpc 0
php_admin_flag register_globals 0
php_admin_flag session.auto_start 0
php_admin_value upload_tmp_dir @l_prefix@/var/owncloud/tmp
DocumentRoot @l_prefix@/lib/owncloud
DirectoryIndex index.php
ErrorDocument 404 /index.php
ExpiresByType text/html A1
<Directory "@l_prefix@/lib/owncloud">
Options -Indexes +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

19
owncloud/owncloud.patch

@ -0,0 +1,19 @@
Index: owncloud/config/config.sample.php
--- owncloud/config/config.sample.php.orig 2012-01-29 14:50:19.000000000 +0100
+++ owncloud/config/config.sample.php 2012-02-09 14:35:39.000000000 +0100
@@ -6,12 +6,12 @@
"installed" => false,
"dbtype" => "sqlite",
"dbname" => "owncloud",
-"dbuser" => "",
-"dbpassword" => "",
+"dbuser" => "owncloud",
+"dbpassword" => "owncloud",
"dbhost" => "",
"dbtableprefix" => "",
"forcessl" => false,
"enablebackup" => false,
-// "datadirectory" => ""
+"datadirectory" => "@l_prefix@/var/owncloud/data"
);
?>

128
owncloud/owncloud.spec

@ -0,0 +1,128 @@
##
## owncloud.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: owncloud
Summary: Cloud Storage Service
URL: http://owncloud.org/
Vendor: ownCloud Inc.
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: EVAL
Group: Web
License: AGPL
Version: 3.0.0
Release: 20120216
# list of sources
Source0: http://owncloud.org/releases/owncloud-%{version}.tar.bz2
Source1: owncloud-apache.conf
Source2: rc.owncloud
Patch0: owncloud.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101
PreReq: OpenPKG, openpkg >= 20100101
PreReq: apache
PreReq: apache-php
PreReq: apache-php::with_json = yes
PreReq: apache-php::with_gd = yes
PreReq: apache-php::with_sqlite = yes
PreReq: apache-php::with_curl = yes
PreReq: apache-php::with_json = yes
PreReq: apache-php::with_xml = yes
PreReq: apache-php::with_zip = yes
PreReq: apache-php::with_mbstring = yes
%description
ownCloud enables universal access to files through the widely
implemented WebDAV standard, providing a platform to easily view
and sync contacts, calendars and bookmarks across devices while
supporting sharing, viewing and editing via the web interface.
Installation has minimal server requirements, doesn’t need special
permissions and is quick. ownCloud is extendable via a simple,
powerful API for applications.
%track
prog owncloud = {
comment = "upstream vendor does not support automatic tracking"
version = %{version}
url = http://owncloud.org/releases/
regex = owncloud-(__VER__)\.tar\.bz2
}
%prep
%setup -q -c
%patch -p0
%build
%install
# create installation hierarchy
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/etc/owncloud \
$RPM_BUILD_ROOT%{l_prefix}/lib/owncloud \
$RPM_BUILD_ROOT%{l_prefix}/var/owncloud/data \
$RPM_BUILD_ROOT%{l_prefix}/var/owncloud/run \
$RPM_BUILD_ROOT%{l_prefix}/var/owncloud/log
# install default ownCloud configuration
%{l_shtool} install -c -m 644 %{l_value -s -a} \
owncloud/config/config.sample.php \
$RPM_BUILD_ROOT%{l_prefix}/etc/owncloud/config.php
# install default Apache webserver configuration
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE owncloud-apache.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/owncloud/
# remove nasty files
rm -f "owncloud/apps/calendar/img/Icon License"
rm -f "owncloud/settings/img/log Icon License"
# remove empty directories
rm -rf owncloud/config owncloud/data
# move ownCloud program files into place
cp -rp owncloud/* $RPM_BUILD_ROOT%{l_prefix}/lib/owncloud/
# link data and config directories to our location
( cd $RPM_BUILD_ROOT%{l_prefix}/lib/owncloud
ln -s ../../var/owncloud/data data
ln -s ../../etc/owncloud config
) || exit $?
# install run-command script
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.owncloud} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%config %{l_prefix}/etc/owncloud/*' \
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/owncloud/*'
%files -f files
%clean

61
owncloud/rc.owncloud

@ -0,0 +1,61 @@
#!@l_prefix@/bin/openpkg rc
##
## rc.owncloud -- Run-Commands
##
%config
owncloud_enable="$openpkg_rc_def"
owncloud_log_rotsteps="10"
owncloud_log_rotminsize="10M"
owncloud_log_rotcomplevel="9"
owncloud_log_rotprolog="true"
owncloud_log_rotepilog="true"
%common
owncloud_apache_cfgfile="@l_prefix@/etc/owncloud/owncloud-apache.conf"
owncloud_apache_pidfile="@l_prefix@/var/owncloud/run/owncloud-apache.pid"
owncloud_apache_logfile="@l_prefix@/var/owncloud/log/owncloud-access.log"
%status -u @l_susr@ -o
owncloud_usable="no"
owncloud_active="no"
@l_prefix@/sbin/apache -t -f $owncloud_apache_cfgfile 2>/dev/null && \
owncloud_usable="yes"
[ -f $owncloud_apache_pidfile ] && \
kill -0 `cat $owncloud_apache_pidfile` && \
owncloud_active="yes"
echo "owncloud_enable=\"$owncloud_enable\""
echo "owncloud_usable=\"$owncloud_usable\""
echo "owncloud_active=\"$owncloud_active\""
%start -u @l_susr@
rcService owncloud enable yes || exit 0
rcService owncloud active yes && exit 0
@l_prefix@/sbin/apache -f $owncloud_apache_cfgfile
%stop -u @l_susr@
rcService owncloud enable yes || exit 0
rcService owncloud active no && exit 0
[ -f $owncloud_apache_pidfile ] && \
kill -TERM `cat $owncloud_apache_pidfile`
sleep 2
%restart -u @l_susr@
rcService owncloud enable yes || exit 0
rcService owncloud active no && exit 0
rc owncloud stop start
%reload -u @l_susr@
rcService owncloud enable yes || exit 0
rcService owncloud active no && exit 0
@l_prefix@/sbin/apache -f $owncloud_apache_cfgfile -k graceful
%daily -u @l_susr@
rcService owncloud enable yes || exit 0
shtool rotate -f \
-n $owncloud_log_rotsteps -s $owncloud_log_rotminsize -d \
-z $owncloud_log_rotcomplevel -o @l_susr@ -g @l_mgrp@ -m 644 \
-P "$owncloud_log_rotprolog" \
-E "$owncloud_log_rotepilog; rc owncloud reload" \
$owncloud_apache_logfile
Loading…
Cancel
Save