diff --git a/tcl.attr b/tcl.attr new file mode 100644 index 0000000000000000000000000000000000000000..2d1752dd35886b1b06bb82f52a7990b31671eeff --- /dev/null +++ b/tcl.attr @@ -0,0 +1,19 @@ +%__tcl_path ^(%{_datadir}|%{_libdir})/tcl[[:digit:]]+\\.[[:digit:]]+/.+ + +%__tcl_requires() %{lua: + -- Match buildroot paths of the form + -- /PATH/OF/BUILDROOT/usr/lib(64)/tclMAJOR.MINOR/ and + -- /PATH/OF/BUILDROOT/usr/share/tclMAJOR.MINOR/ + -- generating a line of the form: + -- tcl(abi) = MAJOR.MINOR + local path = rpm.expand('%1') + local datadir = rpm.expand('%_datadir') + local libdir = rpm.expand('%_libdir') + for i, dir in ipairs({datadir, libdir}) do + if path:match(dir .. '/tcl%d+%.%d+/.*') then + local requires = path:gsub('.*' .. dir .. '/tcl(%d+%.%d+)/.*', 'tcl(abi) = %1') + print(requires) + break + end + end +} diff --git a/tcl.spec b/tcl.spec index f580b790aaa546312d015dd1cb37579cd1c79af3..35dd26a44dfc5f9210055a842c811e592c4e9027 100644 --- a/tcl.spec +++ b/tcl.spec @@ -2,13 +2,14 @@ Name: tcl Version: 8.6.16 -Release: 1 +Release: 2 Epoch: 1 Summary: The Tool Command Language implementation License: TCL AND GPL-3.0-or-later WITH bison-exception-2.2 AND BSD-3-Clause URL: https://sourceforge.net/projects/tcl/ Source0: https://downloads.sourceforge.net/sourceforge/tcl/tcl-core%{version}-src.tar.gz Source1: macros.tcl +Source2: tcl.attr BuildRequires: autoconf zlib-devel systemtap-sdt-devel gcc Provides: tcl(abi) = %{MAJOR} @@ -90,6 +91,7 @@ sed -i -e "s|$PWD/unix|%{_libdir}|; s|$PWD|%{_includedir}/%{name}-private|" %{bu rm -rf %{buildroot}/%{_datadir}/%{name}%{MAJOR}/ldAix install -D -m644 %{S:1} %{buildroot}%{_rpmmacrodir}/macros.tcl +install -D -m644 %{S:2} %{buildroot}%{_fileattrsdir}/tcl.attr %check pushd unix @@ -106,6 +108,7 @@ popd %{_libdir}/lib%{name}%{MAJOR}.so %exclude %{_datadir}/%{name}%{MAJOR}/tclAppInit.c %{_rpmmacrodir}/macros.tcl +%{_fileattrsdir}/tcl.attr %files devel %{_includedir}/* @@ -121,6 +124,9 @@ popd %{_mandir}/man?/* %changelog +* Sat Aug 02 2025 Funda Wang - 1:8.6.16-2 +- add tcl.attr to generate 'tcl(abi)' requires automatically + * Wed Dec 25 2024 Funda Wang - 1:8.6.16-1 - update to 8.6.16