Blob Blame History Raw
%define snapshot 20100110
%define version 0.1.19
%define release %{?snapshot:0.1.%{snapshot}snap}%{!?snapshot:1}%{?dist}

Name: ocp
Version: %{version}
Release: %{release}
Summary: Open Cubic Player for MOD/S3M/XM/IT/SID/MIDI music files

Group: Applications/Multimedia
# Lack of any specific mention of a GPL version, so any version applies.
# See doc/texi/ocp.text.in and doc/texi/faq.texi.
# "OCP is published under the GNU General Public License (GPL)."
# Requested upstream to include license header at the top of every
# source file 2008/07/08.
License: GPL+
URL: http://stian.cubic.org/coding-ocp.php
%define source %{name}-%{?snapshot:snapshot-%{snapshot}}%{!?snapshot:%{version}}
Source: http://stian.cubic.org/ocp/%{source}.tar.bz2
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: adplug-devel
BuildRequires: alsa-lib-devel
BuildRequires: desktop-file-utils
BuildRequires: flac-devel
BuildRequires: libsidplay-devel
BuildRequires: libvorbis-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXpm-devel
BuildRequires: libXxf86vm-devel
BuildRequires: ncurses-devel
BuildRequires: SDL-devel
BuildRequires: texinfo
BuildRequires: zlib-devel

# For the hicolor icon directories
Requires: hicolor-icon-theme

Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info

%description
Open Cubic Player is a music file player ported from DOS that supports
Amiga MOD module formats and many variants, such as MTM, STM, 669,
S3M, XM, and IT.  It is also able to render MIDI files using sound
patches and play SID, OGG Vorbis, FLAC, and WAV files.  OCP provides a
nice text-based interface with several text-based and graphical
visualizations.


%prep
%setup -q -n %{source}


%build
%configure --with-x11 \
	   --with-adplug \
	   --with-sidplay \
	   --with-alsa \
	   --without-coreaudio \
	   --with-oss \
	   --with-lzw \
	   --with-flac \
	   --with-sdl \
	   --without-mad \
	   --with-libiconv=auto

make
# Makefiles are not SMP-clean
#{?_smp_mflags}


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/etc
make install DESTDIR=%{buildroot}

# rename ultrafix.sh script to make it obvious that it belongs to this
# package and avoid conflicts.
mv %{buildroot}%{_bindir}/ultrafix.sh %{buildroot}%{_bindir}/ocp-ultrafix.sh

# mv config to /etc (ocp will search here if it isn't found in the original location)
mv %{buildroot}%{_datadir}/%{name}-%{version}/etc/ocp.ini %{buildroot}/etc/ocp.ini
rmdir %{buildroot}%{_datadir}/%{name}-%{version}/etc

# remove wmconfig stuff
rm -rf %{buildroot}/etc/X11

# remove info/dir
rm -f %{buildroot}/%{_infodir}/dir

