Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > e5875a7ff455964c949c629c71f117cf > files > 1

mingw32-tk-8.5.9-1.fc13.src.rpm

%global __strip %{_mingw32_strip}
%global __objdump %{_mingw32_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{_mingw32_findrequires}
%global __find_provides %{_mingw32_findprovides}

%global majorver1 8
%global majorver2 5
%global majorver %{majorver1}.%{majorver2}
%global vers %{majorver}.9

%global name1 tk

Summary:   MinGW Windows graphical toolkit for the Tcl scripting language
Name:      mingw32-%{name1}
Version:   %{vers}
Release:   1%{?dist}
License:   TCL
Group:     Development/Languages
URL:       http://tcl.sourceforge.net/
Source0:   http://downloads.sourceforge.net/sourceforge/tcl/%{name1}%{version}-src.tar.gz
Patch1:    tk8.5-make.patch
Patch2:    tk8.5-conf.patch
# this patch isn't needed since tk8.6b1
Patch3:    tk-seg_input.patch
Patch4:    tk-8.5.6-mingw32.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Buildrequires: autoconf
BuildRequires: file
BuildRequires: m4
BuildRequires: net-tools
BuildRequires: mingw32-tcl
BuildRequires: mingw32-filesystem
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: mingw32-cpp
BuildRequires: mingw32-runtime
BuildRequires: mingw32-w32api
BuildArch: noarch

%description
When paired with the Tcl scripting language, Tk provides a fast and powerful
way to create cross-platform GUI applications.

%prep
%setup -q -n %{name1}%{version}
iconv -f iso-8859-1 -t utf-8 changes > changes.utf8
touch -r changes changes.utf8
mv changes.utf8 changes

%patch1 -p1 -b .make
%patch2 -p1 -b .conf
%patch3 -p1 -b .seg
%patch4 -p1 -b .mingw32

%build
pushd win
autoconf
%{_mingw32_configure} --with-tcl=%{_mingw32_libdir}/tcl%{majorver} 
# builds fail sometimes with %%{?_smp_mflags}, so don't use
sed -i -e 's,mingw32-tcl,tcl,g' Makefile
sed -i -e 's,/usr/include,%{_mingw32_includedir},g' Makefile
sed -i -e 's,libtclstub85.a,libtclstub85.dll.a,g' Makefile
sed -i -e 's,tcl8.5/libtclstub85,libtclstub85,g' Makefile
sed -i -e 's,libtcl85.a,libtcl85.dll.a,g' Makefile
sed -i -e 's,tcl8.5/libtcl85,libtcl85,g' Makefile
make TCL_LIBRARY=%{_mingw32_datadir}/%{name1}%{majorver}
popd

%install
rm -rf $RPM_BUILD_ROOT
make install -C win INSTALL_ROOT=$RPM_BUILD_ROOT TK_LIBRARY=%{_mingw32_datadir}/%{name1}%{majorver}

pushd $RPM_BUILD_ROOT%{_mingw32_bindir}
ln -s wish%{majorver1}%{majorver2}.exe wish.exe
popd

mv $RPM_BUILD_ROOT%{_mingw32_libdir}/lib%{name1}%{majorver1}%{majorver2}.a \
   $RPM_BUILD_ROOT%{_mingw32_libdir}/lib%{name1}%{majorver1}%{majorver2}.dll.a
mv $RPM_BUILD_ROOT%{_mingw32_libdir}/lib%{name1}stub%{majorver1}%{majorver2}.a \
   $RPM_BUILD_ROOT%{_mingw32_libdir}/lib%{name1}stub%{majorver1}%{majorver2}.dll.a

# for linking with -lib%%{name1}
ln -s lib%{name1}%{majorver1}%{majorver2}.dll.a \
      $RPM_BUILD_ROOT%{_mingw32_libdir}/lib%{name1}.dll.a

mkdir -p $RPM_BUILD_ROOT/%{_mingw32_libdir}/%{name1}%{majorver}

# postgresql and maybe other packages too need tclConfig.sh
# paths don't look at /usr/lib for efficiency, so we symlink into tcl8.5 for now
ln -s %{_mingw32_libdir}/%{name1}Config.sh \
      $RPM_BUILD_ROOT/%{_mingw32_libdir}/%{name1}%{majorver}/%{name1}Config.sh

mkdir -p $RPM_BUILD_ROOT/%{_mingw32_includedir}/%{name1}-private/{generic,win}
find generic win -name "*.h" -exec cp -p '{}' $RPM_BUILD_ROOT/%{_mingw32_includedir}/%{name1}-private/'{}' ';'
( cd $RPM_BUILD_ROOT/%{_mingw32_includedir}
     for i in *.h ; do
         [ -f $RPM_BUILD_ROOT/%{_mingw32_includedir}/%{name1}-private/generic/$i ] && \
         ln -sf ../../$i $RPM_BUILD_ROOT/%{_mingw32_includedir}/%{name1}-private/generic ;
     done
) || true

# fix executable bits
chmod a-x $RPM_BUILD_ROOT/%{_mingw32_libdir}/*/pkgIndex.tcl

# remove buildroot traces
sed -i -e "s|$PWD/win|%{_libdir}|; s|$PWD|%{_includedir}/%{name}-private|" $RPM_BUILD_ROOT/%{_mingw32_libdir}/%{name1}Config.sh
rm -rf $RPM_BUILD_ROOT/%{_mingw32_datadir}/%{name1}%{majorver}/tclAppInit.c
rm -rf $RPM_BUILD_ROOT/%{_mingw32_datadir}/%{name1}%{majorver}/ldAix

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_mingw32_bindir}/wish*
%{_mingw32_bindir}/%{name1}%{majorver1}%{majorver2}.dll
%{_mingw32_libdir}/lib%{name1}%{majorver1}%{majorver2}.dll.a
%{_mingw32_libdir}/lib%{name1}stub%{majorver1}%{majorver2}.dll.a
%{_mingw32_libdir}/lib%{name1}.dll.a
%{_mingw32_libdir}/%{name1}Config.sh
%{_mingw32_includedir}/*
%{_mingw32_libdir}/%{name1}%{majorver}/
%{_mingw32_datadir}/%{name1}%{majorver1}.%{majorver2}
%doc README changes 
%doc license.terms

%changelog
* Sun Dec 19 2010 Paulo Roma <roma@lcg.ufrj.br> - 8.5.9-1
- Update to 8.5.9 to match rawhide.
- Converted changes to utf8.
- Fixed wish symbolic link.

* Tue Oct 20 2009 Paulo Roma <roma@lcg.ufrj.br> - 8.5.7-5.1
- Copy from native