File mediatomb.spec of Package mediatomb (Revision 6)
Currently displaying revision 6 , Show latest
327
1
# vim: set sw=4 ts=4 et:
2
# Copyright (c) 2007-2010 oc2pus
3
# This file and all modifications and additions to the pristine
4
# package are under the same license as the package itself.
5
#
6
# Please submit bugfixes or comments to toni@links2linux.de
7
8
# norootforbuild
9
10
%define _with_js 1
11
12
Name: mediatomb
13
Summary: UPnP AV MediaServer
14
Version: 0.12.1
15
Release: 0.pm.1
16
License: GPL
17
URL: http://mediatomb.cc
18
Group: Productivity/Multimedia/Other
19
Source0: %{name}-%{version}.tar.gz
20
Source1: rcmediatomb
21
Source2: config.xml.tmp
22
Patch0: libav_0.7_support.patch
23
Patch1: mediatomb-0.12.1-gcc46.patch
24
Source90: %{name}-rpmlintrc
25
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
26
BuildRequires: udev
27
BuildRequires: file-devel
28
BuildRequires: gcc-c++
29
BuildRequires: curl-devel
30
BuildRequires: id3lib-devel
31
BuildRequires: libexif-devel
32
#BuildRequires: libextractor-devel
33
BuildRequires: libexpat-devel
34
BuildRequires: libffmpeg-devel
35
BuildRequires: libffmpegthumbnailer-devel
36
BuildRequires: libjack-devel
37
BuildRequires: libmp4v2-devel
38
BuildRequires: mDNSResponder-lib
39
BuildRequires: libmysqlclient-devel
40
BuildRequires: mozilla-nspr
41
BuildRequires: pwdutils
42
BuildRequires: sqlite-devel
43
BuildRequires: libtag-devel
44
BuildRequires: liblastfm-devel
45
46
%if "%{_with_js}" == "1"
47
BuildRequires: libjs-devel
48
BuildRequires: mozilla-xulrunner192-devel
49
%endif
50
51
Requires(pre): %insserv_prereq
52
Requires(pre): coreutils
53
Requires(pre): grep
54
Requires(pre): pwdutils
55
Requires: %{name}-dbbackend = %{version}
56
Requires: logrotate
57
58
%description
59
MediaTomb - UPnP AV Mediaserver for Linux.
60
61
MediaTomb is an open source (GPL) UPnP MediaServer with a nice
62
web user interface, it allows you to stream your digital media
63
through your home network and listen to/watch it on a variety
64
of UPnP compatible devices.
65
66
MediaTomb implements the UPnP MediaServer V 1.0 specification
67
that can be found on http://www.upnp.org/. The current
68
implementation focuses on parts that are required by the
69
specification, however we look into extending the functionality
70
to cover the optional parts of the spec as well.
71
72
MediaTomb should work with any UPnP compliant MediaRenderer,
73
please tell us if you experience difficulties with particular
74
models, also take a look at the Supported Devices list for more
75
information.
76
77
This package contains the shared data for mediatomb. You need
78
addionally one db backend: mediatom-sqlite or mediatomb-mysql
79
80
%package mysql
81
Summary: UPnP AV MediaServer mysql
82
Group: Productivity/Multimedia/Other
83
Requires(pre): coreutils
84
Requires: mysql
85
Requires: %{name} = %{version}
86
Conflicts: %{name}-sqlite
87
Provides: %{name}-dbbackend = %{version}
88
89
%description mysql
90
MediaTomb - UPnP AV Mediaserver for Linux.
91
92
MediaTomb is an open source (GPL) UPnP MediaServer with a nice
93
web user interface, it allows you to stream your digital media
94
through your home network and listen to/watch it on a variety
95
of UPnP compatible devices.
96
97
MediaTomb implements the UPnP MediaServer V 1.0 specification
98
that can be found on http://www.upnp.org/. The current
99
implementation focuses on parts that are required by the
100
specification, however we look into extending the functionality
101
to cover the optional parts of the spec as well.
102
103
MediaTomb should work with any UPnP compliant MediaRenderer,
104
please tell us if you experience difficulties with particular
105
models, also take a look at the Supported Devices list for more
106
information.
107
108
This package contains a mysql AND sqlite enabled binary.
109
110
%package sqlite
111
Summary: UPnP AV MediaServer sqlite
112
Group: Productivity/Multimedia/Other
113
Requires(pre): coreutils
114
Requires: sqlite
115
Requires: %{name} = %{version}
116
Conflicts: %{name}-mysql
117
Provides: %{name}-dbbackend = %{version}
118
119
%description sqlite
120
MediaTomb - UPnP AV Mediaserver for Linux.
121
122
MediaTomb is an open source (GPL) UPnP MediaServer with a nice
123
web user interface, it allows you to stream your digital media
124
through your home network and listen to/watch it on a variety
125
of UPnP compatible devices.
126
127
MediaTomb implements the UPnP MediaServer V 1.0 specification
128
that can be found on http://www.upnp.org/. The current
129
implementation focuses on parts that are required by the
130
specification, however we look into extending the functionality
131
to cover the optional parts of the spec as well.
132
133
MediaTomb should work with any UPnP compliant MediaRenderer,
134
please tell us if you experience difficulties with particular
135
models, also take a look at the Supported Devices list for more
136
information.
137
138
This package contains a sqlite enabled binary.
139
140
%prep
141
%setup -q %{name}-%{version}
142
%patch0 -p1
143
%patch1 -p1
144
145
%__cp %{SOURCE2} .
146
147
%build
148
# otherwise rpmlint is yelling:
149
#... rpm-buildroot-usage ...
150
151
%install
152
%if "%{_with_js}" == "1"
153
jsincludedir=`grep "includedir=" %{_libdir}/pkgconfig/libxul.pc | awk -F = '{print $2}'`
154
jslibdir=`grep "sdkdir=" %{_libdir}/pkgconfig/libxul.pc | awk -F = '{print $2}'`
155
%endif
156
157
#-enable-libjs --with-js-h=%{_includedir}/xulrunner-sdk-1.9.1/js/
158
159
###################
160
# build the sqlite/mysql enabled mediatomb
161
%configure \
162
--prefix=%{_prefix} \
163
--enable-sqlite3 \
164
--enable-mysql \
165
--enable-curl \
166
--enable-ffmpeg \
167
--enable-libmagic \
168
--enable-libexif \
169
--enable-inotify \
170
%if "%{_with_js}" == "1"
171
--enable-libjs \
172
%endif
173
--enable-taglib
174
# --with-js-h=${jsincludedir}/unstable \
175
# --with-js-libs=${jslibdir}/sdk/lib/ \
176
177
%__make %{?jobs:-j%{jobs}}
178
%makeinstall \
179
INSTALL="install -p"
180
%__mv %{buildroot}%{_bindir}/mediatomb \
181
%{buildroot}%{_bindir}/mediatomb-mysql
182
183
###################
184
# build the sqlite enabled mediatomb
185
%__make clean
186
%configure \
187
--prefix=%{_prefix} \
188
--enable-sqlite3 \
189
--disable-mysql \
190
--enable-curl \
191
--enable-ffmpeg \
192
--enable-libmagic \
193
--enable-libexif \
194
--enable-inotify \
195
%if "%{_with_js}" == "1"
196
--enable-libjs \
197
%endif
198
--enable-taglib
199
# --with-js-h=${jsincludedir}/unstable \
200
# --with-js-libs=${jslibdir}/sdk/lib/ \
201
202
%__make %{?_smp_flags}
203
204
%makeinstall \
205
INSTALL="%__install -p"
206
%__mv %{buildroot}%{_bindir}/mediatomb \
207
%{buildroot}%{_bindir}/mediatomb-sqlite
208
209
###################
210
# init script
211
%__install -dm 755 %{buildroot}%{_sbindir}
212
%__install -dm 755 %{buildroot}%{_sysconfdir}/init.d
213
%__install -m 755 %{SOURCE1} \
214
%{buildroot}%{_sysconfdir}/init.d/mediatomb
215
%__install -m 755 config/mediatomb-conf-fedora \
216
%{buildroot}%{_sysconfdir}/mediatomb.conf
217
%__ln_s ../../%{_sysconfdir}/init.d/%{name} \
218
%{buildroot}%{_sbindir}/rcmediatomb
219
220
###################
221
# sample config
222
%__install -dm 755 %{buildroot}%{_sysconfdir}/%{name}
223
%__install -m 644 %{SOURCE2} \
224
%{buildroot}%{_sysconfdir}/%{name}/config.xml
225
226
###################
227
# create a new home
228
%__install -dm 755 %{buildroot}%{_localstatedir}/lib/%{name}
229
%__install -m 644 %{SOURCE1} \
230
%{buildroot}%{_localstatedir}/lib/%{name}/config.xml
231
touch %{buildroot}%{_localstatedir}/lib/%{name}/{config.xml,mediatomb.db,mediatomb.html}
232
233
###################
234
# logrotate
235
%__install -dm 755 %{buildroot}%{_sysconfdir}/logrotate.d
236
%__cat > %{buildroot}%{_sysconfdir}/logrotate.d/%{name} << 'EOF'
237
/var/log/mediatomb {
238
create 644 root root
239
monthly
240
compress
241
missingok
242
}
243
EOF
244
245
%clean
246
%{?buildroot:%__rm -rf "%{buildroot}"}
247
248
%pre
249
# create group if necessary
250
/usr/bin/getent group mediatomb >/dev/null || \
251
/usr/sbin/groupadd -r mediatomb
252
253
# create user
254
/usr/bin/getent passwd mediatomb >/dev/null || \
255
/usr/sbin/useradd \
256
-s /sbin/nologin \
257
-r \
258
-d %{_localstatedir}/lib/%{name} \
259
-G mediatomb \
260
mediatomb > /dev/null 2> /dev/null || :
261
262
%preun
263
%stop_on_removal mediatomb
264
# if removal and not upgrade clean up
265
if [ $1 -eq 0 ]; then
266
/usr/sbin/userdel -r -f mediatomb > /dev/null 2> /dev/null || :
267
/usr/sbin/groupdel mediatomb > /dev/null 2> /dev/null || :
268
fi
269
270
%postun
271
%restart_on_update mediatomb
272
%insserv_cleanup
273
274
%pre sqlite
275
# create group if necessary
276
/usr/bin/getent group mediatomb >/dev/null || \
277
/usr/sbin/groupadd -r mediatomb
278
279
# create user
280
/usr/bin/getent passwd mediatomb >/dev/null || \
281
/usr/sbin/useradd \
282
-s /sbin/nologin \
283
-r \
284
-d %{_localstatedir}/lib/%{name} \
285
-G mediatomb \
286
mediatomb > /dev/null 2> /dev/null || :
287
288
%post sqlite
289
%__rm -f "%{_bindir}/mediatomb"
290
%__ln_s "%{_bindir}/mediatomb-sqlite" "%{_bindir}/mediatomb"
291
292
%postun sqlite
293
%__rm -f "%{_bindir}/mediatomb"
294
295
%post mysql
296
%__rm -f "%{_bindir}/mediatomb"
297
%__ln_s "%{_bindir}/mediatomb-mysql" "%{_bindir}/mediatomb"
298
299
%postun mysql
300
%__rm -f "%{_bindir}/mediatomb"
301
302
%files
303
%defattr(-,root,root)
304
%doc AUTHORS ChangeLog COPYING README*
305
%doc doc/scripting*
306
%attr(0660,mediatomb,mediatomb) %config(noreplace) %{_sysconfdir}/%{name}.conf
307
%attr(0750,mediatomb,mediatomb) %dir %{_sysconfdir}/%{name}
308
%attr(0660,mediatomb,mediatomb) %config(noreplace) %{_sysconfdir}/%{name}/config.xml
309
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
310
%{_sysconfdir}/init.d/%{name}
311
%{_sbindir}/rcmediatomb
312
%dir %{_datadir}/%{name}
313
%{_datadir}/%{name}/*
314
%{_mandir}/man1/*
315
316
%files mysql
317
%defattr(-,root,root)
318
%{_bindir}/mediatomb-mysql
319
320
%files sqlite
321
%defattr(-,root,root)
322
%{_bindir}/mediatomb-sqlite
323
%attr(750,mediatomb,mediatomb) %dir %{_localstatedir}/lib/%{name}
324
%attr(0660,mediatomb,mediatomb) %{_localstatedir}/lib/%{name}/*
325
326
%changelog
327