From 988000c99f7367e91b838a31c1b1db25ba3f4c6d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Jun 17 2016 14:55:35 +0000 Subject: Add support to start the powerline daemon with systemd --- diff --git a/powerline.spec b/powerline.spec index baa8418..86b8483 100644 --- a/powerline.spec +++ b/powerline.spec @@ -1,6 +1,6 @@ Name: powerline Version: 2.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The ultimate status-line/prompt utility License: MIT @@ -17,6 +17,9 @@ BuildRequires: vim-minimal Requires: python3 Requires: fontconfig +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd Source0: https://github.com/powerline/powerline/archive/%{version}.tar.gz Source1: vim-powerline.metainfo.xml @@ -163,6 +166,10 @@ mv %{buildroot}%{python3_sitelib}/powerline/bindings/zsh/powerline.zsh %{buildro mkdir -p %{buildroot}%{_datadir}/appdata install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata +# systemd +install -d -m 0755 %{buildroot}%{_unitdir} +install -m 0644 powerline/dist/systemd/powerline-daemon.service %{buildroot}%{_unitdir}/powerline.service + # cleanup %__rm -rf %{buildroot}%{python3_sitelib}/%{name}/config_files @@ -170,6 +177,15 @@ install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata %fdupes %{buildroot}%{python3_sitelib} %endif +%post +%systemd_post powerline.service + +%preun +%systemd_preun powerline.service + +%postun +%systemd_postun_with_restart powerline.service + %files %doc LICENSE README.rst %{_sysconfdir}/fonts/conf.d/10-powerline-symbols.conf @@ -209,6 +225,7 @@ install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata %{_datadir}/%{name}/zsh/__init__.py* %{_datadir}/%{name}/zsh/powerline.zsh %{python3_sitelib}/* +%{_unitdir}/powerline.service %files docs %doc docs/_build/html @@ -230,10 +247,13 @@ install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata %{_datadir}/tmux/powerline*.conf %changelog +* Fri Jun 17 2016 Andreas Schneider - 2.4-3 +- Add support to start the powerline daemon with systemd + * Tue Apr 19 2016 Patrick Uiterwijk - 2.4-2 - Apply patch to prefer python3 over python2 -* Tue Apr 19 2016 Andreas Schneider - +* Tue Apr 19 2016 Andreas Schneider - 2.4-1 - Update to version 2.4 o Added short parameter for system_load segment that leaves only one load average number out of three.