Browse Source

mattermost-ctl package creation

Signed-off-by: tuibuilder_pel7ppc64lebuilder0 <tuibuilder@powerel.org>
master
tuibuilder_pel7ppc64lebuilder0 5 years ago
parent
commit
4f71720164
  1. 50
      SPECS/mattermost-ctl.spec

50
SPECS/mattermost-ctl.spec

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
%global _hardened_build 1
%define debug_package %{nil}

Name: mattermost-ctl
Version: 5.23.0
Release: 1%{?dist}
Summary: A remote CLI tool for Mattermost
Group: System/Library
License: MIT
URL: https://github.com/mattermost/mmctl
BuildRequires: golang
BuildRequires: git


%description
A remote CLI tool for Mattermost


%prep
%setup -q -T -c %{name}-%{version}
export GOPATH=`pwd`
mkdir -p src/github.com/mattermost/
cd src/github.com/mattermost/
git clone https://github.com/mattermost/mmctl/


%build
export GOPATH=`pwd`
export GO111MODULE=on
export CGO_ENABLED=0
cd src/github.com/mattermost/mmctl/
git checkout tags/v%{version}
export COMMIT=$(git rev-parse HEAD)
export SHORTCOMMIT=$(git rev-parse --short HEAD)
export BUILDDATE=$(date +%Y%m%d)
go build -v -trimpath --ldflags "
-X github.com/mattermost/mmctl/commands.BuildHash=$COMMIT
-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid %{version}" -o mattermost-ctl


%install
install -p -D -m 0555 src/github.com/mattermost/mmctl/mattermost-ctl %{buildroot}%{_bindir}/mattermost-ctl


%files
%doc
%{_bindir}/mattermost-ctl


%changelog
Loading…
Cancel
Save