File owncloud-client.spec of Package owncloud-client

#
# spec file for package owncloud-client
#
# Copyright (c) 2012-2016 ownCloud GmbH; Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes, issues or comments via http://github.com/owncloud/
#

## Caution: This spec file exists in multiple locations. Keep in sync:
##  isv:ownCloud:desktop
##  isv:ownCloud:community:nightly
##  isv:ownCloud:community:testing
##  github.com/owncloud/administration/jenkins/obs_integration/templates/client/v1_8_1/SHORTNAME-client.spec.in
##  -> you can modify it in testing, and play around for a while, but then merge into the copy on
##     github, which is authorative for the branded clients.
##
## created by: ./genbranding.pl (V1.13) -o -p isv:ownCloud:desktop owncloudclient-2.3.2.tar.xz ownCloud.tar.xz

## One specfile to rule them all:
##  versions 1.6.x or 1.7.x, released or prerelease versions. All rpm based platforms.
##  testing, branding, whatever.
##
## Caution: do not change the names of the following three defines.
## prerelease, base_version, tar_version are the interface into buildpackage.pl
## used in rotor.o.c job owncloud-client-linux
## define prerelease as %nil, if this is not a prerelease.
%define prerelease %nil
%define base_version 2.3.2
%define tar_version %{base_version}%{prerelease}

Name:           owncloud-client

%if "%{name}" == "owncloud-client"
%define is_owncloud_client 1
%else
%define is_owncloud_client 0
%endif

# Use translations from an external tarball in the package, or build them
# using the Qt tools? For distros where we do not have the tools, disable.

%if 0%{?centos_version} == 600 || 0%{?rhel_version} == 600 || 0%{?fedora_version} || "%{prerelease}" == ""
# For beta and rc versions we use the ~ notation, as documented in
# http://en.opensuse.org/openSUSE:Package_naming_guidelines
# Some distro's (centos_6) don't allow ~ characters. There we follow the Fedora guidelines,
# which suggests massaging the buildrelease number.
# Otoh: for openSUSE, this technique is discouraged by the package naming guidelines.
Version:       	%{base_version}
%if "%{prerelease}" == ""
Release:        0
%else
Release:       	0.<CI_CNT>.<B_CNT>.%{prerelease}
%endif
%else
Version:       	%{base_version}~%{prerelease}
Release:        0
%endif

License:        GPL-2.0 and GPL-2.0+ and LGPL-2.1+
Summary:        The ownCloud synchronization client
Url:            http://owncloud.com
Group:          Productivity/Networking/Other
Source0:        owncloudclient-2.3.2.tar.bz2
Source1:        owncloud.sh
Source2:        owncloudcmd.sh
Source3:        100-sync-inotify.conf
Source4:        README.UPDATE.txt
Source5:        l10n.zip

Patch1:         autostart_use_wrapper.diff

%if 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600 || 0%{?suse_version} == 1110 || 0%{?fedora_version} == 23
%if 0%{?suse_version} == 1110
# SLES 11 calls make_install makeinstall
%define make_install %{makeinstall}
%endif
# We need a more recent, prefixed Qt for SLE11
%define opt_hack 1
%define qtprefix opt-
%if 0%{?rhel_version} == 600 || 0%{?centos_version} == 600
%define optdir /opt/qt-4.8
%else
%define optdir /opt/qt-5.4
%endif

# Must be all in one line:
%define cmake_args -DCMAKE_INCLUDE_PATH=%{_prefix}/include -DCMAKE_LIBRARY_PATH=%{_prefix}/%{_lib} -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
%else
%define opt_hack 0
%define qtprefix %{nil}
%define cmake_args -DSYSCONF_INSTALL_DIR=%{_sysconfdir}
%endif

# default to have no docs. Cannot be built with old distros.
%define have_doc 0

# prepare stuff for qt5
# If Qt5 is available, we use it. Also, if the Qt-Version is 5.4 or higher
%define use_qt5 0
%define build_dolphin_overlays 0

# Use Qt5 if
# - OpenSUSE is > 13.1 (needs to include 1315 for 42.1!, hence "> 1310")
#   - But not SLE (re-evaluate with SLE 13)
# - Fedora >= 20
# - RHEL or CentOS >= 7.0
%define suse_has_qt5 0
%if 0%{?is_opensuse} || 0%{?suse_version} == 1320 || 0%{?sle_version} >= 120200
  %define suse_has_qt5 1
