webbuilder_pel7ppc64bebuilder0
5 years ago
1 changed files with 62 additions and 0 deletions
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
%define mattermost_user mattermost |
||||
%define mattermost_group mattermost |
||||
%define mattermost_home /var/lib/mattermost |
||||
%define debug_package %{nil} |
||||
%define mp3wasmversion 0.1.6 |
||||
|
||||
Name: mattermost-plugin-voice |
||||
Version: 0.1.0 |
||||
Release: 1%{?dist} |
||||
URL: https://github.com/streamer45/mattermost-plugin-voice |
||||
Summary: Plugin for Mattermost for Voice Messaging |
||||
License: MIT |
||||
BuildRequires: golang |
||||
Requires: mattermost |
||||
|
||||
|
||||
%description |
||||
|
||||
|
||||
%prep |
||||
%setup -q -T -c %{name}-%{version} |
||||
export GOPATH=`pwd` |
||||
go get -u -v github.com/golang/dep/cmd/dep |
||||
wget https://github.com/streamer45/mp3rec-wasm/releases/download/v%{mp3wasmversion}/mp3enc-wasm-%{mp3wasmversion}.tar.gz |
||||
tar xvf mp3enc-wasm-%{mp3wasmversion}.tar.gz |
||||
mkdir -p src/github.com/mattermost/ |
||||
cd src/github.com/mattermost/ |
||||
git clone https://github.com/streamer45/mattermost-plugin-voice |
||||
cp ../../../mp3enc-wasm-%{mp3wasmversion}/recorder.js mattermost-plugin-voice/webapp/src/client/ |
||||
|
||||
|
||||
%build |
||||
export GOPATH=`pwd` |
||||
export PATH="bin:"$PATH |
||||
export GO111MODULE=on |
||||
cd src/github.com/mattermost/mattermost-plugin-voice |
||||
go mod download |
||||
go build -ldflags '-extldflags -s -w -buildid %{version}' -o plugin.exe ./server |
||||
pushd webapp |
||||
npm install |
||||
npm run build |
||||
popd |
||||
|
||||
|
||||
%install |
||||
mkdir -p %{buildroot}%{mattermost_home}/plugins/voice/server/dist/ |
||||
cp -rv src/github.com/mattermost/mattermost-plugin-voice/plugin.json %{buildroot}%{mattermost_home}/plugins/voice/ |
||||
sed 's/"executables": {/"executables": { "server\/dist\/plugin.exe"/' -i %{buildroot}%{mattermost_home}/plugins/voice/plugin.json |
||||
sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/voice/plugin.json |
||||
sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/voice/plugin.json |
||||
sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/voice/plugin.json |
||||
cp -rv src/github.com/mattermost/mattermost-plugin-voice/plugin.exe %{buildroot}%{mattermost_home}/plugins/voice/server/dist/ |
||||
cp -rv src/github.com/mattermost/mattermost-plugin-voice/webapp/dist/main.js %{buildroot}%{mattermost_home}/plugins/github/webapp/dist/ |
||||
|
||||
|
||||
%files |
||||
%{mattermost_home}/plugins/voice/plugin.json |
||||
%{mattermost_home}/plugins/voice/server/dist/plugin.exe |
||||
%{mattermost_home}/plugins/voice/webapp/dist/main.js |
||||
|
||||
|
||||
%changelog |
Loading…
Reference in new issue