# rename desktop file to name.desktop to match packaging guidelines
mv %{buildroot}%{_datadir}/applications/*opencubicplayer.desktop \
   %{buildroot}%{_datadir}/applications/ocp.desktop
desktop-file-install --vendor="fedora" \
		     --add-category="Audio" \
		     --add-category="Midi" \
		     --add-category="Player" \
		     --dir=%{buildroot}%{_datadir}/applications \
		     --delete-original \
		     %{buildroot}%{_datadir}/applications/ocp.desktop


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root)
# make install already installs the docs here for us
%doc %{_docdir}/%{name}-%{version}
%{_datadir}/%{name}-%{version}
%{_libdir}/%{name}-%{version}
%{_bindir}/ocp-%{version}
%{_bindir}/ocp
%{_bindir}/ocp-curses
%{_bindir}/ocp-sdl
%{_bindir}/ocp-vcsa
%{_bindir}/ocp-x11
%{_bindir}/ocp-ultrafix.sh
%{_infodir}/ocp.info*
%{_datadir}/icons/hicolor/16x16/apps/*
%{_datadir}/icons/hicolor/48x48/apps/*
%{_datadir}/applications/fedora-ocp.desktop
%config(noreplace) /etc/ocp.ini


%post
/sbin/install-info %{_infodir}/ocp.info.gz %{_infodir}/dir || :
gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :


%preun
if [ "$1" = 0 ]; then
    /sbin/install-info --delete %{_infodir}/ocp.info.gz %{_infodir}/dir || :
fi


%postun
gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :


%changelog
* Tue Jan 19 2010 Charles R. Anderson <cra@wpi.edu> 0.1.19-0.1.20100110snap
- 0.1.19-0.1.20100110snap

* Tue Jan 19 2010 Charles R. Anderson <cra@wpi.edu> 0.1.18-1
- 0.1.18
- enable SDL: ocp-sdl

* Tue Oct 06 2009 Charles R. Anderson <cra@wpi.edu> 0.1.17-20090926snap
- snapshot 20090926
- adds ocp-curses, ocp-sdl, ocp-vcsa, and ocp-x11 binaries

* Tue Oct 06 2009 Charles R. Anderson <cra@wpi.edu> 0.1.17-1
- 0.1.17-1

* Sat Sep 12 2009 Charles R. Anderson <cra@wpi.edu> 0.1.17-0.20090730cvs
- snapshot 20090730

* Mon Mar 02 2009 Charles R. Anderson <cra@wpi.edu> 0.1.16-1
- 0.1.16-1
- upstreamed patches: alsa condmad docdir gcc43 info-dir symlink
- upstreamed: move icons to hicolor theme
- remove info/dir from buildroot
- patch configure.ac to correctly find byteswap.h
- no longer BR libid3tag

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.15-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Nov 10 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-4
- Add missing Requires: hicolor-icon-theme for the hicolor icon
  directories
- remove wmconfig bits in a more succinct way
- rename ultrafix.sh to ocp-ultrafix.sh to prevent possible conflicts
- add comments about the applied patches and their upstream status

* Sun Nov 02 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-3
- fix condmad.patch: add HAVE_MAD & HAVE_ID3TAG to Rules.make.in
- update desktop file patch (keep Terminal=false change, 
  use themed icon name "ocp" rather than path)
- move icons to hicolor theme, call gtk-update-icon-cache in %%post(un)

* Tue Jun 24 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-2
- don't need redundant BR libogg-devel
- remove ExlusiveArch, try build on all arches
- alphabetize BR's on separate lines
- enable oss and id3tag support
- remove obsolete wmconfig desktop file
- fix Makefile to install standard documentation files under /usr/share/doc/
- fix Makefile to create relative symlink instead of absolute
- use --delete-original on desktop-file-install
- add @dircategory and @direntry to info file so it can be installed

* Tue Jun 24 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-1.2
- BR texinfo for /usr/bin/makeinfo

* Tue Jun 24 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-1.1
- create /usr/share/doc/%%{name}-%%{version} in buildroot

* Tue Jun 24 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-1
- Initial Fedora Package submission
- clean up summary, description and comments
- don't try to install-info since there is no directory entry

* Tue Jun 24 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.8cra
- No longer BR libid3tag-devel

* Sat Jun 22 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.7cra
- conditionalize mp3 support and disable it
- explicitly disable coreaudio

* Fri Jun 20 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.6cra
- BR libXext-devel alsa-lib-devel

* Tue Jun 17 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.5cra
- disable ALSA_DEBUG

* Tue Jun 17 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.4cra
- Enable ALSA_DEBUG
- workaround pulseaudio alsa plugin bug (snd_pcm_hw_params_any returns > 0)

* Sun Jun 08 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.3cra
- gcc 4.3 patch
- install-info in post/preun
- rename desktop file to fedora-ocp.desktop
- use desktop-file-install

* Sun Jun 08 2008 Charles R. Anderson <cra@wpi.edu> 0.1.15-0.2cra
- BR libid3tag-devel libXxf86vm-devel
- use proper macros in file section
- explicitly enable configure flags, disable OSS
- License: GPL+ because no specific version is mentioned in the docs
  or source code.
- Patch desktop file to specify UTF-8 encoding