%endif

%if 0%{?suse_has_qt5} || 0%{?fedora_version} > 20 || 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700
  %define use_qt5 1
  
  # On top of the Qt5 requirement, Dolphin plugin interface can only work on distros with KDE Applications >= 15.12
  # This we make sure to allow building not for OpenSUSE Leap 42.1 GA, not for 13.2
  # Leap_Updates would allow a dolphin overlay to work, this is not handled below.
  # the third term below is for leap 42.2
  %if 0%{?suse_version} > 1320 || 0%{?fedora_version} > 23 || (0%{?sle_version} >= 120200 && 0%{?is_opensuse})
    %define build_dolphin_overlays 1
  %endif
  %if "%_repository" == "openSUSE_Leap_42.1_Update"
    # It builds the overlay, despite this warning: Dolphin plugin disabled: KDE Frameworks 5.16 not found
    %define build_dolphin_overlays 1
  %endif
%endif

# The infamous SUSE matrix:
# -------------------------
#
#                      	is_opensuse 	suse_version	sle_version
# openSUSE_13.1				1310
# SLE_12				1315		120000
# SLE_12_SP1				1315		120100
# openSUSE_Leap_42.1	1		1315		120100
# openSUSE_13.2				1320
# openSUSE_Factory	1		1330
# openSUSE_Tumbleweed	1		1330


######################################################################### BuildRequires only below here.

BuildRequires:  cmake >= 2.8.11
BuildRequires:  gcc gcc-c++
%if 0%{?is_opensuse} && (0%{?suse_version} >= 1330 || 0%{?sle_version} >= 120200)
# newer openSUSE versions ship qtkeychain 0.7.0
# Leap_42.2 has it, but neither Leap_42.1 nor SLE_12_SP2
BuildRequires:  qtkeychain-qt5-devel >= 0.7.0, libqt5keychain1 >= 0.7.0
%else
%if %use_qt5
BuildRequires:  %{qtprefix}libqt5keychain-devel >= 0.7.0, %{qtprefix}libqt5keychain1 >= 0.7.0
%else
BuildRequires:  %{qtprefix}libqtkeychain-devel >= 0.7.0
%endif
%endif

# This is for all modern Fedora and CentOS 7
# These ship Qt in a decent version and do not need the opt-hack
%if 0%{?fedora_version} >= 21 || 0%{?centos_version} >= 700 || 0%{?rhel_version} == 700

%if %use_qt5
%if 0%{?fedora_version} == 23
# Fedora_23 has an unusable qt5-qttools-devel package. It complains
# "nothing provides qt5-designer qt5-linguist needed by qt5-qttools-devel"
# while Fedora_22 and Fedora_21 are happy with their qt5-qttools-devel.
BuildRequires:  qt5-qttools-libs-designercomponents qt5-qttools-libs-designer
# needed on Fedora-24 for KF5-KIO to be recognized by cmake:
BuildRequires:  extra-cmake-modules
%else
BuildRequires:  %{qtprefix}qt5-qttools-devel
%endif
# we need qt5 >= 5.5.1 https://github.com/owncloud/client/issues/5432
BuildRequires:  %{qtprefix}qt5-qtbase
BuildRequires:  %{qtprefix}qt5-qtbase-devel
BuildRequires:  %{qtprefix}qt5-qtbase-gui
BuildRequires:  %{qtprefix}qt5-qtwebkit-devel

%if %build_dolphin_overlays
BuildRequires:  extra-cmake-modules
BuildRequires:  kf5-kio-devel
%endif

%else # no qt5
BuildRequires:  qt4 qt4-devel >= 4.7
BuildRequires:  qtwebkit >= 2.2
BuildRequires:  qtwebkit-devel >= 2.2
%endif

BuildRequires:  openssl-devel
BuildRequires:  inetd desktop-file-utils
%else
# This is for all SUSE and RHEL6 and CentOS 6
%if %use_qt5

