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