%global _hardened_build 1 %global with_sysvinit 0 %global with_systemd 0 %global rhel6 0 %if 0%{?rhel} > 0 && 0%{?rhel} <= 6 %global with_sysvinit 1 %global rhel6 1 %endif %if 0%{?rhel} == 0 || 0%{?rhel} >= 7 %global with_systemd 1 %endif Version: 0.12.1 Summary: UPnP AV MediaServer Name: mediatomb Release: 39%{?dist}.20120403gitb66dc1 Summary: MediaTomb - UPnP AV Mediaserver for Linux License: GPLv2 Group: Applications/Multimedia URL: http://mediatomb.cc #Source0: http://downloads.sourceforge.net/mediatomb/%{name}-%{version}.tar.gz Source0: mediatomb-b66dc1.tar.bz2 Source1: mediatomb.service Source2: mediatomb-mysql.service # Adds handler for ogg audio metadata by default. Submitted upstream: http://sourceforge.net/tracker/?func=detail&aid=3064466&group_id=129766&atid=715782 Patch0: mediatomb-0.12.1.fixogg.patch # Fixes issue where video files > 999 minutes in length overrun the minutes buffer. Patch1: mediatomb-0.12.1.fixbufferoverrun.patch # Fix build issues related to GCC 4.6 (missing definitions.) Submitted upstream #Patch2: mediatomb-0.12.1.fixbuild.patch #Port to js-1.8 (thanks Jan!) Submitted upstream: http://sourceforge.net/tracker/?func=detail&aid=3409482&group_id=129766&atid=715782 #Patch3: mediatomb-0.12.1.tonewjs.patch # Fixes to the js/native code to allow custom js parsing. Submitted upstream (with above) #Patch4: mediatomb-0.12.1-jsparse.patch # Allows timeseeking on ps3. http://sourceforge.net/tracker/?func=detail&aid=3309436&group_id=129766&atid=715782 Patch5: mediatomb-0.12.1.ps3_timeseekrange.patch # Enable album art for FLAC based on libflac. http://sourceforge.net/tracker/?func=detail&aid=2960326&group_id=129766&atid=715782 Patch6: mediatomb-0.12.1.flacart.patch Patch7: mediatomb-0.12.1.flacart.config.patch # Fix youtube support. RHBZ#747023, upstream bug http://sourceforge.net/tracker/?func=detail&aid=3382320&group_id=129766&atid=715780 Patch8: mediatomb-0.12.1.fixyoutube.patch # Fix for gcc 4.7 build errors #Patch9: mediatomb-0.12.1.gcc47.patch # Add subtitles support: http://sourceforge.net/tracker/?func=detail&aid=3014026&group_id=129766&atid=715782 Patch10: mediatomb-0.12.1-samsung_video_subtitles.patch Patch11: mediatomb-0.12.1-transcode-segfault.patch #Patch12: mediatomb-0.12.1-unbundle-libupnp.patch Patch13: mediatomb-sort.patch Provides: bundled(libupnp) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: automake BuildRequires: sqlite-devel, mysql-devel, libexif-devel, id3lib-devel, file-devel, js-devel, zlib-devel, taglib-devel, flac-devel BuildRequires: expat-devel, libcurl-devel BuildRequires: libmp4v2-devel BuildRequires: lastfmlib-devel BuildRequires: xulrunner-devel #BuildRequires: libupnp-devel Requires(pre): shadow-utils Requires: net-tools %if %{with_sysvinit} Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service %endif %if %{with_systemd} %{?systemd_requires} BuildRequires: systemd %endif %description MediaTomb is an open source (GPL) UPnP MediaServer with a nice web user interface, it allows you to stream your digital media through your home network and listen to/watch it on a variety of UPnP compatible devices. MediaTomb implements the UPnP MediaServer V 1.0 specification that can be found on http://www.upnp.org/. %prep %setup -qn mediatomb-b66dc1 %patch0 -p0 %patch1 -p0 #%patch2 -p0 # these two and patch9 fail the build on RHEL6 %if ! %{rhel6} #%patch3 -p1 #%patch4 -p1 %endif %patch5 -p0 %patch6 -p0 %patch7 -p1 %patch8 -p3 %if ! %{rhel6} #%patch9 -p0 %endif %patch10 -p0 %patch11 -p0 #%patch12 -p1 %patch13 -p1 #rm -rf tombupnp %build # Patches affect configure.ac scripts, need to autoreconf autoreconf -if export CPPFLAGS="$CPPFLAGS -fpermissive -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" export LDFLAGS="$LDFLAGS `pkg-config --libs libupnp` -specs=/usr/lib/rpm/redhat/redhat-hardened-ld" %configure --enable-inotify --enable-taglib --enable-libjs --enable-FLAC %{__make} %{?_smp_mflags} %install %{__rm} -rf $RPM_BUILD_ROOT %if %{with_sysvinit} %{__install} -p -D -m0755 scripts/mediatomb-service-fedora $RPM_BUILD_ROOT%{_initrddir}/mediatomb %endif %if %{with_systemd} %{__install} -p -D -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/mediatomb.service %{__install} -p -D -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/mediatomb-mysql.service %endif %{__install} -p -D -m0644 config/mediatomb-conf-fedora $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb.conf make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" # make all files under %%_sysconfdir/mediatomb are owned by # this package %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb touch $RPM_BUILD_ROOT%{_sysconfdir}/mediatomb/{config.xml,mediatomb.db,mediatomb.html} %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %{__cat} > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} << 'EOF' /var/log/mediatomb { create 644 root root monthly compress missingok } EOF %clean %{__rm} -rf $RPM_BUILD_ROOT %pre getent group mediatomb >/dev/null || groupadd -r mediatomb getent passwd mediatomb >/dev/null || \ useradd -r -g mediatomb -d %{_sysconfdir}/mediatomb -s /sbin/nologin \ -c "To run Mediatomb" mediatomb exit 0 %post %if %{with_sysvinit} /sbin/chkconfig --add mediatomb %endif %if %{with_systemd} %systemd_post mediatomb.service %systemd_post mediatomb-mysql.service %endif %preun %if %{with_sysvinit} if [ $1 = 0 ]; then /sbin/service mediatomb stop >/dev/null 2>&1 /sbin/chkconfig --del mediatomb fi %endif %if %{with_systemd} %systemd_preun mediatomb.service %systemd_preun mediatomb-mysql.service %endif %postun %if %{with_systemd} /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart mediatomb.service >/dev/null 2>&1 || : /bin/systemctl try-restart mediatomb-mysql.service >/dev/null 2>&1 || : fi %endif %if %{with_systemd} %systemd_postun_with_restart mediatomb.service %systemd_postun_with_restart mediatomb-mysql.service %endif %files %defattr(-,root,root,-) %doc README README.UTF_8 AUTHORS ChangeLog COPYING doc/doxygen.conf %doc doc/scripting.txt doc/scripting_utf8.txt %attr(-,mediatomb,mediatomb)%config(noreplace) %{_sysconfdir}/mediatomb.conf %attr(-,mediatomb,mediatomb)%dir %{_sysconfdir}/%{name}/ %attr(-,mediatomb,mediatomb)%ghost %{_sysconfdir}/%{name}/* %config(noreplace) %{_datadir}/%{name}/js/import.js %config(noreplace) %{_datadir}/%{name}/js/playlists.js %config(noreplace) %{_datadir}/%{name}/js/common.js %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_bindir}/mediatomb %{_datadir}/%{name}/ %{_mandir}/man1/* %if %{with_sysvinit} %{_initrddir}/mediatomb %endif %if %{with_systemd} %{_unitdir}/mediatomb.service %{_unitdir}/mediatomb-mysql.service %endif %changelog * Thu Dec 15 2016 Jon Ciesla - 0.12.1-39.20120403gitb66dc1 - Sort order patch, BZ 1178284. * Wed Apr 06 2016 Jon Ciesla - 0.12.1-38.20120403gitb66dc1 - Require net-tools, BZ 1272709. - Modernize systemd macros, BZ 850203. - Add route del to unit file, BZ 1211048. * Thu Feb 04 2016 Fedora Release Engineering - 0.12.1-37.20120403gitb66dc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Wed Jun 17 2015 Fedora Release Engineering - 0.12.1-36.20120403gitb66dc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat May 02 2015 Kalev Lember - 0.12.1-35.20120403gitb66dc1 - Rebuilt for GCC 5 C++11 ABI change * Fri Jan 09 2015 Jon Ciesla - 0.12.1-34.20120403gitb66dc1 - libmp4v2 rebuild. * Sun Aug 17 2014 Fedora Release Engineering - 0.12.1-33.20120403gitb66dc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.12.1-32.20120403gitb66dc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu Aug 29 2013 Jon Ciesla - 0.12.1-31.20120403gitb66dc1 - Modify unit files to wait for NetworkManager-wait-online.service, BZ 1001834. * Sat Aug 03 2013 Fedora Release Engineering - 0.12.1-30.20120403gitb66dc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu May 16 2013 Jon Ciesla - 0.12.1-29.20120403gitb66dc1 - Provide unit file for use with mysql, BZ 963705. - Harden build, 972667. * Tue May 14 2013 Jon Ciesla - 0.12.1-28.20120403gitb66dc1 - Re-enable FLAC support. BZ 962916. * Tue May 14 2013 Jon Ciesla - 0.12.1-27.20120403gitb66dc1 - Drop explicit deps on mysql-libs and expat. - Fix perms on unit file. * Tue Apr 16 2013 Jon Ciesla - 0.12.1-26.20120403gitb66dc1 - Re-add transcoding segfault fix. * Wed Apr 03 2013 Jon Ciesla - 0.12.1-25.20120403gitb66dc1 - Re-bundle libupnp, patch for multiple CVEs - Update to latest git master. * Fri Feb 22 2013 Jon Ciesla - 0.12.1-24 - Correct port handling in unbundle patch. * Wed Jan 30 2013 Jon Ciesla - 0.12.1-23 - Unbundle libupnp. * Tue Jan 15 2013 Jon Ciesla - 0.12.1-22 - Patch to fix crash, BZ 783367. - autoconfig fixes. * Mon Dec 03 2012 Jon Ciesla - 0.12.1-21 - Fix unit file typo. * Tue Oct 30 2012 Jon Ciesla - 0.12.1-20 - Fix most hardcoding in unit file. * Sun Sep 16 2012 David Jaša - 0.12.1-19 - added patch to enable subtitles support - Committed by Jon Ciesla * Mon Sep 03 2012 David Jaša - 0.12.1-18 - cleaned up conditionals handling Fedora <= 13 - added missing comma before flac-devel in BuildRequires - made .spec compatible with RHEL6 + EPEL - Committed by Jon Ciesla * Fri Jul 20 2012 Fedora Release Engineering - 0.12.1-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Wed Feb 15 2012 Jon Ciesla - 0.12.1-16 - Migrate to systemd, BZ 789767. * Fri Jan 13 2012 Fedora Release Engineering - 0.12.1-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Sun Nov 06 2011 Rich Mattes - 0.12.1-14 - Added call to autoreconf to enable flac support * Tue Oct 18 2011 Rich Mattes - 0.12.1-13 - Fix youtube support (RHBZ#747023) - Enable FLAC cover art via libFLAC * Wed Jun 29 2011 Rich Mattes - 0.12.1-12 - Update to fix js printing routine * Tue Jun 28 2011 Rich Mattes - 0.12.1-11 - Added fix for custom JS parsing failure (#714466) * Tue Apr 19 2011 Jan Horak - 0.12.1-10 - Added Spidermonkey 1.8 patch * Mon Apr 18 2011 Rich Mattes - 0.12.1-10 - Rebuild for updated libjs * Wed Mar 23 2011 Rich Mattes - 0.12.1-9 - More .js files added as configuration * Tue Feb 08 2011 Rich Mattes - 0.12.1-8 - Fixed build errors for gcc 4.6 upgrade - Changed import.js to a configuration file (rhbz #674861) * Tue Feb 08 2011 Fedora Release Engineering - 0.12.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Tue Jan 11 2011 Rich Mattes - 0.12.1-6 - Enable lastfmlib support (rhbz #638573) * Mon Dec 27 2010 Rich Mattes - 0.12.1-5 - Rebuild for mysql update * Mon Nov 22 2010 Rich Mattes - 0.12.1-4 - rhbz651414: patch added to fix buffer overruns on unusually long files * Fri Nov 12 2010 Rich Mattes - 0.12.1-3 - Add patch to enable ogg metadata by default * Sun Jun 20 2010 Rich Mattes - 0.12.1-2 - Fixed specfile dependancies so configure only runs once - Removed dependency on xulrunner, use system jsapi.h * Sat Jun 12 2010 Rich Mattes - 0.12.1-1 - Update to version 12.1 - Remove some patches, now included upstream - Fix rawhide FTBFS errors * Fri Aug 21 2009 Tomas Mraz - 0.11.0-11 - rebuilt with new openssl * Sat Jul 25 2009 Fedora Release Engineering - 0.11.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Jun 28 2009 Marc Wiriadisastra - 0.11.0-9 - Change requires from mysql to mysql-libs closes bz#483635 - Change priority of system-init scripts closes bz#487877 * Sun Jun 28 2009 Marc Wiriadisastra - 0.11.0-8 - Added upstream patch which fixes compile time errors and a couple of segfaults * Wed Feb 25 2009 Fedora Release Engineering - 0.11.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Mon Feb 16 2009 Caolán McNamara 0.11.0-6 - needs to point to xulrunner/js 1.9.1 now - include my_sys.h for my_init - fix some char* -> const char* * Sat Jan 24 2009 Marc Wiriadisastra 0.11.0-5 - Rebuild for mysql dependancy * Mon Dec 1 2008 Michael Schwendt 0.11.0-4 - Include /usr/share/mediatomb directory. * Tue Oct 7 2008 Marc Wiriadisastra 0.11.0-3 - Added the line change for xulrunner * Tue Oct 7 2008 Marc Wiriadisastra 0.11.0-2 - Added patch from upstream for Curl * Thu Aug 28 2008 Michael Schwendt 0.11.0-2 - Include /usr/share/mediatomb directory. * Sun Mar 2 2008 Marc Wiriadisastra 0.11.0-1 - New release version 0.11.0 - Upstream has asked me to remove libextractor - added inotify which works - Removed patches due to upstream inclusion - Added expat-devel - Build with xulrunner - Added patch to remove automatic service up and chkconfig up * Wed Feb 13 2008 Marc Wiriadisastra 0.10.0-9 - Rebuild for gcc4.3 * Sat Jan 5 2008 Marc Wiriadisastra 0.10.0-8 - Added patch from upstream fixes the following issues (no bugs #) - fixes 64bit issues in libupnp - adds correct handling of chunked encoded data in libupnp - fixes regarding id3lib and taglib metadata extraction - fix where sqlite database file was checked in configuration even if mysql driver was selected * Thu Jan 3 2008 Marc Wiriadisastra 0.10.0-7 - Added mysql-devel to build requires * Thu Jan 3 2008 Marc Wiriadisastra 0.10.0-6 - Cleaned up spec file * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-5 - Added mysql-libs for build requires instead of mysql-devel * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-4 - Actually added the patches to the file. - Added the ownership changes (Mamoru Tasaka) - Libextractor enabled * Wed Jan 2 2008 Marc Wiriadisastra 0.10.0-3 - Added patchs to patch ownership of /etc/mediatomb.conf and /etc/mediatomb - Adjusted pre and post scripts and add user and group mediatomb - Changed attributes so files are owned by mediatomb - Cleaned Requires and added two files for build-requires * Sun Dec 23 2007 Marc Wiriadisastra 0.10.0-2 - Altered spec file for inclusion into Fedora * Wed Jul 11 2007 Sergey Bostandzhyan 0.10.0-1 - Version is now filled in by the configure script. * Sun May 27 2007 Sergey Bostandzhyan 0.9.1-1 - updated the init script * Sun Mar 25 2007 Sergey Bostandzhyan 0.9.0-1 - Synced with the new script naming and adjusted for the release, added man page. * Mon Feb 26 2007 Sergey Bostandzhyan - Removed some files that were no longer needed. * Wed Sep 7 2005 Sergey Bostandzhyan - Removed some buildrequires, our configure script should handle different scenarios itself. * Wed Jun 15 2005 Sergey Bostandzhyan - Added init.d script + chkconfig * Thu Apr 14 2005 Sergey Bostandzhyan - Initial release