-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotter.spec
148 lines (110 loc) · 4.3 KB
/
rotter.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#
# spec file for package rotter
#
# Copyright (c) 2018 Radio Bern RaBe
# http://www.rabe.ch
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
# License as published by the Free Software Foundation, version
# 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
# Please submit enhancements, bugfixes or comments via GitHub:
# https://github.com/radiorabe/centos-rpm-rotter
#
# Conditional build support
# add --without lame option, i.e. enable lame by default
%bcond_without lame
# add --without twolame option, i.e. enable twolame by default
%bcond_without twolame
%global commit a5538b76da5f0933361509eb2322afbffedf890c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: rotter
Version: 0.9
Release: 4.20180129git%{shortcommit}%{?dist}
Summary: Rotter is a Recording of Transmission / Audio Logger for JACK
License: GPLv2
URL: https://www.aelius.com/njh/rotter/
Source0: https://github.com/njh/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Source1: %{name}@.service
Source2: jackd@.service
Source3: dbus-%{name}.conf
BuildRequires: asciidoc
BuildRequires: jack-audio-connection-kit-devel
%if %{with lame}
BuildRequires: lame-devel
%endif
BuildRequires: libsndfile-devel
%if %{with twolame}
BuildRequires: twolame-devel
%endif
%{?systemd_requires}
BuildRequires: systemd
BuildRequires: xmlto
Requires(pre): shadow-utils
# Required for the jackd@.service systemd service unit template
Requires: jack-audio-connection-kit-example-clients
%description
Rotter is a Recording of Transmission / Audio Logger for JACK. It was designed
for use by radio stations, who are legally required to keep a recording of all
their output. Rotter runs continuously, writing to a new file every hour.
Rotter can output files in servaral different strutures, including all files in
a single directory or create a directory structure.The advantage of using a
folder hierarchy is that you can store related files in the hour's directory.
%prep
%autosetup -n %{name}-%{commit}
%build
autoreconf -vi
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%make_install
# Install the systemd service unit
install -d %{buildroot}/%{_unitdir}
install -m 644 %{SOURCE1} %{buildroot}/%{_unitdir}
install -m 644 %{SOURCE2} %{buildroot}/%{_unitdir}
# Install the dbus rotter configuration
install -d %{buildroot}/%{_sysconfdir}/dbus-1/system.d
install -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/dbus-1/system.d/%{name}.conf
# rotter recording instance root and home directory
install -d %{buildroot}/%{_sharedstatedir}/%{name}
%pre
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d /var/lib/%{name} -s /sbin/nologin \
-c "%{name} system user account" %{name}
exit 0
%post
# activate the installed D-Bus system configuration snippet
systemctl reload dbus >/dev/null 2>&1 || :
%files
%doc ChangeLog README.md
%{_bindir}/*
%{_mandir}/man1/*
%{_unitdir}/*
# Install dbus system configuration to run jackd in headless mode
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/%{name}.conf
# rotter recording instance root and home directory
%dir %attr(0755, %{name}, %{name}) %{_sharedstatedir}/%{name}
%changelog
* Tue Feb 06 2018 Christian Affolter <c.affolter@purplehaze.ch> - 0.9-4.20180129gita5538b7
- Add systemd service units
- Create rotter system user/group
- Add D-Bus configuration to run jackd in headless mode
* Mon Jan 29 2018 Christian Affolter <c.affolter@purplehaze.ch> - 0.9-3.20180130gita5538b7
- Bump to a5538b7 (2018-01-29) which includes the previous strftime-style-layout
patch
* Sun Jan 28 2018 Christian Affolter <c.affolter@purplehaze.ch> - 0.9-2.20151103git9a13295
- Applying strftime-style format layout patch
* Thu Jan 25 2018 Christian Affolter <c.affolter@purplehaze.ch> - 0.9-1.20151103git9a13295
- Initial release