#
# Conditional build:
-%bcond_with gstreamer # build with GStreamer support (instead of XINE)
+%bcond_without sid # build without sid support
#
-Summary: Sound player with the WinAmp GUI, for Unix-based systems for GTK+2
-Summary(pl): Odtwarzacz d¼wiêku z interfejsem WinAmpa dla GTK+2
+Summary: Sound player with the WinAmp GUI, for Unix-based systems for GTK+
+Summary(pl.UTF-8): Odtwarzacz dźwięku z interfejsem WinAmpa dla GTK+
Name: bmpx
-Version: 0.11.5.1
-Release: 0.1
-Epoch: 1
-License: GPL
+Version: 0.40.14
+Release: 3
+License: GPL v2
Group: X11/Applications/Sound
-Source0: http://download.berlios.de/bmpx/%{name}-%{version}.tar.gz
-# Source0-md5: f0b89bb96fd8b14cfd805f4a726b4f16
-Source1: mp3license
-URL: http://bmpx.berlios.de/
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: cairo-devel >= 1.0.0
-BuildRequires: curl-devel
-BuildRequires: esound-devel >= 0.2.8
-BuildRequires: fam-devel
-BuildRequires: gtk+2-devel >= 2:2.8.0
-BuildRequires: libvorbis-devel >= 1:1.0
-BuildRequires: libglade2-devel >= 1:2.5.1
-BuildRequires: taglib-devel
-%if %{with gstreamer}
-BuildRequires: gstreamer-devel >= 0.9.1
-%else
-BuildRequires: xine-lib-devel
-%endif
+Source0: http://files.backtrace.info/releases/0.40/%{name}-%{version}.tar.bz2
+# Source0-md5: c741e05a82a82b14b6775d44a7c93c15
+Patch0: %{name}-lib64.patch
+Patch1: %{name}-libsoup24.patch
+Patch2: %{name}-invalid-conversion.patch
+URL: http://bmpx.backtrace.info/
+BuildRequires: alsa-lib-devel >= 1.0.9
+BuildRequires: autoconf >= 2.60
+BuildRequires: automake >= 1:1.8
+BuildRequires: boost-devel >= 1.35.0
+BuildRequires: cairomm-devel >= 0.6.0
+BuildRequires: cdparanoia-III-devel
+BuildRequires: dbus-glib-devel >= 0.62
+BuildRequires: gcc-c++ >= 5:4.0.0
+BuildRequires: gstreamer-plugins-base-devel >= 0.10.10
+BuildRequires: gtkmm-devel >= 2.10.0
+BuildRequires: hal-devel >= 0.5.7.1
+BuildRequires: intltool >= 0.35.0
+BuildRequires: libglademm-devel >= 2.6.0
+BuildRequires: libmodplug-devel >= 0.7
+BuildRequires: libofa-devel >= 0.9.3
+BuildRequires: librsvg-devel >= 1:2.14.0
+BuildRequires: libsexymm-devel >= 0.1.9
+%{?with_sid:BuildRequires: libsidplay-devel}
+BuildRequires: libsigc++-devel >= 2.0.0
+BuildRequires: libsoup-devel >= 2.4.0
+BuildRequires: libtool
+BuildRequires: libxml2-devel >= 1:2.6.26
+BuildRequires: libxslt-progs
+BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.311
+BuildRequires: sqlite3-devel >= 3.3.11
+BuildRequires: startup-notification-devel >= 0.8
+BuildRequires: taglib-devel >= 1.4-2
+BuildRequires: unzip
+BuildRequires: xorg-lib-libSM-devel
+BuildRequires: zip
+Requires(post,postun): desktop-file-utils
+Requires(post,postun): gtk+2 >= 2:2.10.0
+Requires(post,postun): hicolor-icon-theme
+Requires: gstreamer-audio-effects-base
+Requires: gstreamer-audiosink
+Suggests: gstreamer-aac
+Suggests: gstreamer-audio-formats >= 0.10.3
+Suggests: gstreamer-cdparanoia
+Suggests: gstreamer-ffmpeg
+Suggests: gstreamer-flac
+Suggests: gstreamer-mad
+Suggests: gstreamer-mms
+Suggests: gstreamer-musepack
+Suggests: gstreamer-plugins-bad
+Suggests: gstreamer-sid
+Suggests: gstreamer-vorbis
+Obsoletes: bmpx-curses
+Obsoletes: bmpx-libs
+Obsoletes: bmpx-plugin-container
+Obsoletes: bmpx-plugin-flow
+Obsoletes: bmpx-plugin-transport
+Obsoletes: bmpx-plugins-base
+Obsoletes: bmpx-remote
+Obsoletes: bmpx-remote-gtk
+Obsoletes: bmpx-static
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _iceweaseldir %{_datadir}/iceweasel
+%define _chromedir %{_iceweaseldir}/chrome
+
%description
BMPx is the follow-up of the BMP project with a codebase rewritten
from scratch and aims to maintain a stable audio player foundation,
and to provide a player with a consistent and easy to understand usage
experience.
-%description -l pl
-BMPx jest nastêpc± projektu BMP z przepisanym od zera kodem i skupia
-siê na utrzymaniu stabilnej podstawy odtwarzacza audio, aby udostêpniæ
-odtwarzacz ze spójn± i ³atw± do zrozumienia obs³ug±.
+%description -l pl.UTF-8
+BMPx jest następcą projektu BMP z przepisanym od zera kodem i skupia
+się na utrzymaniu stabilnej podstawy odtwarzacza dźwięku, aby
+udostępnić odtwarzacz ze spójną i łatwą do zrozumienia obsługą.
+
+%package devel
+Summary: Header files for BMPx media player
+Summary(pl.UTF-8): Pliki nagłówkowe odtwarzacza multimedialnego BMPx
+Group: X11/Development/Libraries
+Requires: dbus-glib-devel >= 0.62
+Obsoletes: libchroma-devel
+Obsoletes: libhrel-devel
+
+%description devel
+Header files required for compiling BMPx media player plugins.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe potrzebne do kompilowania wtyczek odtwarzacza
+multimedialnego BMPx.
+
+%package -n iceweasel-extension-bmpx
+Summary: Iceweasel extension - BMPx
+Summary(pl.UTF-8): Rozszerzenie dla przeglądarki Iceweasel - BMPx
+Group: X11/Applications
+Requires: %{name} = %{version}-%{release}
+Requires: iceweasel
+Provides: mozilla-firefox-plugin-bmpx
+Obsoletes: mozilla-firefox-plugin-bmpx
+
+%description -n iceweasel-extension-bmpx
+Iceweasel extension which registers the lastfm:// protocol to BMPx.
+
+%description -n iceweasel-extension-bmpx -l pl.UTF-8
+Rozszerzenie dla przeglądarki Iceweasel, które rejestruje protokół
+lastfm:// do BMPx.
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
-rm -rf autom4te.cache
+%{__libtoolize}
%{__aclocal} -I m4
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
-%if %{with gstreamer}
- --enable-gst \
-%else
- --enable-xine \
-%endif
- --enable-shared \
- --enable-static
+ --enable-hal \
+ --enable-modplug \
+ %{?with_sid:--enable-sid} \
+ --with-dbus-services-dir=%{_datadir}/dbus-1/services
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_chromedir}
%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT \
- m4datadir=%{_aclocaldir}
+ DESTDIR=$RPM_BUILD_ROOT
-rm -f $RPM_BUILD_ROOT%{_datadir}/bmpx/data/GPL.txt
+unzip -q -o xpi/bmp.xpi -d $RPM_BUILD_ROOT%{_iceweaseldir}
+sed -e 's@chrome/bmp\.jar@bmp\.jar@' $RPM_BUILD_ROOT%{_iceweaseldir}/chrome.manifest \
+ > $RPM_BUILD_ROOT%{_chromedir}/bmp.manifest
-install -d $RPM_BUILD_ROOT%{_pixmapsdir}
-mv -f $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/bmpx.png \
- $RPM_BUILD_ROOT%{_pixmapsdir}
+rm -f $RPM_BUILD_ROOT%{_iceweaseldir}/{install.rdf,chrome.manifest}
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/bmpx/plugins/{taglib,vfs/container,vfs/transport}/*.la
+mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{th_TH,th}
%find_lang %{name}
rm -rf $RPM_BUILD_ROOT
%post
-umask 022
-[ ! -x /usr/bin/update-desktop-database ] || /usr/bin/update-desktop-database >/dev/null 2>&1 ||:
-
/sbin/ldconfig
+%update_desktop_database_post
+%update_icon_cache hicolor
%postun
-umask 022
-[ ! -x /usr/bin/update-desktop-database ] || /usr/bin/update-desktop-database >/dev/null 2>&1
-
/sbin/ldconfig
+%update_desktop_database_postun
+%update_icon_cache hicolor
%files -f %{name}.lang
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/bmp*
-%{_mandir}/man*/*
-%{_desktopdir}/*
+%doc AUTHORS ChangeLog NEWS README
+%attr(755,root,root) %{_bindir}/bmp2
+%attr(755,root,root) %{_bindir}/beep-media-player-2
+%attr(755,root,root) %{_bindir}/bmp-play-files-2.0
+%attr(755,root,root) %{_bindir}/bmp-play-uris-2.0
+%attr(755,root,root) %{_libexecdir}/beep-media-player-2-bin
+%attr(755,root,root) %{_libexecdir}/beep-media-player-2-sentinel
+
+%dir %{_libdir}/bmpx
+%dir %{_libdir}/bmpx/plugins
+%dir %{_libdir}/bmpx/plugins/taglib
+%dir %{_libdir}/bmpx/plugins/vfs
+%dir %{_libdir}/bmpx/plugins/vfs/container
+%dir %{_libdir}/bmpx/plugins/vfs/transport
+%attr(755,root,root) %{_libdir}/bmpx/plugins/taglib/*.so*
+%attr(755,root,root) %{_libdir}/bmpx/plugins/vfs/container/*.so*
+%attr(755,root,root) %{_libdir}/bmpx/plugins/vfs/transport/*.so*
+%{_docdir}/bmpx
%{_datadir}/bmpx
-%{_datadir}/bmp-remote
-%{_pixmapsdir}/*
-%attr(755,root,root) %{_libdir}/libskinned.so.*
+%{_datadir}/dbus-1/services/*.service
+%{_mandir}/man*/*
+%{_desktopdir}/*.desktop
+%{_iconsdir}/hicolor/*/*/*.png
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/bmp-2.0
+%{_pkgconfigdir}/*.pc
+
+%files -n iceweasel-extension-bmpx
+%defattr(644,root,root,755)
+%{_chromedir}/bmp.jar
+%{_chromedir}/bmp.manifest