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