# we need qt5 >= 5.5.1 https://github.com/owncloud/client/issues/5432
BuildRequires:  libQt5Core-devel
BuildRequires:  libQt5Gui-devel
BuildRequires:  libQt5Network-devel
BuildRequires:  libQt5WebKitWidgets-devel
BuildRequires:  libQt5Xml-devel
BuildRequires:  libQt5PrintSupport-devel
BuildRequires:  libQt5DBus-devel
BuildRequires:  libQt5Concurrent-devel
BuildRequires:  libqt5-linguist-devel

%if %build_dolphin_overlays
BuildRequires:  kio-devel
%endif

%else # no qt5

BuildRequires:  %{qtprefix}libqt4-devel >= 4.7
BuildRequires:  %{qtprefix}libQtWebKit-devel
BuildRequires:  %{qtprefix}libQtWebKit4

%endif

%endif

# SUSE specific stuff
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  libopenssl-devel
%endif

# The opt-hack to use the packages installed in /opt on CentOS
%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600
%define have_doc 1
%endif
# https://github.com/owncloud/client/issues/2153
%define have_man 0


# no documents on SLE12
%if 0%{?suse_version} == 1315 && ! 0%{?is_opensuse}
%define have_doc 0
%endif

# Version independant package name mapping between suse and fedora/centos
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  sqlite-devel
BuildRequires:  inetd desktop-file-utils
%if 0%{?fedora_version} || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600
BuildRequires:  python-sphinx
# sphinx fails on Fedora 25: https://github.com/owncloud/client/issues/5355
BuildRequires: python
%endif
%else
%if 0%{have_doc}
BuildRequires:  python-Sphinx
%endif
BuildRequires:  sqlite3-devel
BuildRequires:  update-desktop-files
%endif


######################################################################### Requires only below here.

%if %use_qt5 && 0%{?suse_version} == 0
# suse finds the libs via autoreqprov 
# https://github.com/owncloud/client/issues/4431

# we need qt5 >= 5.5.1 https://github.com/owncloud/client/issues/5432
Requires:       %{qtprefix}qt5-qtbase
Requires:       %{qtprefix}qt5-qtbase-gui
# libQtWebKit4 is implicitly pulled by libowncloudsync0
Requires:       %{qtprefix}qt5-qtwebkit
# libqt4-sql is implicitly pulled by libqt4-sql-sqlite
%endif
%if 0%{?fedora_version} > 20 || 0%{?centos_version} > 700 || 0%{?suse_version} || 0%{?rhel_version} > 700
# Fedora-19 and -20, CentOS-6, CentOS-7, RHEL_6,7 don't have Suggests.
Suggests:	%{name}-nautilus
Suggests:       %{name}-nemo
Suggests:       %{name}-caja
%endif

%if 0%{?fedora_version}
# https://github.com/owncloud/client/issues/5703
Suggests:    libgnome-keyring
BuildRequires:    libgnome-keyring
%endif

%if 0%{?rhel_version} == 600 || 0%{?centos_version} == 600
# https://github.com/owncloud/client/issues/4400#issuecomment-176686729
Requires:	%{qtprefix}libqt4-sql
# https://github.com/owncloud/client/issues/4560
Requires:	%{qtprefix}libqt4
Requires:	%{qtprefix}libqt4-x11
%endif

Requires: %{name}-l10n
Requires: libowncloudsync0 = %{version}

######################################################################### Obsoletes only below here.

Obsoletes: libocsync0
Obsoletes: libocsync-devel
Obsoletes: libocsync-plugin-owncloud
Obsoletes: libocsync-plugin-owncloud
Obsoletes: libocsync-devel-doc
Obsoletes: libocsync-doc
Obsoletes: opt-owncloud-client

# Obsolete the experimental Qt5 packages if this is the unbranded client.
%if %{is_owncloud_client}
Obsoletes: libowncloudqt5sync0 libowncloudqt5sync-devel owncloud-client-qt5 owncloud-client-qt5-doc owncloud-client-qt5-l10n
%endif

######################################################################### Package Descriptions start here.

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The ownCloud sync client - github.com/owncloud/client

ownCloud client enables you to connect to your private
ownCloud Server. With it you can create folders in your home
directory, and keep the contents of those folders synced with your
ownCloud server. Simply copy a file into the directory and the
ownCloud Client does the rest.

