File tkimg.spec of Package tkimg

# spec file for package tkimg
# 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

Name:           tkimg
BuildRequires:  autoconf
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  tk-devel
BuildRequires:  xorg-x11-devel
Summary:        More Image Formats for Tk
License:        BSD-3-Clause
Group:          Development/Libraries/Tcl
Version:        1.3
Release:        0
Source0:        %{name}%{version}.tar.bz2
Patch0:         %name.patch
Patch1:         %name-syslibs.patch
Patch2:         %name-makedeps.patch
Patch3:         %name-warnings.patch
Patch4:         tkimg-CVE-2008-0553.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains a collection of image format handlers for the Tk
photo image type, and a new image type, pixmaps.

The provided format handlers include bmp, gif, ico, jpeg, pcx, png,
ppm, ps, sgi, sun, tga, tiff, xbm, and xpm.

    Jan Nijtmans <>
    Andreas Kupries <>

%setup -q -n %name%{version}

for f in $(find -type d); do
	pushd $f
	test -f && autoconf --force
export CFLAGS="$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing "
./configure \
        --prefix=%_prefix \
        --libdir=%_libdir \
        --mandir=%_mandir \
        --with-tcl=%_libdir \
make test

mkdir -p %buildroot%tclscriptdir
make install DESTDIR=%buildroot INSTALL_ROOT=%buildroot
mv %buildroot%_libdir/Img%version/lib* %buildroot%_libdir
mv %buildroot%_libdir/Img%version %buildroot%tclscriptdir
sed -i 's/\[file join $dir \([^]]*\)\]/\1/' \
mkdir -p %buildroot/%_mandir/mann
pushd doc/man
for f in *.n; do
	fgrep -v ".so man.macros" $f > %buildroot/%_mandir/mann/$f

rm -rf %buildroot

%doc ANNOUNCE ChangeLog README Reorganization.Notes.txt
%doc changes license.terms doc/html demo
%doc %_mandir/*/*