From a1e908f7187e173ee6fb69e957d32b3f6695df23 Mon Sep 17 00:00:00 2001 From: webbuilder_pel7x64builder0 Date: Wed, 3 Apr 2019 16:58:43 +0200 Subject: [PATCH] mattermost package update and rename Signed-off-by: webbuilder_pel7x64builder0 --- SOURCES/mattermost.logrotate | 2 +- SOURCES/mattermost.service | 2 +- ...mattermost-server.spec => mattermost.spec} | 59 +++++++++++-------- 3 files changed, 37 insertions(+), 26 deletions(-) rename SPECS/{mattermost-server.spec => mattermost.spec} (53%) diff --git a/SOURCES/mattermost.logrotate b/SOURCES/mattermost.logrotate index 73e7f3b..8470690 100644 --- a/SOURCES/mattermost.logrotate +++ b/SOURCES/mattermost.logrotate @@ -1,5 +1,5 @@ # mattermos logs: -/var/log/mattermost/*.log { +/var/lib/mattermost/log/*.log { daily missingok rotate 14 diff --git a/SOURCES/mattermost.service b/SOURCES/mattermost.service index f66414e..96617f7 100644 --- a/SOURCES/mattermost.service +++ b/SOURCES/mattermost.service @@ -6,7 +6,7 @@ After=syslog.target network.target postgresql.service mysql.service mariadb.serv Type=simple WorkingDirectory=/var/lib/mattermost User=mattermost -ExecStart=/usr/bin/mattermost -c /etc/mattermost/config.js +ExecStart=/var/lib/mattermost/bin/mattermost PIDFile=/var/run/mattermost/master.pid [Install] diff --git a/SPECS/mattermost-server.spec b/SPECS/mattermost.spec similarity index 53% rename from SPECS/mattermost-server.spec rename to SPECS/mattermost.spec index 7742692..4a6c871 100644 --- a/SPECS/mattermost-server.spec +++ b/SPECS/mattermost.spec @@ -2,11 +2,10 @@ %define mattermost_user mattermost %define mattermost_group mattermost %define mattermost_home /var/lib/mattermost -%define mattermost_logdir /var/log/mattermost -#%define debug_package %{nil} +%define debug_package %{nil} Name : mattermost -Version : 5.8.0 +Version : 5.9.0 Release : 1%{dist} License : MIT URL : https://mattermost.io @@ -29,6 +28,7 @@ export GOPATH=`pwd` mkdir -p src/github.com/mattermost/ cd src/github.com/mattermost/ git clone https://github.com/mattermost/mattermost-server/ +git clone https://github.com/mattermost/mattermost-webapp/ %build @@ -40,23 +40,29 @@ go get -d ./... sed 's/amd64/%{_arch}/g' -i build/release.mk %endif make build-linux +cd ../mattermost-webapp +git checkout tags/v%{version} +make build %install -install -p -D -m 0644 bin/mattermost %{buildroot}%{_bindir}/mattermost -install -p -D -m 0644 bin/platform %{buildroot}%{_bindir}/mattermost-platform -install -p -D -m 0644 bin/interface_generator %{buildroot}%{_bindir}/mattermost-interface_generator +mkdir -p %{buildroot}%{mattermost_home}/bin/ +install -p -D -m 0555 bin/mattermost %{buildroot}%{mattermost_home}/bin/mattermost +install -p -D -m 0555 bin/platform %{buildroot}%{mattermost_home}/bin/mattermost-platform +install -p -D -m 0555 bin/interface_generator %{buildroot}%{mattermost_home}/bin/mattermost-interface_generator +mkdir -p %{buildroot}%{mattermost_home}/config/ +cp -r src/github.com/mattermost/mattermost-server/config/* %{buildroot}%{mattermost_home}/config/ +cp -r %{buildroot}%{mattermost_home}/config/default.json %{buildroot}%{mattermost_home}/config/config.json +cp -r src/github.com/mattermost/mattermost-server/templates/ %{buildroot}%{mattermost_home}/ +cp -r src/github.com/mattermost/mattermost-server/fonts/ %{buildroot}%{mattermost_home}/ +cp -r src/github.com/mattermost/mattermost-server/i18n/ %{buildroot}%{mattermost_home}/ +cp -r src/github.com/mattermost/mattermost-webapp/dist/ %{buildroot}%{mattermost_home}/client/ +mkdir -p %{buildroot}%{mattermost_home}/data/ +mkdir -p %{buildroot}%{mattermost_home}/logs/ +mkdir -p %{buildroot}%{mattermost_home}/plugins/ install -p -D -m 0644 %{SOURCE0} %{buildroot}%{_unitdir}/mattermost.service -mkdir -p %{buildroot}%{_sysconfdir}/%{name} -cp -r src/github.com/mattermost/mattermost-server/config/* %{buildroot}%{_sysconfdir}/%{name}/ -cp %{buildroot}%{_sysconfdir}/%{name}/default.json %{buildroot}%{_sysconfdir}/%{name}/config.json -mkdir -p %{buildroot}%{_datadir}/%{name}/ -cp -r src/github.com/mattermost/mattermost-server/templates/ %{buildroot}%{_datadir}/%{name}/ -cp -r src/github.com/mattermost/mattermost-server/fonts/ %{buildroot}%{_datadir}/%{name}/ -cp -r src/github.com/mattermost/mattermost-server/i18n/ %{buildroot}%{_datadir}/%{name}/ + install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/mattermost -install -p -d -m 0700 %{buildroot}%{mattermost_home} -install -p -d -m 0700 %{buildroot}%{mattermost_logdir} %pre @@ -80,16 +86,21 @@ exit 0 %files -%attr(775,%{mattermost_user},%{mattermost_group}) %{_sysconfdir}/%{name}/ -%config(noreplace) %{_sysconfdir}/%{name}/config.json +%defattr(-,%{mattermost_user},%{mattermost_group},-) +%attr(555,%{mattermost_user},%{mattermost_group}) %{mattermost_home}/bin/mattermost +%attr(555,%{mattermost_user},%{mattermost_group}) %{mattermost_home}/bin/mattermost-platform +%attr(555,%{mattermost_user},%{mattermost_group}) %{mattermost_home}/bin/mattermost-interface_generator +%config(noreplace) %{mattermost_home}/config/config.json %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%{_bindir}/%{name} -%{_bindir}/%{name}-platform -%{_bindir}/%{name}-interface_generator -%{_datadir}/%{name}/templates/ -%{_datadir}/%{name}/fonts/ -%{_datadir}/%{name}/i18n/ -%{_unitdir}/mattermost.service +%{mattermost_home}/config/ +%{mattermost_home}/templates/ +%{mattermost_home}/fonts/ +%{mattermost_home}/i18n/ +%{mattermost_home}/client/ +%{mattermost_home}/data/ +%{mattermost_home}/logs/ +%{mattermost_home}/plugins/ +%attr(644,root,root) %{_unitdir}/mattermost.service %changelog