From 378771de6f2dbda0e4edb2977d17a624675e5b6e Mon Sep 17 00:00:00 2001 From: webbuilder_pel7ppc64bebuilder0 Date: Tue, 13 Aug 2019 10:44:39 +0200 Subject: [PATCH] mattermost-plugin-voice package creation Signed-off-by: webbuilder_pel7ppc64bebuilder0 --- SPECS/mattermost-plugin-voice.spec | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 SPECS/mattermost-plugin-voice.spec diff --git a/SPECS/mattermost-plugin-voice.spec b/SPECS/mattermost-plugin-voice.spec new file mode 100644 index 0000000..f369ee4 --- /dev/null +++ b/SPECS/mattermost-plugin-voice.spec @@ -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