ownCloud gives your employees anytime, anywhere access to the files
they need to get the job done, whether through this desktop application,
our mobile apps, the web interface, or other WebDAV clients. With it,
your employees can easily view and share documents and information
critical to the business, in a secure, flexible and controlled
architecture. You can easily extend ownCloud with plug-ins from the
community, or that you build yourself to meet the requirements of
your infrastructure and business.

ownCloud - Your Cloud, Your Data, Your Way!  www.owncloud.com

Authors
=======
Duncan Mac-Vicar P. <duncan@kde.org>
Klaas Freitag <freitag@owncloud.com>
Daniel Molkentin <danimo@owncloud.com>



%package -n %{name}-doc
Summary:        Documentation for ownCloud
Group:          Development/Libraries/C and C++
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      opt-%{name}-doc

%description -n %{name}-doc
Documentation for the ownCloud desktop application.

%package -n %{name}-l10n
Summary:        Localization for ownCloud
Group:          Development/Libraries/C and C++
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      opt-%{name}-l10n

%description -n %{name}-l10n
Localization files for the ownCloud desktop application.

%package -n libowncloudsync0
%if %use_qt5
Requires:       %{qtprefix}libqt5keychain1 >= 0.7.0
%else
Requires:       %{qtprefix}libqtkeychain1 >= 0.7.0
%endif
Obsoletes:      opt-libowncloudsync0

Summary:        The ownCloud synchronization library
Group:          Development/Libraries/C and C++

%description -n libowncloudsync0
The ownCloud synchronization library.

%package -n libowncloudsync-devel
Summary:        Development files for the ownCloud synchronization library
Group:          Development/Libraries/C and C++
Requires: libowncloudsync0 = %{version}
Obsoletes:      opt-libowncloudsync-devel

%description -n libowncloudsync-devel
Development files for the ownCloud synchronization library.

%package -n %{name}-nautilus
Summary:        Nautilus overlay icons
Group:          Productivity/Networking/Other
Requires:       nautilus
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
Requires:       nautilus-python
%else
Requires:       python-nautilus
Supplements:    packageand(%{name}:nautilus)
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      opt-%{name}-nautilus

%description -n %{name}-nautilus
This package provides overlay icons to visualize the synchronization state
in the Nautilus file manager.

%package -n %{name}-nemo
Summary:        Nemo overlay icons
Group:          Productivity/Networking/Other
Requires:       nemo
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
Requires:       nemo-python
%else
Requires:       python-nemo
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}
Obsoletes:      opt-%{name}-nemo

%description -n %{name}-nemo
This package provides overlay icons to visualize the synchronization state
in the Nemo file manager.

%package -n %{name}-caja
Summary:        Caja overlay icons
Group:          Productivity/Networking/Other
Requires:       caja
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
Requires:       caja-python
%else
Requires:       python-caja
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description -n %{name}-caja
This package provides overlay icons to visualize the synchronization state
in the Caja file manager.

%if 0%{build_dolphin_overlays}
%package -n %{name}-dolphin
Summary:        Dolphin overlay icons
Group:          Productivity/Networking/Other
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
Requires:       dolphin
%else
Requires:       dolphin
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description -n %{name}-dolphin
This package provides the neccessary plugin libraries for the KDE
Framework 5 based Dolphin filemanager to display overlay icons.

%endif

%prep
%setup -q -n owncloudclient-2.3.2
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?suse_version} == 1110
# autostart_use_wrapper.diff
%patch1 -p1
%endif

%if 0%{?rhel_version} == 600 || 0%{?centos_version} == 600
sed -i -e 's/OVERRIDE=override/OVERRIDE=/' cmake/modules/QtVersionAbstraction.cmake
%endif

%build
echo centos_version 0%{?centos_version}
echo rhel_version   0%{?rhel_version}
echo fedora_version 0%{?fedora_version}
echo suse_version   0%{?suse_version}

%if %opt_hack
%endif
export LD_LIBRARY_PATH=%{optdir}/%{_lib}
export PATH=%{optdir}/bin:$PATH

mkdir build
pushd build
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Default_RPATH_settings
cmake .. -DWITH_DOC=TRUE \
%if "%{prerelease}" != ""
  -DMIRALL_VERSION_SUFFIX="%{prerelease}" \
  -DMIRALL_VERSION_BUILD="2408" \
