Up to 0.10.0
[packages/mpd_sima.git] / mpd_sima.spec
CommitLineData
60f06724
AF
1Summary: Automagically add titles to mpd playlist
2Name: mpd_sima
18004edd
AF
3Version: 0.10.0
4Release: 1
60f06724
AF
5License: GPL v3+
6Group: Applications
f796ba50 7Source0: http://codingteam.net/project/sima/download/file/%{name}_%{version}.tar.xz
18004edd 8# Source0-md5: 606a7202bea64830237e79f7cb20dc92
60f06724 9Source1: %{name}.service
60f06724
AF
10URL: http://codingteam.net/project/sima
11BuildRequires: rpm-pythonprov
12BuildRequires: sed >= 4.0
f796ba50
AF
13BuildRequires: tar >= 1:1.22
14BuildRequires: xz
4cee60f1 15Requires(post,preun,postun): systemd-units >= 38
60f06724 16Requires: python-mpd
4cee60f1 17Requires: systemd-units >= 38
60f06724
AF
18Provides: group(mpd_sima)
19Provides: user(mpd_sima)
20BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22%description
23MPD Sima is a python daemon meant to feed MPD playlist with artist
24similar to your currently playing track, provided that this artist is
25found in MPD library.
26
27This python code allows you to never run out of music when your
28playlist queue is getting short.
29
30%prep
31%setup -q -n %{name}_%{version}
60f06724
AF
32for f in src/mpd_sima src/simadb_cli; do
33 sed -i -e 's=#!/usr/bin/env python=#!/usr/bin/python=' $f
34done
35for f in data/wrappers/mpd-sima data/wrappers/simadb_cli; do
36 sed -i -e 's=#!/usr/bin/env sh=#!/bin/sh=' $f
37done
38
39%build
40%{__make} PREFIX=%{_prefix}
41
42%install
43rm -rf $RPM_BUILD_ROOT
44install -d $RPM_BUILD_ROOT{%{_sharedstatedir}/%{name},%{_sysconfdir},%{systemdunitdir}}
45
46%{__make} install \
47 PREFIX=%{_prefix} \
48 DESTDIR=$RPM_BUILD_ROOT
49
50install doc/examples/mpd_sima.cfg $RPM_BUILD_ROOT%{_sysconfdir}/mpd-sima.cfg
51install %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
52%py_comp $RPM_BUILD_ROOT%{_datadir}/mpd-sima
53%py_ocomp $RPM_BUILD_ROOT%{_datadir}/mpd-sima
54%{__rm} $RPM_BUILD_ROOT%{_datadir}/mpd-sima/{lib,utils}/*.py
55
56%clean
57rm -rf $RPM_BUILD_ROOT
58
59%pre
60%groupadd -g 275 mpd_sima
61%useradd -u 275 -r -d /home/services/mpd_sima -s /bin/false -c "MPD_sima user" -g mpd_sima mpd_sima
62
63%post
64%systemd_post %{name}.service
65
66%preun
67%systemd_preun %{name}.service
68
69%postun
70if [ "$1" = "0" ]; then
71 %userremove mpd_sima
72 %groupremove mpd_sima
73fi
74%systemd_reload
75
76%files
77%defattr(644,root,root,755)
78%doc doc/AUTHORS doc/Changelog doc/copyright_holders doc/examples doc/FAQ doc/README.* doc/THANKS doc/sima_db.dia
79%attr(600,mpd_sima,mpd_sima) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mpd-sima.cfg
80%attr(755,root,root) %{_bindir}/mpd-sima
81%attr(755,root,root) %{_bindir}/simadb_cli
82%dir %{_datadir}/mpd-sima
83%attr(755,root,root) %{_datadir}/mpd-sima/mpd_sima
84%attr(755,root,root) %{_datadir}/mpd-sima/simadb_cli
85%dir %{_datadir}/mpd-sima/lib
86%{_datadir}/mpd-sima/lib/*.py[co]
87%dir %{_datadir}/mpd-sima/utils
88%{_datadir}/mpd-sima/utils/*.py[co]
89%{_mandir}/man1/mpd-sima.1*
60f06724 90%{_mandir}/man1/simadb_cli.1*
37b4f333 91%{_mandir}/man5/mpd-sima.cfg.5*
60f06724
AF
92%{systemdunitdir}/%{name}.service
93%attr(770,mpd_sima,mpd_sima) %{_sharedstatedir}/mpd_sima
This page took 0.040858 seconds and 4 git commands to generate.