+# TODO
+# - why is tclConfig.sh in /usr/lib on lib64 platform?
#
# Conditional build:
+%bcond_with threads
%bcond_without tests # don't perform "make test"
#
+%define major 8.6
+%define minor 6
Summary: Tool Command Language embeddable scripting language, with shared libraries
Summary(fr.UTF-8): Tool Command Language, langage de script avec bibliothèques partagées
Summary(pl.UTF-8): Tool Command Language - język skryptowy z bibliotekami dynamicznymi
Summary(tr.UTF-8): Tcl ile kullanılabilen betik dili
Summary(uk.UTF-8): Tool Command Language - вбудовувана мова скриптів
Name: tcl
-%define major 8.5
-%define minor 0
Version: %{major}.%{minor}
-Release: 2
+Release: 1
License: BSD
Group: Development/Languages/Tcl
-Source0: http://dl.sourceforge.net/tcl/%{name}%{version}-src.tar.gz
-# Source0-md5: d890c505465411b25050b6cd95971d2c
+Source0: http://downloads.sourceforge.net/tcl/%{name}-core%{version}-src.tar.gz
+# Source0-md5: 98ebf13bbd90257e006c219369dd5f67
Source1: %{name}-pl-man-pages.tar.bz2
# Source1-md5: dd3370f2b588763758787831a4bf48fc
Patch0: %{name}-ieee.patch
-Patch1: %{name}-readline.patch
+
Patch2: %{name}-opt.patch
Patch3: %{name}-mannames.patch
Patch4: %{name}-soname_fix.patch
Patch5: %{name}-norpath.patch
Patch6: %{name}-multilib.patch
+Patch7: %{name}-autopath.patch
+Patch8: %{name}-hidden.patch
+Patch9: %{name}-conf.patch
+Patch10: libc-version.patch
URL: http://www.tcl.tk/
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.59
BuildRequires: ncurses-devel >= 5.2
-BuildRequires: readline-devel >= 4.2
Requires: tzdata
+Provides: tcl(abi) = %{major}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _ulibdir /usr/lib
%prep
%setup -q -n %{name}%{version}
%patch0 -p1
-%patch1 -p1
+
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
%build
+%if %{with threads}
# Make sure we have /proc mounted - otherwise pthread_getattr_np will fail
# https://sourceforge.net/tracker/index.php?func=detail&aid=1815573&group_id=10894&atid=110894
if [ ! -r /proc/self/maps ]; then
- echo "You need to have /proc mounted in order to build this package!"
- exit 1
+ echo "You need to have /proc mounted in order to build this package!"
+ exit 1
fi
+%endif
cd unix
-sed -i -e "s/^CFLAGS_OPTIMIZE.*/CFLAGS_OPTIMIZE=%{rpmcflags} -D__NO_STRING_INLINES -D__NO_MATH_INLINES -D_REENTRANT/" \
- Makefile.in
%{__autoconf}
%configure \
+ OPTFLAGS="%{rpmcflags} %{rpmcppflags}" \
--enable-langinfo \
--enable-shared \
- --enable-threads \
+ --%{?with_threads:en}%{!?with_threads:dis}able-threads \
--enable-64bit \
- --enable-gcc \
--without-tzdata
-%{__make} \
- TCL_PACKAGE_PATH="%{_libdir} %{_libdir}/tcl%{major} %{_ulibdir} %{_ulibdir}/tcl%{major}"
+%{__make}
-sed -i -e "s#%{_builddir}/%{name}%{version}%{rel}/unix#%{_libdir}#; \
- s#%{_builddir}/%{name}%{version}%{rel}#%{_includedir}/tcl-private#" tclConfig.sh
+cp -a tclConfig.sh tclConfig.sh-orig
+sed -i -e "s#%{_builddir}/%{name}%{version}/unix#%{_libdir}#; \
+ s#%{_builddir}/%{name}%{version}#%{_includedir}/tcl-private#" tclConfig.sh
+if cmp -s tclConfig.sh tclConfig.sh-orig; then
+ echo "tclConfig.sh fix rule didn't change anything. Please verify it."
+fi
%if %{with tests}
# tests that are problematic on builders; some probably could be fixed
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_prefix},%{_mandir}/man1}
+install -d $RPM_BUILD_ROOT{%{_datadir}/tcl%{major},%{_prefix},%{_mandir}/man1}
%{__make} -C unix install \
INSTALL_ROOT=$RPM_BUILD_ROOT \
- TCL_PACKAGE_PATH="%{_libdir} %{_libdir}/tcl%{major} %{_ulibdir} %{_ulibdir}/tcl%{major}" \
MAN_INSTALL_DIR=$RPM_BUILD_ROOT%{_mandir}
+# avoid Tcl_SetObjLength called with shared object error
+# http://www.mail-archive.com/pld-devel-en@lists.pld-linux.org/msg05239.html
+sed -i -e '/set auto_index(history)/s,^,#&,' $RPM_BUILD_ROOT%{_ulibdir}/tcl%{major}/tclIndex
+
install -d $RPM_BUILD_ROOT%{_includedir}/%{name}-private/{generic,unix}
-find generic unix -name "*.h" -exec cp -p '{}' $RPM_BUILD_ROOT%{_includedir}/%{name}-private/'{}' ';'
+find generic unix -name '*.h' -exec cp -p '{}' $RPM_BUILD_ROOT%{_includedir}/%{name}-private/'{}' ';'
for h in $RPM_BUILD_ROOT%{_includedir}/*.h; do
rh=$(basename "$h")
if [ -f "$RPM_BUILD_ROOT%{_includedir}/%{name}-private/generic/$rh" ]; then
ln -sf libtcl%{major}.so.0.0 $RPM_BUILD_ROOT%{_libdir}/libtcl.so
ln -sf libtcl%{major}.so.0.0 $RPM_BUILD_ROOT%{_libdir}/libtcl%{major}.so
+ln -sf libtcl%{major}.so.0.0 $RPM_BUILD_ROOT%{_libdir}/libtcl%{major}.so.0
mv -f $RPM_BUILD_ROOT%{_bindir}/tclsh%{major} $RPM_BUILD_ROOT%{_bindir}/tclsh
%{?have_ulibdir:mv $RPM_BUILD_ROOT%{_libdir}/tclConfig.sh $RPM_BUILD_ROOT%{_ulibdir}/tclConfig.sh}
+%{?have_ulibdir:mv $RPM_BUILD_ROOT%{_libdir}/tclooConfig.sh $RPM_BUILD_ROOT%{_ulibdir}/tclooConfig.sh}
bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/lib*.so.*.*
+%attr(755,root,root) %{_libdir}/libtcl%{major}.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libtcl%{major}.so.0
%{?have_ulibdir:%dir %{_libdir}/tcl%{major}}
+%dir %{_datadir}/tcl%{major}
%{_ulibdir}/tcl[0-9]
%dir %{_ulibdir}/tcl%{major}
%{_ulibdir}/tcl%{major}/*.tcl
%{_ulibdir}/tcl%{major}/encoding
%{_ulibdir}/tcl%{major}/http1.0
-%{_ulibdir}/tcl%{major}/ldAix
+%{_ulibdir}/tcl%{major}/opt0.4
+%{_ulibdir}/tcl%{major}/tclIndex
+
%dir %{_ulibdir}/tcl%{major}/msgs
%lang(af) %{_ulibdir}/tcl%{major}/msgs/af.msg
%lang(af_ZA) %{_ulibdir}/tcl%{major}/msgs/af_za.msg
%lang(zh_HK) %{_ulibdir}/tcl%{major}/msgs/zh_hk.msg
%lang(zh_SG) %{_ulibdir}/tcl%{major}/msgs/zh_sg.msg
%lang(zh_TW) %{_ulibdir}/tcl%{major}/msgs/zh_tw.msg
-%{_ulibdir}/tcl%{major}/opt0.4
-%{_ulibdir}/tcl%{major}/tclAppInit.c
-%{_ulibdir}/tcl%{major}/tclIndex
-%{_mandir}/man1/*
-%lang(pl) %{_mandir}/pl/man1/*
+
+%{_mandir}/man1/tclsh.1*
+%lang(pl) %{_mandir}/pl/man1/tclsh.1*
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_ulibdir}/tclConfig.sh
-%attr(755,root,root) %{_libdir}/lib*.so
+%attr(755,root,root) %{_ulibdir}/tclooConfig.sh
+%{_ulibdir}/tcl%{major}/tclAppInit.c
+%attr(755,root,root) %{_libdir}/libtcl%{major}.so
+%attr(755,root,root) %{_libdir}/libtcl.so
%{_libdir}/libtclstub%{major}.a
-%{_includedir}/*
-%{_mandir}/man[3n]/*
-%lang(pl) %{_mandir}/pl/mann/*
+%{_includedir}/tcl*.h
+%{_includedir}/tcl-private
+%{_pkgconfigdir}/tcl.pc
+%{_mandir}/man3/TCL_*.3*
+%{_mandir}/man3/Tcl_*.3*
+%{_mandir}/man3/attemptck*alloc.3*
+%{_mandir}/man3/ck*.3*
+%{_mandir}/mann/*.n*
+%lang(pl) %{_mandir}/pl/mann/*.n*