%define		qmake %_qt4dir/bin/qmake
Version:	0.1
Name:		qmmp
Release:	alt0.M24.1
Summary:	QMMP - Qt-based multimedia player
License: 	GPL
Group: 		Sound
Url:		http://qmmp.ylsoftware.com/
Source:		http://qmmp.ylsoftware.com/files/%name-%version.tar.bz2
Patch0:		%name-0.1-mad_fix.diff

# Automatically added by buildreq on Tue May 29 2007 (-bi)
# manually removed qt4-settings
BuildRequires: ImageMagick XFree86-libs fontconfig freetype2 gcc-c++ glib2 jackit-devel libalsa-devel libfaac-devel libfaad-devel libffmpeg-devel libflac-devel liblame-devel libmad-devel libmpcdec-devel libogg-devel libqt4-core libqt4-devel libqt4-gui libqt4-network libqt4-xml libsamplerate-devel libstdc++-devel libtag-devel libtheora-devel libvorbis-devel libxvid-devel pkgconfig zlib-devel

%description
QMMP is an audio-player, written with help of Qt library.

Main opportunities:
- unpacked winamp skins support
- plugins support
- MPEG1 layer 1/2/3 support
- Ogg Vorbis support
- native FLAC support
- Musepack support
- AlSA sound output
- JACK sound output

%prep
%setup -q
%__subst 's|/usr/local|/usr|g' %name.pro
%patch0 -p1

%build
%qmake %name.pro
# #%__subst 's|-pipe -D_REENTRANT -Wall -W -fPIC  $(DEFINES)|%optflags $(DEFINES)|g' lib/Makefile
# #%__subst 's|-pipe -Wall -W -D_REENTRANT  $(DEFINES)|%optflags $(DEFINES)|g' src/Makefile
# #%__subst 's|-pipe -Wall -W -D_REENTRANT -fPIC  $(DEFINES)|%optflags $(DEFINES)|g' lib/libqmmp/Input/mad/Makefile
# #%__subst 's|taglib -Wall -W -D_REENTRANT -fPIC  $(DEFINES)|taglib %optflags $(DEFINES)|g' lib/libqmmp/Input/mad/Makefile
%make_build

%install
%makeinstall INSTALL_ROOT=%buildroot/usr

# Menu
%__mkdir -p %buildroot/%_menudir/
cat << EOF > %buildroot%_menudir/%name
?package(%name): needs=x11 icon="%name.png" section="Multimedia/Sound" \
title="QMMP - Qt-based multimedia player" command=%_bindir/%name
EOF

# Icons
%__mkdir -p %buildroot%_menudir %buildroot%_liconsdir %buildroot%_miconsdir
convert -resize 48x48 src/images/%name.xpm %buildroot%_liconsdir/%name.png
convert -resize 32x32 src/images/%name.xpm %buildroot%_iconsdir/%name.png
convert -resize 16x16 src/images/%name.xpm %buildroot%_miconsdir/%name.png

%post
%update_menus
%post_ldconfig

%preun
%clean_menus
%postun_ldconfig

%files
%_bindir/*
%_menudir/*
%_libdir/*.so*
%_libdir/lib%name
%_iconsdir/%name.png
%_liconsdir/%name.png
%_miconsdir/%name.png


%changelog
* Tue May 29 2007 Motsyo Gennadi <drool@altlinux.ru> 0.1-alt0.M24.1
- test build for ALM2.4
