File google-drive-ocamlfuse.spec of Package google-drive-ocamlfuse

#
# spec file for package google-drive-ocamlfuse
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2016-2017 LISA GmbH, Bingen, 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 or comments via https://bugs.opensuse.org/
#


%define build_flavor @BUILD_FLAVOR@%{nil}
%if "%{build_flavor}" == "testsuite"
%define nsuffix -testsuite
%else
%define nsuffix %{nil}
%endif

%define     pkg google-drive-ocamlfuse
Name:           %{pkg}%{nsuffix}
Version:        0.7.26
Release:        0
%{?ocaml_preserve_bytecode}
Summary:        FUSE filesystem for Google Drive
License:        MIT
Group:          System/Filesystems
URL:            https://opam.ocaml.org/packages/google-drive-ocamlfuse
Source0:        %{pkg}-%{version}.tar.xz
BuildRequires:  ocaml
BuildRequires:  ocaml-dune
BuildRequires:  ocaml-rpm-macros >= 20210121
%if 1
BuildRequires:  ocamlfind(camlidl)
BuildRequires:  ocamlfind(cryptokit)
BuildRequires:  ocamlfind(extlib)
BuildRequires:  ocamlfind(gapi-ocaml)
BuildRequires:  ocamlfind(ocamlfuse)
BuildRequires:  ocamlfind(sqlite3)
BuildRequires:  ocamlfind(threads)
%endif

%if "%{build_flavor}" == "testsuite"
BuildRequires:  ocamlfind(google-drive-ocamlfuse)
BuildRequires:  ocamlfind(oUnit)
%endif

%description
google-drive-ocamlfuse is a FUSE-based file system backed by Google Drive,
written in OCaml. It lets you mount your Google Drive on Linux.

On the first time, just run google-drive-ocamlfuse, which will open a 
browser for authentication. If that process succeeds, it will print
"Access token retrieved correctly.". Now run google-drive-ocamlfuse 
with an empty directory supplied, which is the mount point for your Google
Drive. You can optionally unmount with fusermount -u mount-point. 

Further documentation is available here:

  https://github.com/astrada/google-drive-ocamlfuse/wiki

%prep
%autosetup -p1 -n %{pkg}-%{version}

%build
dune_release_pkgs='google-drive-ocamlfuse'
%ocaml_dune_setup
%if "%{build_flavor}" == ""
%ocaml_dune_build
%endif

%install
%if "%{build_flavor}" == ""
%ocaml_dune_install
%ocaml_create_file_list
tee -a %{name}.files < %{name}.files.devel
%endif

%if "%{build_flavor}" == "testsuite"
%check
%ocaml_dune_test
%endif

%if "%{build_flavor}" == ""
%files -f %{name}.files
%doc README.md doc/
%{_bindir}/*

%endif

%changelog
openSUSE Build Service is sponsored by