%define name extace %define title eXtace %define mainname %{name} %define alsaname %{name}-alsa %define ossname %{name}-oss %define version 1.8.11 %define release %mkrel 4 %define descr %{title} - An Extace Waveform Viewer %define summalsa %{descr} with ALSA support %define summoss %{descr} without ALSA support %define group Sound %define section Multimedia/%{group} %define iconname multimedia_section.png # Change to 1 if ALSA compiles cleanly again %define buildalsa 0 # Needed for building generic packages # Not too sure if these are defined in non-Mandrake distributions: # %{_exec_prefix}/bin -> /usr/bin %define bindir_ %{_bindir} # ~/RPM/tmp %define tmppath_ %{_tmppath} # %{_prefix}/share -> /usr/share %define datadir_ %{_datadir} # %{_libdir}/menu -> %{_exec_prefix}/%{_lib}/menu -> /usr/lib/menu %define menudir_ %{_menudir} Summary: %{summoss} Name: %{name} Version: %{version} Release: %{release} Source: %{name}-%{version}.tar.bz2 License: GPL Group: %{group} BuildRoot: %{tmppath_}/%{name}-%{version}-%{release}-buildroot Requires: gnome-libs >= 1.0.11, esound BuildRequires: fftw2-devel BuildRequires: alsa-lib BuildRequires: fileutils BuildRequires: perl BuildRequires: gtk-devel BuildRequires: esound-devel BuildRequires: imlib-devel #Obsoletes: %{alsaname} URL: http://extace.sf.net %description eXtace is a visual sound display/analysis program for the Gnome Desktop environment (though it works under other environments as long as gnome/esd installed and used). Requires ESD to function. Includes various fourier transforms of the audio data in real-time. Displays include 3D textured flying landscape, 16-128 channel graphic EQ, scope, and a 3D pointed flying landscape. All aspects of the display are fully configurable, even the axis placement. %if %{buildalsa} This version is for users who don't use ALSA. %endif %if %{buildalsa} %package alsa Summary: %{summalsa} Group: %{group} Requires: gnome-libs >= 1.0.11, fftw, esound, alsa Obsoletes: %{mainname} %description alsa eXtace is a visual sound display/analysis program for the Gnome Desktop environment (though it works under other environments as long as gnome/esd or ALSA is installed and used). Requires ESD or ALSA to function. Includes various fourier transforms of the audio data in real-time. Displays include 3D textured flying landscape, 16-128 channel graphic EQ, scope, and a 3D pointed flying landscape. All aspects of the display are fully configurable, even the axis placement. This version is for users who use ALSA. %endif %prep # remove build directories. better do it by hand as I later on move # them around rm -fr $RPM_BUILD_DIR/%{name}-%{version} $RPM_BUILD_DIR/%{alsaname} # Unpack main source %setup -q %if %{buildalsa} # Copy source tree to dir %{alsaname} for later building the alsa version cp -a $RPM_BUILD_DIR/%{name}-%{version} $RPM_BUILD_DIR/%{alsaname} %endif %build # First build the normal/OSS version, and force to ignore ALSA even if present %configure --disable-alsa --disable-rpath # Remove ALSA support from this build perl -pi -e 's|(^#define HAVE_ALSA.*$)|/* $1 */|' config.h for f in {extace,.}/Makefile ; do perl -pi -e 's|(^ALSA_LIBS\s+=\s+).*$|$1|' $f perl -pi -e 's|-lasound||' $f done %make %if %{buildalsa} # Now build the ALSA version. ALSA support is built by default if available cd $RPM_BUILD_DIR/%{alsaname} %configure --disable-rpath %make %endif %install rm -rf %buildroot # First install the OSS version %makeinstall mkdir -p %{buildroot}%{bindir_} # Use /etc/alternatives to have it point to the right binary # The "normal" one is named extace-oss, the alsa bin is called extace-alsa mv %{buildroot}%{bindir_}/%{name} %buildroot%{bindir_}/%{ossname} %if %{buildalsa} # And now install the alsa version cd $RPM_BUILD_DIR/%{alsaname} %makeinstall # Rename the binary so that it doesn't overwrite the pointer to /etc/alternatives mv %{buildroot}%{bindir_}/%{name} %buildroot%{bindir_}/%{alsaname} %endif # Copy another nice utility. This one creates a sine-wave. Turn you phones to # LOUD when you use this.... :-] #cp extace/sine %buildroot%{bindir_} # Only in Mandrake: # Create menu entry for the package mkdir -p %{buildroot}%{menudir_} cat - << EOF > %buildroot%{menudir_}/%{name} ?package(%{name}):command="%{bindir_}/%{name}-oss" \ needs="X11" section="%{section}" title="%{title}" \ icon="%{iconname}" longtitle="%{descr}" EOF %post # Update /etc/alternatives to point to the right binary file update-alternatives --install %{bindir_}/%{name} %{name} %{bindir_}/%{ossname} 100 # Only in Mandrake: # Update menus %{update_menus} %postun update-alternatives --remove %{name} %{bindir_}/%{ossname} # Only in Mandrake: # Remove the menu entry %{clean_menus} %if %{buildalsa} %post alsa # Update /etc/alternatives to point to the right binary file update-alternatives --install %{bindir_}/%{name} %{name} %{bindir_}/%{alsaname} 200 # Only in Mandrake: # Update menus %{update_menus} %postun alsa update-alternatives --remove %{name} %{bindir_}/%{alsaname} # Only in Mandrake: # Remove the menu entry %{clean_menus} %endif %clean rm -rf %buildroot rm -fr $RPM_BUILD_DIR/%{name}-%{version} $RPM_BUILD_DIR/%{alsaname} %files %defattr(-,root,root,0755) %doc TODO AUTHORS CREDITS NEWS ChangeLog README #%{bindir_}/extace %{bindir_}/%{ossname} #%{bindir_}/sine %{datadir_}/gnome/apps/Multimedia/extace.desktop # Only Mandrake: %{menudir_}/%{name} %if %{buildalsa} %files alsa %defattr(-,root,root,0755) %{bindir_}/%{alsaname} %endif %changelog * Tue May 9 2006 Götz Waschk <waschk@mandriva.org> 1.8.11-4mdk - fix buildrequires * Thu Oct 06 2005 Nicolas Lécureuil <neoclust@mandriva.org> 1.8.11-3mdk - Fix BuildRequires - %%mkrel * Fri Sep 10 2004 Lenny Cartier <lenny@mandrakesoft.com> 1.8.11-2mdk - rebuild * Wed Aug 20 2003 Lenny Cartier <lenny@mandrakesoft.com> 1.8.11-1mdk - 1.8.11 * Tue Jan 28 2003 Lenny Cartier <lenny@mandrakesoft.com> 1.6.4-3mdk - rebuild * Tue Sep 03 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.6.4-2mdk - rebuild * Tue Jan 15 2002 Alexander Skwar <ASkwar@Linux-Mandrake.com> 1.6.4-1mdk - 1.6.4 - Actually *use* update-alternatives and not only pretend to do so - alsa subpackage now only contains the alsa binary, thanks to ua - Remove ALSA support, because ALSA 0.5.x doesn't seem to be supported by extace anymore * Thu Sep 13 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.6.1-1mdk - 1.6.1 * Thu Jul 05 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.5.1-1mdk - updated to 1.5.1 * Tue Jan 02 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.4.5-1mdk - updated to 1.4.5 * Fri Dec 15 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.4.4-1mdk - updated to 1.4.4 * Tue Dec 5 2000 Daouda Lo <daouda@mandrakesoft.com> 1.4.0-1mdk - update * Sun Nov 05 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.3.11-1mdk - updated to 1.3.11 * Thu Oct 26 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.3.9-1mdk - updated to 1.3.9 * Wed Oct 18 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.3.8-1mdk - used srpm from Alexander Skwar <ASkwar@Linux-Mandrake.com> : Fri Oct 13 2000 Alexander Skwar <ASkwar@Linux-Mandrake.com> 1.3.8-1mdk New version Split up in a alsa and non-alsa version, ie. it will create two binary packages Use %{_sysconfdir}/alternatives to have it point to the right binary * Mon Sep 18 2000 Alexander Skwar <ASkwar@DigitalProjects.com> 1.3.4-1mdk - New version - Now with ALSA support - Hardcoded to use ALSA card 0, Device 0 and Sub Chan 1 * Sun Aug 27 2000 Alexander Skwar <ASkwar@DigitalProjects.com> 1.3.2-1mdk - New version - (Build-)requires fftw * Wed Apr 26 2000 Lenny Cartier <lenny@mandrakesoft.com> 1.2.0-2mdk - fix group - spec helper fixes * Wed Sep 08 1999 Daouda LO <daouda@mandrakesoft.com> - 1.2.0 * Tue Jul 20 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Initalisation of spec file for Mandrake distribution.