File testpilotcloud-client-overlays.spec of Package testpilotcloud-client-overlays

%include %{_sourcedir}/common.inc

%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:       	2.6.3
%if "" == ""
Release:        2667
%else
# CI_CNT should correspond to BUILD_NUMBER
Release:       	0.<CI_CNT>.<B_CNT>.
%endif
%else
Version:       	2.6.3~
Release:        2667
%endif

%define build_dolphin_overlays 0
%if 0%{?suse_version} || 0%{?fedora_version} > 20 || 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700
  # 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.
  %if 0%{?suse_version} == 1315 || 0%{?suse_version} > 1320 || 0%{?fedora_version} > 23
    # 1315 is 42.x, 120100 is 42.1
    %if 0%{?sle_version} != 120100 && (!0%{?suse_version} || 0%{?is_opensuse})
      %define build_dolphin_overlays 1
    %endif
  %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


%define cmake_args %nil

Name:           testpilotcloud-client-overlays
License:        GPL-2.0+
Summary:        ownCloud Testpilot Edition - overlay icons
Url:            https://github.com/owncloud/client
Group:          Productivity/Networking/Other
Source0:        testpilotcloudclient-2.6.3.14057.tar.bz2

BuildRequires:  cmake >= 2.8.11
BuildRequires:  gcc gcc-c++

%if %build_dolphin_overlays
BuildRequires:  extra-cmake-modules
%if 0%{?suse_version}
BuildRequires:  kio-devel
%else
BuildRequires:  kf5-kio-devel
%endif
%else
%global debug_package %{nil}
%endif
%if 0%{?centos_version} >= 800
BuildRequires:  gdb
%endif

%description
ownCloud Testpilot Edition - overlay icons. Meta-package.

%package -n testpilotcloud-client-overlays-icons
Summary:        Dolphin overlay icons
Group:          Productivity/Networking/Other
# _isa was introduced in rpm-4.6.0: https://rpm.org/user_doc/arch_dependencies.html
# We assume it is harmless in older rpm. It expands to e.g. "(x86-64)"
Requires:       testpilotcloud-client%{?_isa} = %{version}

%description -n testpilotcloud-client-overlays-icons
This package provides the icons for the file manager display overlays.

%if %build_dolphin_overlays
%package -n testpilotcloud-client-dolphin
Summary:        Dolphin overlay icons
Group:          Productivity/Networking/Other
Requires:       testpilotcloud-client-overlays-icons
%if 0%{?centos_version} > 700 || 0%{?suse_version} || 0%{?rhel_version} > 700
# CentOS-6, CentOS-7, RHEL_6,7 don't have Suggests.
Suggests:       dolphin
%endif
Requires:       testpilotcloud-client%{?_isa} = %{version}

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

%package -n testpilotcloud-client-nautilus
Summary:        Nautilus overlay icons
Group:          Productivity/Networking/Other
Requires:       testpilotcloud-client-overlays-icons
%if 0%{?centos_version} > 700 || 0%{?suse_version} || 0%{?rhel_version} > 700
# CentOS-6, CentOS-7, RHEL_6,7 don't have Suggests.
Suggests:       nautilus
%endif
%if 0%{?suse_version}
Requires:       python-nautilus
%else
Requires:       nautilus-python
%endif
Requires:       testpilotcloud-client%{?_isa} = %{version}
Obsoletes:      opt-testpilotcloud-client-nautilus

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

%package -n testpilotcloud-client-nemo
Summary:        Nemo overlay icons
Group:          Productivity/Networking/Other
Requires:       testpilotcloud-client-overlays-icons
%if 0%{?centos_version} > 700 || 0%{?suse_version} || 0%{?rhel_version} > 700
# CentOS-6, CentOS-7, RHEL_6,7 don't have Suggests.
Suggests:       nemo
%endif
%if 0%{?suse_version}
Requires:       python-nemo
%else
Requires:       nemo-python
%endif
Requires:       testpilotcloud-client%{?_isa} = %{version}
Obsoletes:      opt-testpilotcloud-client-nemo

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

%package -n testpilotcloud-client-caja
Summary:        Caja overlay icons
Group:          Productivity/Networking/Other
Requires:       testpilotcloud-client-overlays-icons
%if 0%{?centos_version} > 700 || 0%{?suse_version} || 0%{?rhel_version} > 700
# CentOS-6, CentOS-7, RHEL_6,7 don't have Suggests.
Suggests:       caja
%endif
%if 0%{?suse_version}
Requires:       python-caja
%else
Requires:       caja-python
%endif
Requires:       testpilotcloud-client%{?_isa} = %{version}
Obsoletes:      opt-testpilotcloud-client-caja

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

%prep
%setup -q -n testpilotcloudclient-2.6.3.14057

# packaging.diff
# %%_oc_client_apply_common_patches

%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}
echo have_doc       0%{?have_doc}

# only useful with BUILD_CLIENT=ON
sed -i -e 's/\(include(QtVersionAbstraction)\)/# \1/' CMakeLists.txt
sed -i -e 's/\(setup_qt()\)/# \1\nset(Qt5Core_VERSION_MAJOR "0")/' CMakeLists.txt

mkdir build
pushd build
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Default_RPATH_settings
cmake .. \
%if "%{prerelease}" != ""
  -DMIRALL_VERSION_SUFFIX="%{prerelease}" \
  -DMIRALL_VERSION_BUILD="2667" \
%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/../testpilotcloud/syncclient \
%endif
  -DGIT_SHA1="HACK FIXME" \
  -DBUILD_SHELL_INTEGRATION=ON \
  -DBUILD_CLIENT=OFF -DBUILD_TESTING=OFF \
  %cmake_args


%install
pushd build
%make_install

%files -n testpilotcloud-client-overlays-icons
%defattr(-,root,root,-)
%{_datadir}/icons/hicolor

%files -n testpilotcloud-client-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 testpilotcloud-client-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 testpilotcloud-client-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 %build_dolphin_overlays
%files -n testpilotcloud-client-dolphin
%defattr(-,root,root,-)
%{_libdir}/*dolphinpluginhelper.so
%{_libdir}/qt5/plugins/kf5/overlayicon/*dolphinoverlayplugin.so
%{_libdir}/qt5/plugins/*dolphinactionplugin.so

%if 0%{?suse_version}
%dir %{_datadir}/kservices5
%endif
%{_datadir}/kservices5/*dolphinactionplugin.desktop
%dir %{_libdir}/qt5/plugins/kf5/overlayicon
%endif
openSUSE Build Service is sponsored by