Blob Blame History Raw
# We used to define this dynamically, but the Fedora buildsystem chokes on
# using this for the versioned Requires on tcl(abi), so we hardcode it.
# This sucks, but there is no other clean way around it, because tcl
# (and tclsh) aren't in the default buildroot.
%{!?tcl_version: %global tcl_version 8.6}
%{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}}
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%global realname snack

Name:		tcl-%{realname}
Version:	2.2.10
Release:	29%{?dist}
Summary:	Sound toolkit
Group:		System Environment/Libraries
# generic/snackDecls.h, generic/snackStubInit.c and generic/snackStubLib.c 
# are under the TCL "license.terms", a copy of which can be found in the tcl package.
License:	GPLv2+ and TCL
URL:		http://www.speech.kth.se/snack/
# The upstream source has two files which implement MP3 decoding.
# ./generic/jkFormatMP3.c and ./generic/jkFormatMP3.h
# Due to patent concerns, we cannot ship that code, thus, the modified tarball.
# Those files are not present in the tarball, all other related removals is done 
# with a patch.
# Also, mac/snack.mcp.sit.hqx is a mysterious old compressed file with no clear license.
# It is removed.
# Upstream source can be found here: http://www.speech.kth.se/snack/dist/snack2.2.10.tar.gz
Source0:	%{realname}%{version}-nomp3.tar.gz
# License confirmation email for generic/ffa.c
Source1:	LICENSE-ffa.c.txt
Patch0:		snack2.2.10-nomp3.patch
Patch1:		snack2.2.10-extracflags.patch
Patch2:		snack2.2.10-shared-stubs.patch
Patch3:		snack2.2.10-newALSA.patch
Patch4:		tcl-snack-2.2.10-CVE-2012-6303-fix.patch
Patch5:		snack2.2.10-format-security.patch
BuildRequires:	tcl-devel, tk-devel, libogg-devel, libvorbis-devel
BuildRequires:	libXft-devel
BuildRequires:	alsa-lib-devel
BuildRequires:	python-devel
Requires:	tcl(abi) = %{tcl_version}
Provides:	%{realname} = %{version}-%{release}

%description
The Snack Sound Toolkit is designed to be used with a scripting language such 
as Tcl/Tk or Python. Using Snack you can create powerful multi-platform audio 
applications with just a few lines of code. Snack has commands for basic sound 
handling, such as playback, recording, file and socket I/O. Snack also provides 
primitives for sound visualization, e.g. waveforms and spectrograms. It was 
developed mainly to handle digital recordings of speech, but is just as useful 
for general audio. Snack has also successfully been applied to other 
one-dimensional signals. The combination of Snack and a scripting language 
makes it possible to create sound tools and applications with a minimum of 
effort. This is due to the rapid development nature of scripting languages. As 
a bonus you get an application that is cross-platform from start. It is also 
easy to integrate Snack based applications with existing sound analysis 
software.

%package devel
Summary:	Development files for Snack Sound Toolkit
Group:		Development/Libraries
Requires:	%{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains development files for the Snack Sound Toolkit.

%package -n python-%{realname}
Summary:	Python bindings for Snack Sound Toolkit
Group:		System Environment/Libraries
Requires:	%{name}%{?_isa} = %{version}-%{release}

%description -n python-%{realname}
This package contains python bindings for the Snack Sound Toolkit. Tcl, Tk, and
Tkinter are also required to use Snack.

%prep
%setup -q -n %{realname}%{version}
%patch0 -p1 -b .nomp3
%patch1 -p1 -b .extracflags
%patch2 -p1 -b .shared-stubs
%patch3 -p1 -b .newALSA
%patch4 -p1 -b .CVE20126303
%patch5 -p1 -b .format-security
cp %{SOURCE1} .
chmod -x generic/*.c generic/*.h unix/*.c COPYING README demos/python/*
iconv -f iso-8859-1 -t utf-8 -o README{.utf8,}
mv README{.utf8,}
sed -i -e 's|\r||g' demos/python/*.txt

%build
cd unix/
%configure --disable-static --with-tcl=%{_libdir} --with-tk=%{_libdir} --with-ogg-include=%{_includedir} --with-ogg-lib=%{_libdir} --enable-alsa
make %{?_smp_mflags} EXTRACFLAGS="%{optflags}"
cd ../python
%{__python} setup.py build

%install
pushd unix/
make install DESTDIR=%{buildroot}
find %{buildroot} -name '*.la' -exec rm -f {} ';'
popd

pushd python
%{__python} setup.py install --skip-build --root %{buildroot}
install -d %{buildroot}%{tcl_sitearch}
mv %{buildroot}%{_libdir}/%{realname}2.2 %{buildroot}%{tcl_sitearch}/%{realname}2.2
chmod -x %{buildroot}%{tcl_sitearch}/%{realname}2.2/snack.tcl
popd

# Devel bits
mkdir -p %{buildroot}%{_includedir}
install -p generic/*.h %{buildroot}%{_includedir}
install -p unix/snackConfig.sh %{buildroot}%{_libdir}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%doc README
%license COPYING LICENSE-ffa.c.txt
%{_libdir}/libsnackstub2.2.so
%{tcl_sitearch}/%{realname}2.2/

%files devel
%{_includedir}/*.h
%{_libdir}/snackConfig.sh

%files -n python-%{realname}
%doc doc/python-man.html demos/python/
%{python_sitelib}/tkSnack*

%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-29
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Jan 26 2016 Tom Callaway <spot@fedoraproject.org> - 2.2.10-27
- modernize spec file

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.2.10-23
- Changed requires to require tcl-8.6

* Wed May 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.2.10-22
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86

* Mon Dec  9 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-21
- fix format-security issues

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Feb 12 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-18
- remove unlicensed compressed mac file from source tarball
- update license tag to include TCL

* Wed Jan  2 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-17
- apply fix from Michael Karcher to fix CVE-2012-6303 (bz 885893)

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.2.10-13
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jul 22 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-11
- turn alsa back on, /dev/dsp is dead

* Mon Mar 16 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-10
- enable -devel package

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

* Wed Dec 24 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-8
- fix missing BR: libXft-devel

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.2.10-7
- Rebuild for Python 2.6

* Wed Oct 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-6
- disable alsa (bz 463259)

* Mon Sep 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-5
- fix to work with new alsa (from Jeremiah at Myah OS)

* Thu Sep 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-4
- *sigh* hardcoding the tcl version is the only way to get it through the buildsystem

* Wed Sep 17 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-3
- don't hardcode tcl abi version

* Mon Aug  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-2
- add BR: python

* Wed Jun 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-1
- Initial package for Fedora