From 5682c9d1805972b103c4160818b68c059c801a25 Mon Sep 17 00:00:00 2001 From: webbuilder_pel7ppc64bebuilder0 Date: Thu, 22 Aug 2019 11:56:37 +0200 Subject: [PATCH] mattermost-plugin-autolink package creation Signed-off-by: webbuilder_pel7ppc64bebuilder0 --- SPECS/mattermost-plugin-autolink.spec | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 SPECS/mattermost-plugin-autolink.spec diff --git a/SPECS/mattermost-plugin-autolink.spec b/SPECS/mattermost-plugin-autolink.spec new file mode 100644 index 0000000..8255a11 --- /dev/null +++ b/SPECS/mattermost-plugin-autolink.spec @@ -0,0 +1,54 @@ +%define mattermost_user mattermost +%define mattermost_group mattermost +%define mattermost_home /var/lib/mattermost +%define debug_package %{nil} + +Name: mattermost-plugin-autolink +Version: 1.1.0 +Release: 1%{?dist} +URL: https://github.com/mattermost/mattermost-plugin-autolink/ +Summary: Plugin for Mattermost Autolinking +License: Apache +BuildRequires: golang +Requires: mattermost + + +%description + + +%prep +%setup -q -T -c %{name}-%{version} +export GOPATH=`pwd` +go get -u -v github.com/pkg/errors +mkdir -p src/github.com/mattermost/ +cd src/github.com/mattermost/ +git clone https://github.com/mattermost/mattermost-server +git clone https://github.com/mattermost/mattermost-plugin-autolink + + +%build +export GOPATH=`pwd` +export PATH="bin:"$PATH +cd src/github.com/mattermost/mattermost-plugin-autolink +pushd server +go build -o plugin.exe +popd + + + +%install +mkdir -p %{buildroot}%{mattermost_home}/plugins/autolink/{server,webapp} +cp -rv src/github.com/mattermost/mattermost-plugin-autolink/plugin.json %{buildroot}%{mattermost_home}/plugins/autolink/ +sed 's/"executables": {/"executables": { "server\/plugin.exe"/' -i %{buildroot}%{mattermost_home}/plugins/autolink/plugin.json +sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/autolink/plugin.json +sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/autolink/plugin.json +sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/autolink/plugin.json +cp -rv src/github.com/mattermost/mattermost-plugin-autolink/server/plugin.exe %{buildroot}%{mattermost_home}/plugins/autolink/server/ + + +%files +%{mattermost_home}/plugins/autolink/plugin.json +%{mattermost_home}/plugins/autolink/server/plugin.exe + + +%changelog