267b1c2
# We used to define this dynamically, but the Fedora buildsystem chokes on
267b1c2
# using this for the versioned Requires on tcl(abi), so we hardcode it.
267b1c2
# This sucks, but there is no other clean way around it, because tcl
267b1c2
# (and tclsh) aren't in the default buildroot.
e33a5e9
%{!?tcl_version: %global tcl_version 8.6}
e33a5e9
%{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}}
e33a5e9
%global realname snack
1033bc6
1033bc6
Name:		tcl-%{realname}
1033bc6
Version:	2.2.10
a861fb9
Release:	59%{?dist}
1033bc6
Summary:	Sound toolkit
9b11f73
# generic/snackDecls.h, generic/snackStubInit.c and generic/snackStubLib.c 
9b11f73
# are under the TCL "license.terms", a copy of which can be found in the tcl package.
a861fb9
# SnackMpg.c just says "BSD" so we pick the most common one. :P
a861fb9
License:	GPL-2.0-or-later AND TCL AND BSD-3-Clause
1033bc6
URL:		http://www.speech.kth.se/snack/
1033bc6
# The upstream source has two files which implement MP3 decoding.
1033bc6
# ./generic/jkFormatMP3.c and ./generic/jkFormatMP3.h
bb8f236
# Those files are non-free so we cannot ship that code, thus, the modified tarball.
bb8f236
# We implement MP3 support the same way that Debian does (libsnackmpg)
9b11f73
# Also, mac/snack.mcp.sit.hqx is a mysterious old compressed file with no clear license.
9b11f73
# It is removed.
1033bc6
# Upstream source can be found here: http://www.speech.kth.se/snack/dist/snack2.2.10.tar.gz
1033bc6
Source0:	%{realname}%{version}-nomp3.tar.gz
cb17285
# License confirmation email for generic/ffa.c
cb17285
Source1:	LICENSE-ffa.c.txt
bb8f236
# Copied from debian sources
bb8f236
Source2:	SnackMpg.c
bb8f236
Patch0:		snack2.2.10-mpg123.patch
1033bc6
Patch1:		snack2.2.10-extracflags.patch
653e74b
Patch3:		snack2.2.10-newALSA.patch
833921d
Patch4:		tcl-snack-2.2.10-CVE-2012-6303-fix.patch
683715a
Patch5:		snack2.2.10-format-security.patch
bb8f236
# Credit to Sergei Golovan, patches taken from Debian
82ab75a
Patch6:		tcl-snack-2.2.10-python3.patch
bb8f236
Patch7:		snack2.2.10-seektell-fix.patch
130402c
Patch8:		tcl-snack-configure-c99.patch
130402c
Patch9:		tcl-snack-sigproc2-c99.patch
f2b9b58
# Do not use obsolete distutils
f2b9b58
Patch10:	snack2.2.10-python3-setuptools.patch
a861fb9
Patch11:	snack2.2.10-const-fix.patch
a861fb9
BuildRequires:	make
a861fb9
BuildRequires:	gcc-c++
3aedfa1
BuildRequires:	tcl-devel, tk-devel, libogg-devel, libvorbis-devel
941a64d
BuildRequires:	libXft-devel
d2eea42
BuildRequires:	alsa-lib-devel
ffea3de
BuildRequires:	python3-devel, python3-setuptools
bb8f236
BuildRequires:	mpg123-devel
f26d632
Requires:	tcl(abi) = %{tcl_version}
1033bc6
Provides:	%{realname} = %{version}-%{release}
1033bc6
1033bc6
%description
1033bc6
The Snack Sound Toolkit is designed to be used with a scripting language such 
1033bc6
as Tcl/Tk or Python. Using Snack you can create powerful multi-platform audio 
1033bc6
applications with just a few lines of code. Snack has commands for basic sound 
1033bc6
handling, such as playback, recording, file and socket I/O. Snack also provides 
1033bc6
primitives for sound visualization, e.g. waveforms and spectrograms. It was 
1033bc6
developed mainly to handle digital recordings of speech, but is just as useful 
1033bc6
for general audio. Snack has also successfully been applied to other 
1033bc6
one-dimensional signals. The combination of Snack and a scripting language 
1033bc6
makes it possible to create sound tools and applications with a minimum of 
1033bc6
effort. This is due to the rapid development nature of scripting languages. As 
1033bc6
a bonus you get an application that is cross-platform from start. It is also 
1033bc6
easy to integrate Snack based applications with existing sound analysis 
1033bc6
software.
1033bc6
0c7bec8
%package devel
0c7bec8
Summary:	Development files for Snack Sound Toolkit
e33a5e9
Requires:	%{name}%{?_isa} = %{version}-%{release}
0c7bec8
0c7bec8
%description devel
0c7bec8
This package contains development files for the Snack Sound Toolkit.
0c7bec8
82ab75a
%package -n python3-%{realname}
82ab75a
%{?python_provide:%python_provide python3-%{realname}}
82ab75a
%{?python_provide:%python_provide python3-tcl-snack}
1033bc6
Summary:	Python bindings for Snack Sound Toolkit
e33a5e9
Requires:	%{name}%{?_isa} = %{version}-%{release}
1033bc6
82ab75a
%description -n python3-%{realname}
82ab75a
This package contains python3 bindings for the Snack Sound Toolkit. Tcl, Tk, and
1033bc6
Tkinter are also required to use Snack.
1033bc6
1033bc6
%prep
1033bc6
%setup -q -n %{realname}%{version}
a861fb9
%patch -P0 -p1 -b .mpg123
a861fb9
%patch -P1 -p1 -b .extracflags
a861fb9
%patch -P3 -p1 -b .newALSA
a861fb9
%patch -P4 -p1 -b .CVE20126303
a861fb9
%patch -P5 -p1 -b .format-security
a861fb9
%patch -P6 -p1 -b .py3
a861fb9
%patch -P7 -p1 -b .seektell
a861fb9
%patch -P8 -p1 -b .configure-c99
a861fb9
%patch -P9 -p1 -b .sigproc2-c99
a861fb9
%patch -P10 -p1 -b .setuptools
a861fb9
%patch -P11 -p1 -b .const-fix
cb17285
cp %{SOURCE1} .
bb8f236
cp %{SOURCE2} generic/
1033bc6
chmod -x generic/*.c generic/*.h unix/*.c COPYING README demos/python/*
1033bc6
iconv -f iso-8859-1 -t utf-8 -o README{.utf8,}
1033bc6
mv README{.utf8,}
1033bc6
sed -i -e 's|\r||g' demos/python/*.txt
1033bc6
1033bc6
%build
1033bc6
cd unix/
d2eea42
%configure --disable-static --with-tcl=%{_libdir} --with-tk=%{_libdir} --with-ogg-include=%{_includedir} --with-ogg-lib=%{_libdir} --enable-alsa
bb8f236
make %{?_smp_mflags} EXTRACFLAGS="%{optflags}" stublib all libsnackogg.so libsnackmpg.so
1033bc6
cd ../python
82ab75a
%{__python3} setup.py build
1033bc6
1033bc6
%install
0c7bec8
pushd unix/
1033bc6
make install DESTDIR=%{buildroot}
1033bc6
find %{buildroot} -name '*.la' -exec rm -f {} ';'
0c7bec8
popd
0c7bec8
0c7bec8
pushd python
82ab75a
%{__python3} setup.py install --skip-build --root %{buildroot}
1033bc6
install -d %{buildroot}%{tcl_sitearch}
1033bc6
mv %{buildroot}%{_libdir}/%{realname}2.2 %{buildroot}%{tcl_sitearch}/%{realname}2.2
1033bc6
chmod -x %{buildroot}%{tcl_sitearch}/%{realname}2.2/snack.tcl
0c7bec8
popd
0c7bec8
0c7bec8
# Devel bits
0c7bec8
mkdir -p %{buildroot}%{_includedir}
0c7bec8
install -p generic/*.h %{buildroot}%{_includedir}
0c7bec8
install -p unix/snackConfig.sh %{buildroot}%{_libdir}
1033bc6
bb8f236
%filter_from_requires /libsnackstub2.2.so/d
bb8f236
26fca2e
%ldconfig_scriptlets
1033bc6
1033bc6
%files
e33a5e9
%doc README
e33a5e9
%license COPYING LICENSE-ffa.c.txt
1033bc6
%{tcl_sitearch}/%{realname}2.2/
bb8f236
# %%{_libdir}/libsnackstub*.so
1033bc6
0c7bec8
%files devel
0c7bec8
%{_includedir}/*.h
bb8f236
%{_libdir}/libsnackstub2.2.a
0c7bec8
%{_libdir}/snackConfig.sh
0c7bec8
82ab75a
%files -n python3-%{realname}
1033bc6
%doc doc/python-man.html demos/python/
82ab75a
%{python3_sitelib}/tkSnack*
82ab75a
%{python3_sitelib}/__pycache__/tkSnack*
1033bc6
1033bc6
%changelog
a861fb9
* Sat Feb 10 2024 Tom Callaway <spot@fedoraproject.org> - 2.2.10-59
a861fb9
- fix FTBFS
a861fb9
02525cf
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-58
02525cf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
02525cf
f1ade31
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-57
f1ade31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
f1ade31
b6ac8eb
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.2.10-56
b6ac8eb
- Rebuilt for Python 3.12
b6ac8eb
8054697
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-55
8054697
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
8054697
f2b9b58
* Fri Dec 30 2022 Tom Callaway <spot@fedoraproject.org> 2.2.10-54
f2b9b58
- use setuptools instead of obsolete distutils (#2154978)
f2b9b58
130402c
* Fri Nov 18 2022 Florian Weimer <fweimer@redhat.com> - 2.2.10-53
130402c
- Fixes for building in strict C99 mode (#2143895)
130402c
6150df5
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-52
6150df5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
6150df5
537339b
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.2.10-51
537339b
- Rebuilt for Python 3.11
537339b
11f21e2
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-50
11f21e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
11f21e2
aa24b11
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-49
aa24b11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
aa24b11
3171f5c
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.2.10-48
3171f5c
- Rebuilt for Python 3.10
3171f5c
c41d180
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-47
c41d180
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c41d180
f2c043a
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-46
f2c043a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f2c043a
ccc960f
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.2.10-45
ccc960f
- Rebuilt for Python 3.9
ccc960f
a663c98
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-44
a663c98
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a663c98
b514506
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.10-43
b514506
- Rebuilt for Python 3.8.0rc1 (#1748018)
b514506
60ca422
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.10-42
60ca422
- Rebuilt for Python 3.8
60ca422
bb8f236
* Tue Jul 30 2019 Tom Callaway <spot@fedoraproject.org> - 2.2.10-41
bb8f236
- enable mp3 support the same way debian does
bb8f236
- fix issue where code tries to use old seektell
bb8f236
- disable sharedstubs, it does not work
bb8f236
de826c1
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-40
de826c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
de826c1
82b39b9
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-39
82b39b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
82b39b9
82ab75a
* Thu Oct  4 2018 Tom Callaway <spot@fedoraproject.org> - 2.2.10-38
82ab75a
- move to python3
82ab75a
31cd8ab
* Mon Jul 23 2018 Tom Callaway <spot@fedoraproject.org> - 2.2.10-37
31cd8ab
- fix FTBFS
31cd8ab
dc8a29e
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-36
dc8a29e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
dc8a29e
01ea6ca
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.2.10-35
01ea6ca
- Update Python 2 dependency declarations to new packaging standards
01ea6ca
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
01ea6ca
14842b4
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-34
14842b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
14842b4
6c52a75
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.10-33
6c52a75
- Python 2 binary package renamed to python2-tcl-snack
6c52a75
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
6c52a75
d69df35
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-32
d69df35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
d69df35
55e7870
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-31
55e7870
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
55e7870
cb1f595
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-30
cb1f595
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cb1f595
3f88508
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-29
3f88508
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
3f88508
f60aca5
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.10-28
f60aca5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f60aca5
e33a5e9
* Tue Jan 26 2016 Tom Callaway <spot@fedoraproject.org> - 2.2.10-27
e33a5e9
- modernize spec file
e33a5e9
0b89594
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-26
0b89594
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
0b89594
394629b
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-25
394629b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
394629b
c724608
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-24
c724608
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c724608
c74fbc5
* Wed May 28 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.2.10-23
c74fbc5
- Changed requires to require tcl-8.6
c74fbc5
c63f26e
* Wed May 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.2.10-22
c63f26e
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86
c63f26e
683715a
* Mon Dec  9 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-21
683715a
- fix format-security issues
683715a
b615a74
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-20
b615a74
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
b615a74
9b11f73
* Tue Feb 12 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-18
9b11f73
- remove unlicensed compressed mac file from source tarball
9b11f73
- update license tag to include TCL
9b11f73
833921d
* Wed Jan  2 2013 Tom Callaway <spot@fedoraproject.org> - 2.2.10-17
833921d
- apply fix from Michael Karcher to fix CVE-2012-6303 (bz 885893)
833921d
cf5d846
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-16
cf5d846
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cf5d846
2012cab
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-15
2012cab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2012cab
c3e37a4
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-14
c3e37a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c3e37a4
725a943
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 2.2.10-13
725a943
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
725a943
c9d1939
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-12
c9d1939
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c9d1939
d2eea42
* Wed Jul 22 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-11
d2eea42
- turn alsa back on, /dev/dsp is dead
d2eea42
0c7bec8
* Mon Mar 16 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-10
0c7bec8
- enable -devel package
0c7bec8
64c120c
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.10-9
64c120c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
64c120c
941a64d
* Wed Dec 24 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2.10-8
941a64d
- fix missing BR: libXft-devel
941a64d
c307237
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.2.10-7
c307237
- Rebuild for Python 2.6
c307237
3aedfa1
* Wed Oct 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-6
3aedfa1
- disable alsa (bz 463259)
3aedfa1
653e74b
* Mon Sep 22 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-5
653e74b
- fix to work with new alsa (from Jeremiah at Myah OS)
653e74b
267b1c2
* Thu Sep 18 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-4
267b1c2
- *sigh* hardcoding the tcl version is the only way to get it through the buildsystem
267b1c2
f26d632
* Wed Sep 17 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-3
f26d632
- don't hardcode tcl abi version
f26d632
1033bc6
* Mon Aug  4 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-2
1033bc6
- add BR: python
1033bc6
1033bc6
* Wed Jun 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.2.10-1
1033bc6
- Initial package for Fedora
1033bc6