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