1 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
2 # Maintainer: David Runge <dvzrv@archlinux.org>
5 # NOTE: always check first whether the version is supposed to be packaged:
6 # https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule
9 pkgdesc="A cloud server to store your files centrally on a hardware controlled by you"
11 url="https://nextcloud.com"
13 makedepends=(php php-legacy)
15 'curl: for webcron jobs from within uwsgi'
16 'ffmpeg: for preview generation'
17 'libreoffice: for preview generation'
18 'mariadb: to use a local MariaDB server'
19 'memcached: to use a local memcached server'
20 'mod_itk: to use the Apache web server'
21 'postgresql: to use a local PostgreSQL server'
22 'redis: to use a local Redis server'
23 'smbclient: for SMB/CIFS integration'
24 'sudo: for privilege elevation in occ command when not run as root'
27 etc/webapps/$pkgname/config/config.php
28 etc/webapps/$pkgname/.htaccess
29 etc/uwsgi/$pkgname.ini
31 # there are no elf files, no need to strip anything
33 install=$pkgname.install
35 https://download.nextcloud.com/server/releases/$pkgname-$pkgver.tar.bz2{,.asc}
46 sha512sums=('058ea33d4fbbf7e8c54dfda71989e95893dc24e0c538d7dbc502f3cd36247d4cfa7e5d32d5d437532229aee8d73fe7e643672835d7207aa3d7990ff455a3372f'
48 '5f9be223225e6ad2772989c440df8585a852ea0be697274384064ec73df47dab2f5d0847c275732fab26c419a713911d8f77ebc2b639bf6e8ede76272b752cde'
49 '92592f9a76ee534d0ae6d3aedf2257c147337debe7e2d6dbec1daff66a682e3abc74611e08662058de314bf3ea6ff1c85efd678674b782d71251c38786e446f9'
50 '2791382d7b005c64cd6938695f273e83435cc5f1b785fe7d44d6dbd69864c502847e45d93c4a5f6752a759a660118279e3e22e5bc32f79b8775693fde603a9c5'
51 'b54b5a9957f846842603677b21fa79628ab69b5b7e05913dcf631ae2b4fd11d09822429900ab0efc6e75e83f85cc0d8e7d53eb6a4c91e08148ddbed235b2453b'
52 '1d06f339c43d57e5f5406c2698b815241fd9e39039a9e55f777face510c9a5ddae5ccd4e051393e8f16f391301a6aa03fff2462837a2d3441d969ea7195e7d84'
53 '919008a2bf6cf2492cb1e9c8e28c1e082d74e45da5a96e6669f8971d6cf721e36d23625c89918fe10d8bc1b202c0340aa897849d9ec501a26f3f4572ccb57a98'
54 'adff09fa5eb5932aa76f987ae92177fff799c0ca4233c418ba47796078fe1ced9d49e987a57a304a4779d43d8e64dffd8ba69443348810f09c5d5127eadd162f'
55 '3d3e22841bbae0b910c1d1dc9cccfff1182f5fd569c39ae76ca7f3828de31d5d91bf0d28524dd397171f027046bfb193845ecfc06bd0abbbc79899acb26306bb'
56 'eb69785a5b0df0e2a11f53f9c2e2dbf75681d7c698e88cbcc5ceed713a558d528511cc576813cc083cbaa28a2c83d543a39436ad4805670348ef22634305b1c8')
57 b2sums=('4d5021353560626fda6cd71f073c4a219e7a4062738edbca5f8a69e138ba7f970588e88f3975c9bb22e7e7a3bb26727972729f569ed7a66cecdc86cccc0fb6cb'
59 '7d40d120c28291f1a7537f3e1b5049fa83c9c0af949371345ea9ccdf3de4a0f3a3a06edbc52d9254dba483e4d11acf562cf679b9e379c5dfc2f61dfbfc2e4cef'
60 '4ad061efbc20b4d0e9f8cfd01c5e8e612fa5af29bce754b77f90c1835b98ee445ef4de3d8c83da91461053622620af14d880eb9014b51f2383c75f1860d479f4'
61 'c69f18de513562e32f0f655fee7ef81877d74a76717e2eaad9a13882bf8edd0dad99bec5958e460a4ec32eecfdd425ae009d11ac27af16a3ad1d6498282be32f'
62 'c5c4499f588c2b4d90223c00b2c1e575611d4c90c5077d3199cfcdad455ad55ab34db66159ad2c42a2f56db87a844f60ff4cdfd2fdb14df3a52f44e376dd2e3e'
63 '1a61a89531636b65dade03cd7edca8747b3e1e880f9bbd4d5a53cffa452d70fe17e345cfed739ae92e99e336d4c1f2633c84a5c84a4ee6da518762bf1396b1db'
64 'd132044cb7f1d61a1ce87800d2e1142e3ac385acdec25e2f5ad685603a0ffa88e105f4c35688584d65d287adbb40b8d9a02d6a80d7a0b58bb8801a6769405218'
65 'f50b0a19bd680851cda90c581c2aa4cf3db4fa8ea622a409730ef668d4ee37cb4ffd14fd8d5d8c58358ee9616de3a4a83c77b8b8561335e818a73ba527a24c80'
66 '3478252d09c5283dc148836e8a1bc6520bee40b19fe9d98c40ef1240b6ede20d8f397400a9901fb188bcf5859bda19e4fe0454ae30aa00d494cdb467ccaf3fc3'
67 'e6214351ca16bfe97683e838e727d6b5eaa62194878272204034c62aac4a632c9b33cd31aa0570c2eb936d7e9e7ff60190ac05a3a8cc2e27eda423a7d89b6d39')
68 validpgpkeys=('28806A878AE423A28372792ED75899B9A724937A') # Nextcloud Security <security@nextcloud.com>
71 local _phps=(php php-legacy)
74 _min=$(sed -nr 's/^.*PHP_VERSION_ID < ([0-9]*).*$/\1/p' $pkgname/lib/versioncheck.php)
75 _max=$(sed -nr 's/^.*PHP_VERSION_ID >= ([0-9]*).*$/\1/p' $pkgname/lib/versioncheck.php)
76 _min_php="${_min:0:1}.${_min:2:1}"
77 _max_php="${_max:0:1}.${_max:2:1}"
78 printf "%s requires %s >= php < %s\n" $pkgname $_min_php $_max_php
81 for _php in "${_phps[@]}"; do
83 if command -v "$_php" > /dev/null; then
84 _php_version="$($_php --version |head -n1 |cut -d ' ' -f2)"
85 printf "Detected interpreter: %s (%s)\n" "$_php" "$_php_version"
86 if [[ -z "$_php_interpreter" ]]; then
87 if [[ "$(vercmp "$_php_version" "$_max_php")" -lt 0 && "$(vercmp "$_php_version" "$_min_php")" -gt 0 ]]; then
88 _php_interpreter="$_php"
89 _php_interpreter_version="$_php_version"
90 printf "Using interpreter for package: %s (%s)\n" "$_php" "$_php_version"
92 printf "Skipping interpreter due to incompatibility: %s (%s)\n" "$_php" "$_php_version"
101 if [[ "$(vercmp "$_php_interpreter_version" "$_min_php" )" -lt 0 ]]; then
102 printf "%s requires php >= %s, but %s is provided\n" $pkgname $_min_php $_php_interpreter_version
105 if [[ "$(vercmp "$_php_interpreter_version" "$_max_php" )" -gt 0 ]]; then
106 printf "%s requires php < %s, but %s is provided\n" $pkgname $_max_php $_php_interpreter_version
114 "php-interpreter<$_max_php"
115 "php-gd-interpreter<$_max_php"
118 # NOTE: due to insufficient package tooling we can not rely on version
119 # information in optdepends, which is why we add both php and php-legacy versions
121 "php-apache: to use the Apache web server (latest PHP)"
122 "php-legacy-apache: to use the Apache web server"
123 "php-apcu: for caching with APCU (latest PHP)"
124 "php-legacy-apcu: for caching with APCU"
125 "php-fpm: to run in fastCGI process manager (latest PHP)"
126 "php-legacy-fpm: to run in fastCGI process manager"
127 "php-imagick: for preview generation (latest PHP)"
128 "php-legacy-imagick: for preview generation"
129 "php-memcached: for caching with memcached (latest PHP)"
130 "php-legacy-memcached: for caching with memcached"
131 "php-pgsql: to use the PostgreSQL database backend (latest PHP)"
132 "php-legacy-pgsql: to use the PostgreSQL database backend"
133 "php-redis: for caching with redis (latest PHP)"
134 "php-legacy-redis: for caching with redis"
135 "php-sqlite: to use the SQLite database backend (latest PHP)"
136 "php-legacy-sqlite: to use the SQLite database backend"
137 "uwsgi-plugin-php: run as application container (latest PHP)"
138 "uwsgi-plugin-php-legacy: run as application container"
142 # sysusers.d integration
143 install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
144 # tmpfiles.d integration
145 install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
146 # state dir for data and writable apps
147 install -vdm 755 "$pkgdir/var/lib/$pkgname/"
148 install -vdm 770 "$pkgdir/var/lib/$pkgname/data"
149 install -vdm 755 "$pkgdir/var/lib/$pkgname/apps"
151 install -vdm 755 "$pkgdir/var/log/$pkgname/"
153 install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini"
155 install -vDm 644 .htaccess -t "$pkgdir/etc/webapps/$pkgname/"
156 install -vDm 640 ../$pkgname.config.php "$pkgdir/etc/webapps/$pkgname/config/config.php"
157 find config -type f -exec install -vDm 644 {} "$pkgdir/etc/webapps/$pkgname/"{} \;
158 # remove config dir and .htaccess from source so that it is not installed to default location
159 rm -rf config .htaccess
162 find . -type f -not -iname "*.orig" -exec install -vDm 644 {} "$pkgdir/usr/share/webapps/$pkgname/"{} \;
164 # symlink config directory into place
165 ln -sv /etc/webapps/$pkgname/config "$pkgdir/usr/share/webapps/$pkgname/"
166 # symlink .htaccess file into place
167 ln -sv /etc/webapps/$pkgname/.htaccess "$pkgdir/usr/share/webapps/$pkgname/"
168 # add symlink to default writable apps directory
169 ln -sv /var/lib/$pkgname/apps "$pkgdir/usr/share/webapps/$pkgname/wapps"
170 # install occ command
171 install -vDm 755 occ -t "$pkgdir/usr/share/webapps/$pkgname/"
173 install -vDm 755 ../$pkgname.occ.sh "$pkgdir/usr/bin/occ"
174 # optional pacman hook
175 install -vDm 644 ../$pkgname.hook -t "$pkgdir/usr/share/doc/$pkgname/"
176 # apache example conf
177 install -vDm 644 ../apache.example.conf -t "$pkgdir/usr/share/doc/$pkgname/"
179 install -vDm 644 ../$pkgname-cron.service -t "$pkgdir/usr/lib/systemd/system/"
180 install -vDm 644 ../$pkgname-cron.timer -t "$pkgdir/usr/lib/systemd/system/"