%endif
  -DKDE_INSTALL_USE_QT_SYS_PATHS=1 \
  -DCMAKE_C_FLAGS:STRING="%{optflags}" \
  -DCMAKE_CXX_FLAGS:STRING="%{optflags}" \
  -DCMAKE_SKIP_RPATH=OFF \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if %{_lib} == lib64
  -DLIB_SUFFIX=64 \
%endif
%if ! %{is_owncloud_client}
  -DOEM_THEME_DIR=$PWD/../ownCloud/syncclient \
%endif
%if %{opt_hack}
%if 0%{?rhel_version} == 600 || 0%{?centos_version} == 600
  -DQTKEYCHAIN_INCLUDE_DIR=%{optdir}/include/qtkeychain \
  -DQTKEYCHAIN_LIBRARY=%{optdir}/%{_lib}/libqtkeychain.so \
%else
  -DQTKEYCHAIN_INCLUDE_DIR=%{optdir}/include/qt5keychain \
  -DQTKEYCHAIN_LIBRARY=%{optdir}/%{_lib}/libqt5keychain.so \
%endif
%endif
  %cmake_args

# documentation here?
if [ -e conf.py ];
then
  # for old cmake versions we need to move the conf.py.
  mv conf.py doc/
fi

env LD_RUN_PATH=%{_libdir}/owncloud:%{_libdir}/owncloud make %{?_smp_mflags} VERBOSE=1

make doc
popd

%install
pushd build
%make_install

if [ %{have_doc} != 0 ];
then
  mkdir -p ${RPM_BUILD_ROOT}%{_docdir}/%{name}
  mv ${RPM_BUILD_ROOT}/usr/share/doc/client/* ${RPM_BUILD_ROOT}%{_docdir}/%{name}
  rmdir ${RPM_BUILD_ROOT}/usr/share/doc/client
  rm ${RPM_BUILD_ROOT}%{_docdir}/%{name}/html/unthemed/.buildinfo
  mv ${RPM_BUILD_ROOT}%{_docdir}/%{name}/html/unthemed/* ${RPM_BUILD_ROOT}%{_docdir}/%{name}/html/
  rmdir ${RPM_BUILD_ROOT}%{_docdir}/%{name}/html/unthemed
fi
popd

%if %{have_man}
if [ -d ${RPM_BUILD_ROOT}%{_mandir}/man1 ]; then
%if ! %{is_owncloud_client}
  mkdir -p ${RPM_BUILD_ROOT}%{_mandir}man1
  mv ${RPM_BUILD_ROOT}%{_mandir}/man1/{owncloud.1,owncloud.1}
  mv ${RPM_BUILD_ROOT}%{_mandir}/man1/{owncloudcmd.1,owncloudcmd.1}
%endif
  gzip ${RPM_BUILD_ROOT}%{_mandir}/man1/*.1
fi
%else
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/*.1
%endif

%define extdir ${RPM_BUILD_ROOT}%{_datadir}/nautilus-python/extensions
test -f %{extdir}/ownCloud.py  && mv %{extdir}/ownCloud.py  %{extdir}/owncloud.py  || true
test -f %{extdir}/ownCloud.pyo && mv %{extdir}/ownCloud.pyo %{extdir}/owncloud.pyo || true
test -f %{extdir}/ownCloud.pyc && mv %{extdir}/ownCloud.pyc %{extdir}/owncloud.pyc || true

%if %opt_hack
install -d ${RPM_BUILD_ROOT}/%{optdir}/bin
mv ${RPM_BUILD_ROOT}/%{_bindir}/owncloud* ${RPM_BUILD_ROOT}/%{optdir}/bin/

install %{SOURCE1} ${RPM_BUILD_ROOT}/usr/bin/owncloud
install %{SOURCE2} ${RPM_BUILD_ROOT}/usr/bin/owncloudcmd
%endif

# https://github.com/owncloud/client/issues/4107
install -m 0755 -D %{SOURCE3} ${RPM_BUILD_ROOT}/etc/sysctl.d/100-sync-inotify.conf

%if %{?suse_version:1}0
%suse_update_desktop_file -n owncloud
# workaround for https://github.com/owncloud/ownbrander/issues/322
for desktop_icon_dir in $RPM_BUILD_ROOT/usr/share/icons/hicolor/*/apps; do
  # copy shortname to executable name, if missing.
  if [ -f $desktop_icon_dir/owncloud.png -a ! -f $desktop_icon_dir/owncloud.png ]; then
    cp $desktop_icon_dir/owncloud.png $desktop_icon_dir/owncloud.png
  fi
