Blob Blame History Raw
%{!?tcl_version: %define tcl_version %(echo 'puts $tcl_version' | tclsh)}
%{!?tcl_sitearch: %define tcl_sitearch %{_libdir}/tcl%{tcl_version}}
# Data from subversion
%define svnversion 20080505

Name: tkimg
Version: 1.3
Release: 0.10.%{svnversion}svn%{?dist}
Summary: More Image Formats for Tk

Group: Development/Libraries
License: BSD
URL: http://sourceforge.net/projects/tkimg
# The source for this package was pulled from upstream's vcs.  Use the
# following commands to generate the tarball:
# svn export -r 130 https://tkimg.svn.sourceforge.net/svnroot/tkimg/trunk tkimg-20071018
#  tar -czvf tkimg-20071018.tar.gz  tkimg-20071018

# Data from subversion
Source0: %{name}-%{svnversion}.tar.bz2
Patch0: tkimg-build.patch
Patch1: tkimg-systemlibs.patch
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires: tcl-devel tk-devel
BuildRequires: libtiff-devel libpng-devel libjpeg-devel zlib-devel

Requires: tcl(abi) = 8.5

%description
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.

%package devel
Summary: Libraries, includes, etc. used to develop an application with %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: tcl-devel tk-devel
Requires: libtiff-devel libpng-devel libjpeg-devel zlib-devel
%description devel
This are the header files needed to develop a %{name} application

%prep
%setup -q -n %{name}-%{svnversion}
%patch0 -p1
%patch1 -p1

%build
%configure --with-tcl=%{_libdir} --with-tk=%{_libdir} --disable-static \
 --libdir=%{tcl_sitearch}
%{__make} %{?_smp_mflags}

%install
%{__rm} -fr %{buildroot}
%{__make} %{?_smp_mflags} INSTALL_ROOT=%{buildroot} install

# Fixing some permissions
find %{buildroot}/%{tcl_sitearch} -name "*.sh" |xargs chmod 644
find %{buildroot}/%{tcl_sitearch} -name "*.tcl" |xargs chmod 644
find %{buildroot}/%{tcl_sitearch} -name "*.a" |xargs chmod 644
find %{buildroot}/%{tcl_sitearch} -name "*.so" |xargs chmod 755

# Make library links
%{__mv} %{buildroot}/%{tcl_sitearch}/*.sh %{buildroot}/%{_libdir}
for tcllibs in %{buildroot}/%{tcl_sitearch}/Img1.3/*tcl*.so 
do
btcllibs=`basename $tcllibs`
%{__ln_s} %{tcl_sitearch}/Img1.3/$btcllibs %{buildroot}/%{_libdir}/$btcllibs
done

%clean
%{__rm} -fr %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README 
%{_libdir}/*.so
%{tcl_sitearch}/Img1.3
%exclude %{tcl_sitearch}/Img1.3/*.a


%files devel
%doc README 
%{_includedir}/*
%{_libdir}/*.sh
%{tcl_sitearch}/Img1.3/*.a

%changelog
* Mon May 05 2008 Sergio Pascual <sergiopr at fedoraproject.org> - 1.3-0.10.20080505svn
- New upstream source
- Including fooConfig.sh files in -devel 
- Making symlinks of shared libraries in libdir
- Removing file in ld.so.conf.d
- Fixing bug #444872

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.3-0.9.20071018svn
- Autorebuild for GCC 4.3

* Fri Jan 04 2008 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.8.20071018svn
- Following PackagingDrafts/Tcl

* Thu Jan 03 2008 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.7.20071018svn
- Rebuilt for tcl 8.5

* Mon Dec 24 2007 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.6.20071018svn
- Static 'stub' library included in devel subpackage
- Rebuild to fix bug #426683

* Sat Nov 08 2007 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.5.20071018svn
- Build patch simplified

* Mon Oct 29 2007 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.4.20071018svn
- Giving instructions to duplicate my checkout

* Sun Oct 28 2007 Sergio Pascual <sergiopr at fedoraproject.org> 1.3-0.3.20071018svn
- Using dist tag

* Tue Oct 24 2007 Sergio Pascual <sergiopr at fedoraproject.org>  1.3-0.2.20071018svn
- Using external libraries

* Fri Mar 30 2007 Sergio Pascual <sergiopr at fedoraproject.org>  1.3-0.1.20071018svn
- Initial spec file