/[packages]/backports/5/nextcloud/current/SPECS/nextcloud.spec
ViewVC logotype

Contents of /backports/5/nextcloud/current/SPECS/nextcloud.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1109627 - (show annotations) (download)
Mon Jul 10 16:17:20 2017 UTC (6 years, 7 months ago) by zezinho
File size: 5724 byte(s)
better fix default data path change when coming from owncloud
1 %define version 10.0.5
2 %define rel 5
3 %define prerel %{nil}
4
5 %if "%{prerel}" != "%{nil}"
6 %define lc_prerel %(echo %{prerel} | tr "A-Z" "a-z")
7 %define release %mkrel 1.%{lc_prerel}.%{rel}
8 %else
9 %define release %mkrel %{rel}
10 %endif
11
12 # exclude 3rd party library from dependencies scanning
13 %global __requires_exclude_from ^%{_datadir}/%{name}/3rdparty/
14 %global __provides_exclude_from ^%{_datadir}/%{name}/3rdparty/
15 # exclude remaining PHP dependencies as long as their usage is not proven
16 %global __requires_exclude pear\\(.*\\)
17 %define __jar_repack %{nil}
18
19 Summary: Open personal cloud
20 Name: nextcloud
21 Version: %{version}
22 Release: %{release}
23 Source0: https://download.nextcloud.com/server/releases/%{name}-%{version}%{?prerel}.zip
24 License: AGPLv3
25 Group: Monitoring
26 Url: http://nextcloud.com
27 Requires: apache-mod_php
28 Requires: php-zip
29 Requires: php-mbstring
30 Requires: php-gd
31 Requires: php-curl
32 Requires: php-iconv
33 Requires: php-opcache
34 Recommends: php-sqlite3 php-pdo_sqlite php-fileinfo
35 BuildArch: noarch
36
37 Obsoletes: owncloud < 9.1.50
38 Provides: owncloud = %version-%release
39
40 %description
41 A personal cloud server which runs on you personal server
42 and enables accessing your data from everywhere and sharing
43 with other people.
44
45 %prep
46 %setup -q -n %{name}
47
48 %install
49 mkdir -p %{buildroot}%{_datadir}/%{name}
50 cp -pr * %{buildroot}%{_datadir}/%{name}
51
52 rm -rf %{buildroot}%{_datadir}/%{name}/config
53 rm -f %{buildroot}%{_datadir}/%{name}/AUTHORS
54 rm -f %{buildroot}%{_datadir}/%{name}/COPYING-AGPL
55 rm -f %{buildroot}/.htaccess
56
57 ca_bundle=%{buildroot}%{_datadir}/%{name}/resources/config/ca-bundle.crt
58 rm -f $ca_bundle
59 ln -s ../../../../../etc/pki/tls/certs/ca-bundle.crt $ca_bundle
60
61 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
62 mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
63 pushd %{buildroot}%{_datadir}/%{name}
64 ln -s ../../..%{_sysconfdir}/%{name} config
65 ln -s ../../..%{_localstatedir}/lib/%{name} data
66 popd
67
68 # make config and apps directory apache-writable
69 chmod 775 %{buildroot}%{_sysconfdir}/%{name}
70 chmod 775 %{buildroot}%{_datadir}/%{name}/apps
71
72 mkdir -p %{buildroot}%{webappconfdir}
73 cat > %{buildroot}%{webappconfdir}/%{name}.conf <<EOF
74 # %{name} configuration
75 Alias /%{name} %{_datadir}/%{name}
76
77 <Directory %{_datadir}/%{name}>
78 <IfModule mod_authz_core.c>
79 # Apache 2.4
80 Require all granted
81 </IfModule>
82 <IfModule !mod_authz_core.c>
83 # Apache 2.2
84 Order allow,deny
85 Allow from all
86 </IfModule>
87
88 AddDefaultCharset utf-8
89 php_value upload_max_filesize 513M
90 php_value post_max_size 513M
91 php_value memory_limit 512M
92 php_value mbstring.func_overload 0
93 php_value always_populate_raw_post_data -1
94
95 <IfModule mod_fcgid.c>
96 <IfModule mod_setenvif.c>
97 <IfModule mod_headers.c>
98 SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
99 RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
100 </IfModule>
101 </IfModule>
102 </IfModule>
103
104 <IfModule mod_rewrite.c>
105 RewriteEngine on
106 RewriteBase /nextcloud
107 RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
108 RewriteRule ^\.well-known/host-meta public.php?service=host-meta [QSA,L]
109 RewriteRule ^\.well-known/host-meta\.json public.php?service=host-meta-json [QSA,L]
110 RewriteRule ^\.well-known/carddav remote.php/carddav/ [R]
111 RewriteRule ^\.well-known/caldav remote.php/caldav/ [R]
112 RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L]
113 RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L]
114 RewriteRule ^remote/(.*) remote.php [QSA,L]
115 </IfModule>
116 </Directory>
117
118 <Directory %{_datadir}/%{name}/data>
119 <IfModule mod_authz_core.c>
120 # Apache 2.4
121 Require all denied
122 </IfModule>
123 <IfModule !mod_authz_core.c>
124 # Apache 2.2
125 Order Deny,Allow
126 Deny from All
127 Allow from None
128 </IfModule>
129 </Directory>
130 EOF
131
132 cat > %{buildroot}%_datadir/%name/.htaccess <<EOF
133 # Version: %{version}
134 EOF
135
136 pushd %buildroot%{webappconfdir}
137 ln -s %name.conf owncloud.conf
138 popd
139
140
141 %post
142 if [ -e %{_localstatedir}/lib/owncloud/config.php -a ! -e %{_localstatedir}/lib/%name/config.php ]; then
143 mv %{_localstatedir}/lib/owncloud/config.php %{_localstatedir}/lib/%name/
144 fi
145
146 # Upgrade from Owncloud 9.1.5 : we move the config file as it is now in nextcloud conf directory
147 if [ -e %{_sysconfdir}/owncloud/config.php ]; then
148 mv %{_sysconfdir}/owncloud/config.php %{_sysconfdir}/%name/config.php
149 # if the default path was not changed, we move it to nextcloud
150 sed -i s+http://localhost/owncloud+http://localhost/nextcloud+ %{_sysconfdir}/%name/config.php
151 # if the default data path was not changed, the link has disappeared so we point to the real folder
152 sed -i s+/usr/share/owncloud/data+/var/lib/owncloud+ %{_sysconfdir}/%name/config.php
153 fi
154
155 %files
156 %doc AUTHORS
157 %dir %{_datadir}/%{name}
158 %{_datadir}/%{name}/3rdparty
159 %{_datadir}/%{name}/core
160 %{_datadir}/%{name}/config
161 %{_datadir}/%{name}/data
162 %{_datadir}/%{name}/lib
163 %{_datadir}/%{name}/l10n
164 %{_datadir}/%{name}/occ
165 %{_datadir}/%{name}/ocs
166 %{_datadir}/%{name}/ocs-provider
167 %{_datadir}/%{name}/resources
168 %{_datadir}/%{name}/settings
169 %{_datadir}/%{name}/themes
170 %{_datadir}/%{name}/updater
171 %{_datadir}/%{name}/*.php
172 %{_datadir}/%{name}/db_structure.xml
173 %{_datadir}/%{name}/index.html
174 %{_datadir}/%{name}/robots.txt
175 %{_datadir}/%{name}/.htaccess
176 %attr(-,root,apache) %{_datadir}/%{name}/apps
177 %attr(-,root,apache) %{_sysconfdir}/%{name}
178 %attr(-,apache,apache) %{_localstatedir}/lib/%{name}
179 %config(noreplace) %{webappconfdir}/*.conf

  ViewVC Help
Powered by ViewVC 1.1.30