You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.3 KiB

%define mattermost_user mattermost
%define mattermost_group mattermost
%define mattermost_home /var/lib/mattermost
%define debug_package %{nil}
Name: mattermost-plugin-nextcloud
Version: 20210214
Release: 1%{?dist}
URL: https://github.com/Salatfreak/mattermost-plugin-nextcloud
Summary: Mattermost plugin for integration into Nextcloud
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/Salatfreak/mattermost-plugin-nextcloud
%build
export GOPATH=`pwd`
export PATH="bin:"$PATH
cd src/github.com/mattermost/mattermost-plugin-nextcloud
pushd webapp
npm install
npm run build
popd
go build -o plugin.exe ./server
%install
mkdir -p %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/{server,webapp}
cp -rv src/github.com/mattermost/mattermost-plugin-nextcloud/plugin.json %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/
sed 's/"executables": {/"executables": { "server\/plugin.exe"/' -i %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/plugin.json
sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/plugin.json
sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/plugin.json
sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/plugin.json
cp -rv src/github.com/mattermost/mattermost-plugin-nextcloud/plugin.exe %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/server/
cp -rv src/github.com/mattermost/mattermost-plugin-nextcloud/webapp/dist/main.js %{buildroot}%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/webapp/
%files
%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/plugin.json
%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/server/plugin.exe
%{mattermost_home}/plugins/com.github.salatfreak.mattermost-plugin-nextcloud/webapp/main.js
%changelog