From ee6e72b6998702640d38cd2ca66bc1be09b02599 Mon Sep 17 00:00:00 2001 From: webbuilder_pel7ppc64bebuilder0 Date: Wed, 4 Sep 2019 12:05:56 +0200 Subject: [PATCH] mattermost-plugin-gitlab package creation Signed-off-by: webbuilder_pel7ppc64bebuilder0 --- SPECS/mattermost-plugin-gitlab.spec | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 SPECS/mattermost-plugin-gitlab.spec diff --git a/SPECS/mattermost-plugin-gitlab.spec b/SPECS/mattermost-plugin-gitlab.spec new file mode 100644 index 0000000..aa34610 --- /dev/null +++ b/SPECS/mattermost-plugin-gitlab.spec @@ -0,0 +1,63 @@ +%define mattermost_user mattermost +%define mattermost_group mattermost +%define mattermost_home /var/lib/mattermost +%define debug_package %{nil} + +Name: mattermost-plugin-gitlab +Version: 1.0.0 +Release: 1%{?dist} +URL: https://github.com/mattermost/mattermost-plugin-gitlab +Summary: Plugin for Mattermost and GitLab +License: Apache +BuildRequires: golang +Requires: mattermost + + +%description + + +%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/mattermost-plugin-gitlab + + +%build +export GOPATH=`pwd` +export PATH="bin:"$PATH +export GO111MODULE=on +cd src/github.com/mattermost/mattermost-plugin-gitlab +git checkout tags/v%{version} +# server +go mod download +go build -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o plugin.exe ./server +# webapp +pushd webapp +npm install +npm run build +popd + + + +%install +mkdir -p %{buildroot}%{mattermost_home}/plugins/gitlab/{server,webapp}/dist/ +cp -rv src/github.com/mattermost/mattermost-plugin-gitlab/plugin.json %{buildroot}%{mattermost_home}/plugins/gitlab/ +sed 's/"executables": {/"executables": { "server\/dist\/plugin.exe"/' -i %{buildroot}%{mattermost_home}/plugins/gitlab/plugin.json +sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/gitlab/plugin.json +sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/gitlab/plugin.json +sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/gitlab/plugin.json +cp -rv src/github.com/mattermost/mattermost-plugin-gitlab/plugin.exe %{buildroot}%{mattermost_home}/plugins/gitlab/server/dist/ +cp -rv src/github.com/mattermost/mattermost-plugin-gitlab/webapp/dist/main.js %{buildroot}%{mattermost_home}/plugins/gitlab/webapp/dist/ +cp -rv src/github.com/mattermost/mattermost-plugin-gitlab/assets %{buildroot}%{mattermost_home}/plugins/gitlab/ + + +%files +%{mattermost_home}/plugins/gitlab/assets/profile.png +%{mattermost_home}/plugins/gitlab/plugin.json +%{mattermost_home}/plugins/gitlab/server/dist/plugin.exe +%{mattermost_home}/plugins/gitlab/webapp/dist/main.js + + +%changelog