done
%endif

%check
## use exit 0 instead of exit 1 to turn this into warnings:
if [ "%{name}" != "testpilotcloud-client" ]; then
  if [ "%{prerelease}" == "" ]; then
    expr match '%{distribution}' '.*:community:\(testing\|nightly\)' && { echo "Warning: Need a prerelease here, not %{version} (okay, if you want to submitpac this as a release today)"; }
  else
    expr match '%{distribution}' '.*:community:desktop' && { echo "Error: Must not have a prerelease here, not %{version}"; exit 1; }
  fi
fi

%if 0%{?fedora_version}
%post
/bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor >/dev/null  2>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :
fi
%endif

%posttrans
# fixing https://github.com/owncloud/enterprise/issues/1714
/usr/bin/gtk-update-icon-cache --quiet --force %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :

%post   -n libowncloudsync0 -p /sbin/ldconfig
%postun -n libowncloudsync0 -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/owncloud
%{_bindir}/owncloudcmd

%if %{opt_hack}
%{optdir}/bin/owncloud
%{optdir}/bin/owncloudcmd
%endif

%{_datadir}/applications/owncloud.desktop
%{_datadir}/icons/hicolor
%if 0%{have_man}
%{_mandir}/man1/owncloud*
%endif

%if %opt_hack
/usr/share/icons/hicolor
/usr/share/applications/owncloud.desktop
/usr/bin/owncloud
/usr/bin/owncloudcmd
%endif
%config /etc/ownCloud
# https://github.com/owncloud/client/issues/4107
%config /etc/sysctl.d/100-sync-inotify.conf

%files -n %{name}-doc
%defattr(-,root,root,-)
%doc README.md COPYING
%if 0%{have_doc}
%doc %{_docdir}/%{name}
%endif

%files -n %{name}-l10n
%defattr(-,root,root,-)
%if 0%{?fedora_version} != 23
# workaround for https://github.com/owncloud/client/issues/4987
%{_datadir}/owncloud
%endif

%files -n libowncloudsync0
%defattr(-,root,root,-)
%{_libdir}/libowncloudsync.so.*
%{_libdir}/owncloud/libocsync.so.*
%dir %{_libdir}/owncloud

%files -n libowncloudsync-devel
%defattr(-,root,root,-)
%{_libdir}/libowncloudsync.so
%{_libdir}/owncloud/libocsync.so
%{_includedir}/owncloudsync/

%files -n %{name}-nautilus
%defattr(-,root,root,-)
# Fedora also has *.pyc and *.pyo files here.
%{_datadir}/nautilus-python/extensions/syncstate-*.py*
%dir %{_datadir}/nautilus-python
%dir %{_datadir}/nautilus-python/extensions/

%files -n %{name}-nemo
%defattr(-,root,root,-)
# Fedora also has *.pyc and *.pyo files here.
%{_datadir}/nemo-python/extensions/syncstate-*.py*
%dir %{_datadir}/nemo-python
%dir %{_datadir}/nemo-python/extensions/

%files -n %{name}-caja
%defattr(-,root,root,-)
# Fedora also has *.pyc and *.pyo files here.
%{_datadir}/caja-python/extensions/syncstate-*.py*
%dir %{_datadir}/caja-python
%dir %{_datadir}/caja-python/extensions/

%if 0%{build_dolphin_overlays}
%files -n %{name}-dolphin
%defattr(-,root,root,-)
%{_libdir}/*dolphinpluginhelper.so
%{_libdir}/qt5/plugins/kf5/overlayicon/*dolphinoverlayplugin.so
%{_libdir}/qt5/plugins/*dolphinactionplugin.so

%{_datadir}/kservices5/*dolphinactionplugin.desktop
%dir %{_libdir}/qt5/plugins/kf5/overlayicon
%endif # build_dolphin_overlays
%changelog
openSUSE Build Service is sponsored by