File moc.spec of Package moc

#
# spec file for package moc
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%bcond_with ffmpeg
%bcond_with mad

Name:           moc
Version:        2.5.0
Release:        0
Summary:        Console audio player
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Players
Url:            http://moc.daper.net/
Source0:        ftp://ftp.daper.net/pub/soft/moc/stable/moc-%{version}.tar.bz2
Source1:        ftp://ftp.daper.net/pub/soft/moc/stable/moc-%{version}.tar.bz2.sig
Source2:        moc.keyring
Patch0:         moc-2.5.0-underlinking.patch
BuildRequires:  file-devel
BuildRequires:  libdb-4_8-devel
BuildRequires:  libmpcdec-devel
BuildRequires:  libsidplay1-devel
BuildRequires:  libtimidity-devel
BuildRequires:  libtool
BuildRequires:  ncurses-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libmodplug)
BuildRequires:  pkgconfig(samplerate)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(speex)
BuildRequires:  pkgconfig(taglib_c)
BuildRequires:  pkgconfig(vorbisfile)
BuildRequires:  pkgconfig(wavpack)
%if %{with ffmpeg}
BuildRequires:  libffmpeg1-devel
%endif
%if %{with mad}
BuildRequires:  librcc-devel
BuildRequires:  pkgconfig(id3tag)
BuildRequires:  pkgconfig(mad)
%endif

%description
MOC (music on console) is a console audio player for LINUX/UNIX designed to be
powerful and easy to use.
You just need to select a file from some directory using the menu similar to
Midnight Commander, and MOC will start playing all files in this directory
beginning from the chosen file. There is no need to create play lists like in
other players.
If you want to combine some files from one or few directories on one play list,
you can do this. The play list will be remembered between runs or you can save
it as an m3u file to load it whenever you want.
Need the console where MOC is running for more important things? Need to close
the X terminal emulator? You don't have to stop playing - just press q and the
interface will be detached leaving the server running. You can attach it later,
or you can attach one interface in the console, and another in the X terminal
emulator, no need to switch just to play another file.
MOC plays smoothly, regardless of system or I/O load because it uses the output
buffer in a separate thread. It doesn't cause gaps between files, because the
next file to be played is precached while playing the current file.

Internet stream (Icecast, Shoutcast) are supported.
Key mapping can be fully customized.
Supported file formats are: mp3, Ogg Vorbis, FLAC, Musepack, Speex, WAVE, AIFF,
AU (and other less popular formats supported by libsndfile. New formats support
is under development.

Other features:
  * Simple mixer.
  * Color themes.
  * Searching the menu (the play list or a directory) like M-s in Midnight Commander.
  * The way MOC creates titles from tags is configurable.
  * Optional character set conversion for file tags using iconv().
  * OSS, JACK, and ALSA output.

%prep
%setup -q
%patch0
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/\"__DATE__\"/\"\"$FAKE_BUILDDATE\"\"/" main.c
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i "s/(__TIME__)/(\"$FAKE_BUILDTIME\")/" main.c

%build
%configure --disable-static
make %{?_smp_flags}

%install
%make_install
# Stupid libtool files
rm -rf %{buildroot}%{_libdir}/moc/decoder_plugins/*.la
# Someday people will honor docdir...
rm -rf %{buildroot}%{_datadir}/doc/moc/

%files
%defattr(0644,root,root,0755)
%doc AUTHORS COPYING NEWS README TODO config.example keymap.example
%attr(0755,-,-) %{_bindir}/mocp
%{_mandir}/man1/mocp.1*
%{_libdir}/moc/
%{_datadir}/moc/

%changelog
openSUSE Build Service is sponsored by