Пакет moc: Specfile

%define binary_name mocp
%define decoder_plugins %_libdir/%name/decoder_plugins

%def_disable debug
%def_disable static

%def_with ffmpeg
%def_with flac
%def_with mp3
%def_with musepack
%def_with sndfile
%def_with speex
%def_with vorbis 

Name: moc
Version: 2.5.0
Release: alt0.1

Summary: Console player
Group: Sound
License: GPL
Url: http://moc.daper.net/

Source: moc-%version.tar
Patch1: moc-2.4.0-alt-build-fix.patch
Patch2: moc-2.5.0-alpha1-on-change-fix.patch

Requires: %name-player %name-plugin-flac %name-plugin-mp3 %name-plugin-sndfile %name-plugin-vorbis

# Automatically added by buildreq on Wed Jun 07 2006
BuildRequires: gcc-c++ glibc-devel-static jackit-devel libalsa-devel libcurl-devel 
BuildRequires:  libncursesw-devel libsamplerate-devel pkg-config libltdl-devel

%description
MOC is a console audio player with simple ncurses interface in
playmp3list style.

Supported file formats are: mp3, Ogg Vorbis, FLAC, Musepack (mpc), Speex, WAVE,
supported by FFmpeg (WMA, RealAudio, AAC, MP4), AIFF, AU, SVX, Sphere Nist WAV,
IRCAM SF, Creative VOC.

%package player
Summary: Console player
Group: Sound
Requires: %name-decoder-plugin

%description player
MOC is a console audio player with simple ncurses interface in
playmp3list style.

%if_with ffmpeg
%package plugin-ffmpeg
Summary: ffmpeg decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libavformat-devel liblame-devel libfaac-devel

%description plugin-ffmpeg
ffmpeg decoder plugin for %name.
Formats: wma, ra, ,m4a, aac.
%endif

%if_with flac
%package plugin-flac
Summary: flac decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libflac-devel

%description plugin-flac
FLAC support.
Formats: flac, fla.
%endif

%if_with mp3
%package plugin-mp3
Summary: mp3 decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libid3tag-devel libmad-devel librcc-devel

%description plugin-mp3
mp3 support (libmad).
Formats: mp3, mpga, mp2, mp1.
%endif

%if_with musepack
%package plugin-musepack
Summary: musepack decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libtag-devel libmpcdec-devel

%description plugin-musepack
musepack support.
Formats: mpc.
%endif

%if_with sndfile
%package plugin-sndfile
Summary: sndfile decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libsndfile-devel

%description plugin-sndfile
sndfile decoder plugin for %name.
Formats: au, snd, wav, aif, aiff, 8svx, sph, sf, voc.
%endif

%if_with speex
%package plugin-speex
Summary: speex decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libspeex-devel

%description plugin-speex
speex decoder plugin for %name.
Formats: spx.
%endif

%if_with vorbis
%package plugin-vorbis
Summary: vorbis decoder plugin for %name
Group: Sound
Provides: %name-decoder-plugin
Requires: %name-player
BuildRequires: libvorbis-devel

%description plugin-vorbis
Ogg Vorbis support.
Formats: ogg.
%endif

%prep
%setup -q
%patch1 -p1
%patch2 -p1

%build
%add_optflags %optflags_warnings
%__autoreconf

%configure \
	--with-rcc \
	%{subst_enable debug} \
	%{subst_with musepack} \
	%{subst_with sndfile} \
	%{subst_with vorbis} \
	%{subst_with ffmpeg} \
	%{subst_with speex} \
	%{subst_with flac} \
	%{subst_with mp3} \
	#

%make_build

%install
%make_install DESTDIR=%buildroot install

%__mkdir_p %buildroot/%_desktopdir
%__cat >%buildroot/%_desktopdir/%name.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Categories=Audio;Player
Exec=%_bindir/%binary_name
Icon=sound_section
Name=Music On Console
Terminal=true
EOF

