File longhorn-share-manager.spec of Package longhorn-share-manager

# Copyright (c) 2020 SUSE LLC
#
# 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/
# 

# needs to match path in source5

Name:           longhorn-share-manager
Version:        1.9.1+git.0.18a33d8
Release:        0
License:        Apache-2.0
Summary:        Longhorn Share Manager for nfs
Url:            https://github.com/longhorn/longhorn-share-manager
Group:          Development/Languages/Other
Source0:        %{name}-%{version}.tar.xz
Source1:        vendor.tar.xz
BuildRequires:  golang-packaging
BuildRequires:  xz
BuildRequires:  zlib-devel
Requires:       libqcow1
Requires(post): %fillup_prereq

%{go_nostrip}
%{go_provides}

%description
Longhorn Share Manager manages nfs exports for rwx volumes.

%prep
%autosetup -a1

%build
REV="%{version}"
#export REV="${REV##*.}"
#go build \
#  -mod=vendor \
#  -buildmode=pie 
#  -ldflags "-X main.VERSION=%{version}"
VERSION="${REV%%+*}"
GITCOMMIT="${REV##*.}"
BUILDDATE=$(date -u --rfc-3339=seconds)
BUILDDATE=${BUILDDATE// /T}
LDFLAGS="-X main.Version=v$VERSION
         -X main.GitCommit=$GITCOMMIT
         -X main.BuildDate=$BUILDDATE
         -extldflags -s"
##%{goprep} github.com/longhorn/longhorn-share-manager
%{gobuild} -ldflags="$LDFLAGS" ""

%install
%{goinstall}

%files
%doc README.md
%license LICENSE
%{_bindir}/longhorn-share-manager

%changelog
openSUSE Build Service is sponsored by