summaryrefslogtreecommitdiffstats
path: root/nextcloud.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-04-03 11:31:47 +0200
committerRemi Collet <remi@remirepo.net>2017-04-03 11:31:47 +0200
commit28934c390b7df1399b23ecaf3f29c02e698e837b (patch)
treef6dea0c019eea7e43f5b9591be7b29fb2f8b97e3 /nextcloud.spec
parent373171f8643a6ee9af83da879b6026bbcdf8b354 (diff)
backport stuff
Diffstat (limited to 'nextcloud.spec')
-rw-r--r--nextcloud.spec103
1 files changed, 79 insertions, 24 deletions
diff --git a/nextcloud.spec b/nextcloud.spec
index a1dce62..46ad3dd 100644
--- a/nextcloud.spec
+++ b/nextcloud.spec
@@ -1,7 +1,24 @@
+# remirepo spec file for nextcloud from:
+#
+# Fedora spec file for nextcloud
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+
+%if 0%{?fedora} < 19 && 0%{?rhel} < 7
+%global with_systemd 0
+%else
+%global with_systemd 1
+%endif
+
Name: nextcloud
Version: 10.0.4
Release: 2%{?dist}
Summary: Private file sync and share server
+Group: Applications/Internet
License: AGPLv3+ and MIT and BSD and ASL 2.0 and WTFPL and CC-BY-SA and GPLv3+ and Adobe
URL: http://nextcloud.com
@@ -64,8 +81,12 @@ Patch9: %{name}-10.0.4-correct-cli-upgrade.patch
BuildArch: noarch
# For the systemd macros
+%if %{with_systemd}
%{?systemd_requires}
BuildRequires: systemd
+%else
+Requires: crontabs
+%endif
# expand pear macros on install
BuildRequires: php-pear
@@ -90,13 +111,8 @@ BuildRequires: php-composer(natxet/CssMin) >= 3.0.4
BuildRequires: php-composer(natxet/CssMin) < 4.0
BuildRequires: php-composer(punic/punic) >= 1.6.3
BuildRequires: php-composer(punic/punic) < 2.0
-%if 0%{?el7}
-BuildRequires: php-pear(Archive_Tar) >= 1.3
-BuildRequires: php-pear(Archive_Tar) < 2.0
-%else
BuildRequires: php-composer(pear/archive_tar) >= 1.4.1
BuildRequires: php-composer(pear/archive_tar) < 2.0
-%endif
BuildRequires: php-composer(patchwork/utf8) >= 1.2.6
BuildRequires: php-composer(patchwork/utf8) < 2.0
BuildRequires: php-composer(symfony/console) >= 2.8.3
@@ -121,13 +137,7 @@ BuildRequires: php-composer(guzzlehttp/guzzle) >= 5.3.0
BuildRequires: php-composer(guzzlehttp/guzzle) < 6.0
BuildRequires: php-composer(league/flysystem) >= 1.0.20
BuildRequires: php-composer(league/flysystem) < 2.0
-%if 0%{?el7}
-BuildRequires: php-pear(Console_Getopt) > 1.3
-BuildRequires: php-pear(Console_Getopt) < 2.0
-BuildRequires: php-pear(PEAR) > 1.9
-%else
BuildRequires: php-composer(pear/pear-core-minimal) >= 1.10.1
-%endif
BuildRequires: php-composer(interfasys/lognormalizer) >= 1.0
BuildRequires: php-composer(interfasys/lognormalizer) < 2.0
BuildRequires: php-composer(owncloud/tarstreamer) >= 0.1
@@ -220,14 +230,8 @@ Requires: php-composer(punic/punic) >= 1.6.3
Requires: php-composer(punic/punic) < 2.0
# "pear/archive_tar": "1.4.1"
-# archive_tar is in base el7 and doesn't have the fedora php-composer provides
-%if 0%{?el7}
-Requires: php-pear(Archive_Tar) >= 1.3
-Requires: php-pear(Archive_Tar) < 2.0
-%else
Requires: php-composer(pear/archive_tar) >= 1.4.1
Requires: php-composer(pear/archive_tar) < 2.0
-%endif
# "patchwork/utf8": "1.2.6"
Requires: php-composer(patchwork/utf8) >= 1.2.6
@@ -280,13 +284,7 @@ Requires: php-composer(league/flysystem) < 2.0
# "pear/pear-core-minimal": "v1.10.1"
# this includes pear/console_getopt and pear/PEAR
-%if 0%{?el7}
-Requires: php-pear(Console_Getopt) > 1.3
-Requires: php-pear(Console_Getopt) < 2.0
-Requires: php-pear(PEAR) > 1.9
-%else
Requires: php-composer(pear/pear-core-minimal) >= 1.10.1
-%endif
# "interfasys/lognormalizer": "v1.0"
Requires: php-composer(interfasys/lognormalizer) >= 1.0
@@ -341,8 +339,13 @@ Requires: php-pecl(smbclient) < 1.0
# Requiring so that the shipped external smb storage works
# The net command is needed and enabling smb tests for smbclient command
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
Requires: samba-common-tools
Requires: samba-client
+%else
+Requires: %{_bindir}/net
+Requires: %{_bindir}/smbclient
+%endif
## Note these next bits are not listed in composer but manually dropped in place
@@ -421,6 +424,7 @@ applications and plugins.
%package httpd
Summary: Httpd integration for NextCloud
+Group: Applications/Internet
Provides: %{name}-webserver = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -434,6 +438,7 @@ Requires: php
%package nginx
Summary: Nginx integration for NextCloud
+Group: Applications/Internet
Provides: %{name}-webserver = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -447,6 +452,7 @@ Requires: php-fpm nginx
%package mysql
Summary: MySQL database support for NextCloud
+Group: Applications/Internet
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -466,6 +472,7 @@ more details.
%package postgresql
Summary: PostgreSQL database support for NextCloud
+Group: Applications/Internet
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -486,6 +493,7 @@ for more details.
%package sqlite
Summary: SQLite 3 database support for NextCloud
+Group: Applications/Internet
Provides: %{name}-database = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
@@ -498,7 +506,16 @@ work with an SQLite 3 database stored on the local system.
%prep
-%autosetup -n %{name} -p1
+%setup -q -n %{name}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
# patch backup files and .git stuff
find . -name \*.orig -type f -exec rm {} \; -print
@@ -767,16 +784,35 @@ install -Dpm 644 %{SOURCE202} \
%{buildroot}%{_sysconfdir}/php-fpm.d/%{name}.conf
%endif
+%if %{with_systemd}
# Install the systemd timer
install -Dpm 644 %{SOURCE10} %{buildroot}%{_unitdir}/nextcloud-cron.service
install -Dpm 644 %{SOURCE11} %{buildroot}%{_unitdir}/nextcloud-cron.timer
+%else
+install -d %{buildroot}%{_sysconfdir}/cron.d/
+cat <<EOF | tee %{buildroot}%{_sysconfdir}/cron.d/%{name}
+# Cron for nextcloud background jobs
+
+# Uncomment to activate
+# */15 * * * * apache %{_bindir}/php %{_datadir}/nextcloud/cron.php
+EOF
+%endif
+
%post httpd
+%if %{with_systemd}
/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 %{with_systemd}
/usr/bin/systemctl reload httpd.service > /dev/null 2>&1 || :
+%else
+ /sbin/service httpd reload > /dev/null 2>&1 || :
+%endif
fi
%post nginx
@@ -788,13 +824,23 @@ fi
fi
/usr/bin/chown apache /var/lib/php/session
%endif
+%if %{with_systemd}
/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 %{with_systemd}
/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
# the selinux policies only cover owncloud right now
@@ -818,6 +864,7 @@ fi
%doc AUTHORS README.fedora MIGRATION.fedora config/config.sample.php
%doc *_composer.json
+%{!?_licensedir:%global license %%doc}
%license *-LICENSE
%dir %attr(-,apache,apache) %{_sysconfdir}/%{name}
@@ -832,8 +879,13 @@ fi
%dir %attr(0750,apache,apache) %{_localstatedir}/lib/%{name}/data
%attr(-,apache,apache) %{_localstatedir}/lib/%{name}/apps
+%if %{with_systemd}
%{_unitdir}/nextcloud-cron.service
%{_unitdir}/nextcloud-cron.timer
+%else
+%config(noreplace) %{_sysconfdir}/cron.d/%{name}
+%endif
+
%files httpd
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
@@ -853,6 +905,9 @@ fi
%changelog
+* Mon Apr 3 2017 Remi Collet remi@remirepo.net> - 10.0.4-2
+- back to remi's repository
+
* Sat Mar 25 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 10.0.4-2
- Add max versions to dependencies to limit each to 1 major version
- Update some dependencies to use php-composer(*) instead of package names