a3de16c
# We used to define this dynamically, but the Fedora buildsystem chokes on
a3de16c
# using this for the versioned Requires on tcl(abi), so we hardcode it.
a3de16c
# This sucks, but there is no other clean way around it, because tcl
a3de16c
# (and tclsh) aren't in the default buildroot.
a3de16c
%{!?tcl_version: %define tcl_version 8.5}
9c4bd46
%{!?tcl_sitearch: %define tcl_sitearch %{_libdir}/tcl%{tcl_version}}
9c4bd46
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
9c4bd46
%define realname snack
9c4bd46
9c4bd46
Name:		tcl-%{realname}
9c4bd46
Version:	2.2.10
2076b25
Release:	10%{?dist}
9c4bd46
Summary:	Sound toolkit
9c4bd46
Group:		System Environment/Libraries
9c4bd46
License:	GPLv2+
9c4bd46
URL:		http://www.speech.kth.se/snack/
9c4bd46
# The upstream source has two files which implement MP3 decoding.
9c4bd46
# ./generic/jkFormatMP3.c and ./generic/jkFormatMP3.h
9c4bd46
# Due to patent concerns, we cannot ship that code, thus, the modified tarball.
9c4bd46
# Those files are not present in the tarball, all other related removals is done 
9c4bd46
# with a patch.
9c4bd46
# Upstream source can be found here: http://www.speech.kth.se/snack/dist/snack2.2.10.tar.gz
9c4bd46
Source0:	%{realname}%{version}-nomp3.tar.gz
9c4bd46
Patch0:		snack2.2.10-nomp3.patch
9c4bd46
Patch1:		snack2.2.10-extracflags.patch
9c4bd46
Patch2:		snack2.2.10-shared-stubs.patch
ed3816a
Patch3:		snack2.2.10-newALSA.patch
9c4bd46
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b1318fd
BuildRequires:	tcl-devel, tk-devel, libogg-devel, libvorbis-devel
2076b25
BuildRequires:	libXft-devel
b1318fd
# BuildRequires: alsa-lib-devel
9c4bd46
BuildRequires:	python-devel
d06a90a
Requires:	tcl(abi) = %{tcl_version}
9c4bd46
Provides:	%{realname} = %{version}-%{release}
9c4bd46
9c4bd46
%description
9c4bd46
The Snack Sound Toolkit is designed to be used with a scripting language such 
9c4bd46
as Tcl/Tk or Python. Using Snack you can create powerful multi-platform audio 
9c4bd46
applications with just a few lines of code. Snack has commands for basic sound 
9c4bd46
handling, such as playback, recording, file and socket I/O. Snack also provides 
9c4bd46
primitives for sound visualization, e.g. waveforms and spectrograms. It was 
9c4bd46
developed mainly to handle digital recordings of speech, but is just as useful 
9c4bd46
for general audio. Snack has also successfully been applied to other 
9c4bd46
one-dimensional signals. The combination of Snack and a scripting language 
9c4bd46
makes it possible to create sound tools and applications with a minimum of 
9c4bd46
effort. This is due to the rapid development nature of scripting languages. As 
9c4bd46
a bonus you get an application that is cross-platform from start. It is also 
9c4bd46
easy to integrate Snack based applications with existing sound analysis 
9c4bd46
software.
9c4bd46
2076b25
%package devel
2076b25
Summary:	Development files for Snack Sound Toolkit
2076b25
Group:		Development/Libraries
2076b25
Requires:	%{name} = %{version}-%{release}
2076b25
2076b25
%description devel
2076b25
This package contains development files for the Snack Sound Toolkit.
2076b25
9c4bd46
%package -n python-%{realname}
9c4bd46
Summary:	Python bindings for Snack Sound Toolkit
9c4bd46
Group:		System Environment/Libraries
9c4bd46
Requires:	%{name} = %{version}-%{release}
9c4bd46
9c4bd46
%description -n python-%{realname}
9c4bd46
This package contains python bindings for the Snack Sound Toolkit. Tcl, Tk, and
9c4bd46
Tkinter are also required to use Snack.
9c4bd46
9c4bd46
%prep
9c4bd46
%setup -q -n %{realname}%{version}
9c4bd46
%patch0 -p1 -b .nomp3
9c4bd46
%patch1 -p1 -b .extracflags
9c4bd46
%patch2 -p1 -b .shared-stubs
ed3816a
%patch3 -p1 -b .newALSA
9c4bd46
chmod -x generic/*.c generic/*.h unix/*.c COPYING README demos/python/*
9c4bd46
iconv -f iso-8859-1 -t utf-8 -o README{.utf8,}
9c4bd46
mv README{.utf8,}
9c4bd46
sed -i -e 's|\r||g' demos/python/*.txt
9c4bd46
9c4bd46
%build
9c4bd46
cd unix/
b1318fd
%configure --disable-static --with-tcl=%{_libdir} --with-tk=%{_libdir} --with-ogg-include=%{_includedir} --with-ogg-lib=%{_libdir}
9c4bd46
make %{?_smp_mflags} EXTRACFLAGS="%{optflags}"
9c4bd46
cd ../python
9c4bd46
%{__python} setup.py build
9c4bd46
9c4bd46
%install
9c4bd46
rm -rf %{buildroot}
2076b25
pushd unix/
9c4bd46
make install DESTDIR=%{buildroot}
9c4bd46
find %{buildroot} -name '*.la' -exec rm -f {} ';'
2076b25
popd
2076b25
2076b25
pushd python
9c4bd46
%{__python} setup.py install --skip-build --root %{buildroot}
9c4bd46
install -d %{buildroot}%{tcl_sitearch}
9c4bd46
mv %{buildroot}%{_libdir}/%{realname}2.2 %{buildroot}%{tcl_sitearch}/%{realname}2.2
9c4bd46
chmod -x %{buildroot}%{tcl_sitearch}/%{realname}2.2/snack.tcl
2076b25
popd
2076b25
2076b25
# Devel bits
2076b25
mkdir -p %{buildroot}%{_includedir}
2076b25
install -p generic/*.h %{buildroot}%{_includedir}
2076b25
install -p unix/snackConfig.sh %{buildroot}%{_libdir}
9c4bd46
9c4bd46
%clean
9c4bd46
rm -rf %{buildroot}
9c4bd46
9c4bd46
%post -p /sbin/ldconfig
9c4bd46
9c4bd46
%postun -p /sbin/ldconfig
9c4bd46
9c4bd46
%files
9c4bd46
%defattr(-,root,root,-)
9c4bd46
%doc COPYING README
9c4bd46
%{_libdir}/libsnackstub2.2.so
9c4bd46
%{tcl_sitearch}/%{realname}2.2/
9c4bd46
2076b25
%files devel
2076b25
%defattr(-,root,root,-)
2076b25
%{_includedir}/*.h
2076b25
%{_libdir}/snackConfig.sh
2076b25
9c4bd46
%files -n python-%{realname}
9c4bd46
%defattr(-,root,root,-)
9c4bd46
%doc doc/python-man.html demos/python/
9c4bd46
%{python_sitelib}/tkSnack*
9c4bd46
9c4bd46
%changelog
2076b25
* Mon Mar 16 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-10
2076b25
- enable -devel package
2076b25
2076b25
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-9
2076b25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
2076b25
2076b25
* Wed Dec 24 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-8
2076b25
- fix missing BR: libXft-devel
2076b25
2076b25
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.2.10-7
2076b25
- Rebuild for Python 2.6
2076b25
b1318fd
* Wed Oct 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-6
b1318fd
- disable alsa (bz 463259)
b1318fd
ed3816a
* Mon Sep 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-5
ed3816a
- fix to work with new alsa (from Jeremiah at Myah OS)
ed3816a
a3de16c
* Thu Sep 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-4
a3de16c
- *sigh* hardcoding the tcl version is the only way to get it through the buildsystem
a3de16c
d06a90a
* Wed Sep 17 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-3
d06a90a
- don't hardcode tcl abi version
d06a90a
9c4bd46
* Mon Aug  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-2
9c4bd46
- add BR: python
9c4bd46
9c4bd46
* Wed Jun 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-1
9c4bd46
- Initial package for Fedora
9c4bd46