File tklib.spec of Package tklib

#
# spec file for package tklib
#
# Copyright (c) 2024 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           tklib
BuildRequires:  tcl-devel
Url:            https://core.tcl.tk/tklib/home
Summary:        A companion to Tcllib, for Tk related packages
Version:        0.8
Release:        1
License:        TCL
Group:          Development/Libraries/Tcl

Source0:        %{name}-%{version}.tar.gz
Source1:		%{name}-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:		tcl >= 8.3.1
BuildRequires:	tcl >= 8.3.1
BuildArchitectures: noarch

%description
Tklib, the Tk Standard Library is a collection of Tcl packages
that provide utility functions useful to a large collection of Tk
programmers.
The home web site for this code is http://core.tcl.tk/tklib/.
At this web site, you will find mailing lists, web forums, databases
for bug reports and feature requests, the CVS repository (browsable
on the web, or read-only accessible via CVS ), and more.
Also grab source tarball for more documentation, examples, ...

%prep
%setup -q

for f in $(grep -lR "bin/env tclsh" .); do sed -i 's/\/usr\/bin\/env tclsh/\/usr\/bin\/tclsh/g' $f; done

chmod -x examples/plotchart/tcllogo.gif

%build
%configure
# sed -i 's/.$//' modules/plotchart/plotcombined.tcl
make

%install
tclsh ./installer.tcl -no-html \
     -app-path   %{buildroot}/%{_bindir} \
     -pkg-path   %{buildroot}/%{_datadir}/tcl/%{name}%{version} \
     -example-path %{buildroot}/%{_datadir}/tcl/%{name}%{version}/examples \
     -nroff-path %{buildroot}/%{_mandir}/mann \
     -no-wait -no-gui
    
# For some reason. all examples do not get installed.
# cp -rp examples %{buildroot}/%{_datadir}/tcl/%{name}%{version}

# Modules and docs are not executable
find %{buildroot}/%{_datadir}/tcl/%{name}%{version} -type f -exec chmod a=r {} \;
find %{buildroot}/%{_mandir}/mann -type f -exec chmod a=r {} \;

# Make examples executable
find %{buildroot}/%{_datadir}/tcl/%{name}%{version}/examples -type f -name \*.tcl -exec chmod a+x {} \;

%files
%defattr(-,root,root)
%doc license.terms README ChangeLog
%doc support/releases/history/README-*
%_datadir/tcl
%_bindir/*
%doc examples
%doc %_mandir/mann/*

%changelog
* Tue Sep 11 2017 roger.oberholtzer@gmail.com
- New package: tklib - a companion to Tcllib, for Tk related packages. 
openSUSE Build Service is sponsored by