%define mattermost_user mattermost %define mattermost_group mattermost %define mattermost_home /var/lib/mattermost %define debug_package %{nil} Name: mattermost-plugin-profanity-filter Version: 20200609 Release: 1%{?dist} Summary: Plugin for Mattermost to have Memes URL: https://github.com/mattermost/mattermost-plugin-profanity-filter 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-profanity-filter %build export GOPATH=`pwd` export PATH="bin:"$PATH export GO111MODULE=on cd src/github.com/mattermost/mattermost-plugin-profanity-filter go build -o plugin.exe ./server %install mkdir -p %{buildroot}%{mattermost_home}/plugins/profanity-filter/server/ cp -rv src/github.com/mattermost/mattermost-plugin-profanity-filter/plugin.json %{buildroot}%{mattermost_home}/plugins/profanity-filter/ sed 's/"executables": {/"executables": { "server\/plugin.exe"/' -i %{buildroot}%{mattermost_home}/plugins/profanity-filter/plugin.json sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/profanity-filter/plugin.json sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/profanity-filter/plugin.json sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/profanity-filter/plugin.json cp -rv src/github.com/mattermost/mattermost-plugin-profanity-filter/plugin.exe %{buildroot}%{mattermost_home}/plugins/profanity-filter/server/ %files %{mattermost_home}/plugins/profanity-filter/plugin.json %{mattermost_home}/plugins/profanity-filter/server/plugin.exe %changelog