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
1.6 KiB

%define mattermost_user mattermost
%define mattermost_group mattermost
%define mattermost_home /var/lib/mattermost
%define debug_package %{nil}
Name: mattermost-plugin-rssfeed
Version: 0.0.2
Release: 1%{?dist}
Summary: Plugin for Mattermost and RSS feed
License: Apache
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
mkdir -p src/github.com/wbernest/
cd src/github.com/wbernest/
git clone https://github.com/wbernest/mattermost-plugin-rssfeed
%build
export GOPATH=`pwd`
export PATH="bin:"$PATH
cd src/github.com/wbernest/mattermost-plugin-rssfeed
pushd server
$GOPATH/bin/dep ensure
pushd vendor/github.com/mattermost/
rm -rf mattermost-server
git clone https://github.com/mattermost/mattermost-server
popd
go build -o plugin.exe
popd
%install
mkdir -p %{buildroot}%{mattermost_home}/plugins/rssfeed/server
cp -rv src/github.com/wbernest/mattermost-plugin-rssfeed/plugin.json %{buildroot}%{mattermost_home}/plugins/rssfeed/
sed 's/"executables": {/"executables": { plugin.exe/' -i %{buildroot}%{mattermost_home}/plugins/rssfeed/plugin.json
sed '/"darwin-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/rssfeed/plugin.json
sed '/"linux-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/rssfeed/plugin.json
sed '/"windows-amd64"/d' -i %{buildroot}%{mattermost_home}/plugins/rssfeed/plugin.json
cp -rv src/github.com/wbernest/mattermost-plugin-rssfeed/server/plugin.exe %{buildroot}%{mattermost_home}/plugins/rssfeed/server/
%files
%{mattermost_home}/plugins/rssfeed/plugin.json
%{mattermost_home}/plugins/rssfeed/server/plugin.exe
%changelog