File iwidgets.spec of Package iwidgets

#
# spec file for package iwidgets
#
# Copyright (c) 2011 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/
#

Name:           iwidgets
BuildRequires:  autoconf
BuildRequires:  tcl
Version:        4.0.1
Release:        0
Source0:        %name%version.tar.bz2
Patch0:         %name%version.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Summary:        Widget Extension for Tcl/Tk
License:        MIT
Group:          Development/Languages/Tcl
Requires:       itk

%description
[incr Widgets] is an object-oriented mega-widget set that extends
Tcl/Tk and is based on [incr Tcl] and [incr Tk].  This set of
mega-widgets delivers many new, general purpose widgets like option
menus, comboboxes, selection boxes, and various dialogs whose
counterparts are found in Motif and Windows. Since [incr Widgets] is
based on the [incr Tk] extension, the Tk framework of configuration
options, widget commands, and default bindings is maintained.  In other
words, each [incr Widgets] mega-widget seamlessly blends with the
standard Tk widgets. They look, act, and feel like Tk widgets. In
addition, all [incr Widgets] mega-widgets are object oriented and may
themselves be extended, using either inheritance or composition.


%prep
%setup -q -n %name%version
%patch0

%build
autoconf
%configure --with-tcl=%_libdir --with-tk=%_libdir
make

%install
rm -rf %buildroot
make install \
	INSTALL=/usr/bin/install \
	MKINSTALLDIRS="mkdir -p" \
	INSTALL_ROOT=%buildroot \
	MAN_INSTALL_DIR='$(INSTALL_ROOT)%_mandir/mann' \
	SCRIPT_INSTALL_DIR=%buildroot%tclscriptdir/%name%version
# Put the right path to wish into the iwidget demos,
# and fix the permissions.
for f in $(find %buildroot%_prefix/lib/%name%version/demos %buildroot%tclscriptdir/%name%version/demos -type f); do
    if test -x $f && grep 'package require Iwidgets' $f > /dev/null; then
        ( echo '#!/usr/bin/wish'; cat $f ) > $f.new
        mv $f.new $f
        chmod a+x $f
    else
        chmod a-x $f
    fi
done

%clean
rm -rf %buildroot

%files
%defattr(-,root,root,-)
%doc CHANGES ChangeLog README
%doc %_mandir/mann/*
%tclscriptdir/%name%version

%changelog
openSUSE Build Service is sponsored by