%__rm -rf %buildroot%_docdir/%name %buildroot/%decoder_plugins/*.la
%add_findprov_lib_path %decoder_plugins

%post
%update_menus

%postun
%clean_menus

%files

%files player
%_bindir/*
%dir %_libdir/%name
%dir %decoder_plugins
%_datadir/%name
%_man1dir/*
%_desktopdir/%name.desktop
%doc AUTHORS NEWS TODO README *.example

%if_with ffmpeg
%files plugin-ffmpeg
%decoder_plugins/libffmpeg_decoder.so
%endif

%if_with flac
%files plugin-flac
%decoder_plugins/libflac_decoder.so
%endif

%if_with mp3
%files plugin-mp3
%decoder_plugins/libmp3_decoder.so
%endif

%if_with musepack
%files plugin-musepack
%decoder_plugins/libmusepack_decoder.so
%endif

%if_with sndfile
%files plugin-sndfile
%decoder_plugins/libsndfile_formats_decoder.so
%endif

%if_with speex
%files plugin-speex
%decoder_plugins/libspeex_decoder.so
%endif

%if_with vorbis
%files plugin-vorbis
%decoder_plugins/libvorbis_decoder.so
%endif

%changelog
* Thu May 10 2007 Alexey Gladkov <legion@altlinux.ru> 2.5.0-alt0.1
- New version (2.5.0-alpha1)

* Tue Oct 31 2006 Alexey Gladkov <legion@altlinux.ru> 2.4.1-alt2
- Add patch for recode filnames and directories. This is useful 
  for non UTF-8 locales.

* Fri Oct 27 2006 Alexey Gladkov <legion@altlinux.ru> 2.4.1-alt1
- new version

* Fri Sep 22 2006 Alexey Gladkov <legion@altlinux.ru> 2.4.0-alt2
- Package split on: moc, moc-player, moc-plugin-*.
  + moc - virtual package for back compatibity.
- Add new decoder plugins: ffmpeg, musepack, speex.

* Wed Jun 07 2006 Alexey Gladkov <legion@altlinux.ru> 2.4.0-alt1
- new version
- librcc support fixed

* Thu Dec 29 2005 Alexey Gladkov <legion@altlinux.ru> 2.3.2-alt3
- librcc support was added.
- build with -Werror

* Mon Oct 10 2005 Alexey Gladkov <legion@altlinux.ru> 2.3.2-alt2
- %%_libdir/%%name was added to files list.

* Fri Oct 07 2005 Alexey Gladkov <legion@altlinux.ru> 2.3.2-alt1
- 2.3.2

* Wed Aug 03 2005 Alexey Gladkov <legion@altlinux.ru> 2.3.1-alt1
- 2.3.1

* Mon Jun 20 2005 Alexey Gladkov <legion@altlinux.ru> 2.3.0.beta1-alt1
- 2.3.0

* Thu May 26 2005 Alexey Gladkov <legion@altlinux.ru> 2.2.2-alt1
- 2.2.2

* Mon Mar 14 2005 Yuri N. Sedunov <aris@altlinux.ru> 2.2.0-alt1
- new version.

* Sat Jan 01 2005 Yuri N. Sedunov <aris@altlinux.ru> 2.1.4-alt1
- 2.1.4

* Sun Nov 21 2004 Yuri N. Sedunov <aris@altlinux.ru> 2.1.3-alt1
- new version.

* Tue May 20 2003 Yuri N. Sedunov <aris@altlinux.ru> 1.1.0-alt0.3
- Binary renamed to music-on-console (inger) to avoid incredible
  conflict with QT utility with the same name.
- menu (ZerG)

* Tue Nov 26 2002 Yuri N. Sedunov <aris@altlinux.ru> 1.1.0-alt0.2
- new version
- qt-devel added to conflict list.

* Fri Nov 22 2002 Yuri N. Sedunov <aris@altlinux.ru> 1.0.0-alt0.1
- First build for Sisyphus.