%{!?tcl_version: %define tcl_version %(echo 'puts $tcl_version' | tclsh)}
%{!?tcl_sitearch: %define tcl_sitearch %{_libdir}/tcl%{tcl_version}}
%{!?tcl_sitelib: %define tcl_sitelib %{_datadir}/tcl%{tcl_version}}
%define realname tclxml
Summary: XML parsing library for the Tcl scripting language
Name: tcl-%{realname}
Version: 3.2
Release: 6%{?dist}
License: BSD
Group: Development/Libraries
URL: http://tclxml.sourceforge.net/
Source0: http://downloads.sourceforge.net/tclxml/tclxml-%{version}.tar.gz
Source1: pkgIndex.tcl.in.gui
Patch0: tclxml-3.2-sgmlparser.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: tcl-devel libxml2-devel libxslt-devel
Obsoletes: tclxml < 3.2
Obsoletes: tclxml-devel < 3.2
Obsoletes: tclxml-libxml2 < 3.2
Obsoletes: tclxml-expat < 3.2
Obsoletes: tcldom < 3.2
Obsoletes: tcldom-devel < 3.2
Obsoletes: tcldom-expat < 3.2
Obsoletes: tcldom-libxml2 < 3.2
Provides: tclxml = %{version}-%{release}
Provides: tcldom = %{version}-%{release}
Provides: tclxslt = %{version}-%{release}
Requires: tcl(abi) = 8.5 tcllib
%description
TclXML is a package that provides XML, DOM, and XSLT parsing for the
Tcl scripting language.
%package devel
Summary: Development files for the tclxml packages
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Provides: tclxml-devel = %{version}-%{release}
Provides: tcldom-devel = %{version}-%{release}
%description devel
Development header files for the tclxml packages. This includes all of the
header files for the tclxml, tcldom, and tclxslt packages
%package gui
Summary: UI widgets for manipulating a DOM tree
Group: Development/Libraries
Requires: %{name} = %{version}-%{release} bwidget
Obsoletes: tcldom-gui = %{version}-%{release}
Provides: tcldom-gui = %{version}-%{release}
%description gui
This package provides some useful widgets for manipulating a DOM tree.
%prep
%setup -q -n %{realname}-%{version}
%patch0 -p1
# Fix a few spurious execute permissions
chmod -x ChangeLog doc/xsltsl/cmp.xsl *.c
# Clean up some DOS line endings
sed -i -e 's/\r//' doc/README.xml.in
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{tcl_sitearch}
mv $RPM_BUILD_ROOT%{_libdir}/Tclxml%{version} $RPM_BUILD_ROOT%{tcl_sitearch}/%{realname}-%{version}
chmod a-x $RPM_BUILD_ROOT%{tcl_sitearch}/%{realname}-%{version}/*.a
# Install the examples in a -gui subpackage
install -d $RPM_BUILD_ROOT%{tcl_sitelib}/%{realname}-gui%{version}
sed -e 's/@VERSION@/%{version}/' < %{SOURCE1} > $RPM_BUILD_ROOT/%{tcl_sitelib}/%{realname}-gui%{version}/pkgIndex.tcl
install -p -m 0644 examples/tcldom/domtree.tcl \
examples/tcldom/domtree-treectrl.tcl \
examples/tcldom/domtext.tcl \
examples/tcldom/cgi2dom.tcl \
$RPM_BUILD_ROOT%{tcl_sitelib}/%{realname}-gui%{version}/
%check
# The test suite fails to run properly from the build directory.
#make test
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %{tcl_sitearch}/%{realname}-%{version}
%{tcl_sitearch}/%{realname}-%{version}/*.so
%{tcl_sitearch}/%{realname}-%{version}/*.tcl
%doc LICENSE ANNOUNCE ChangeLog README.html
%doc doc/*.html
%files devel
%defattr(-,root,root)
%{_includedir}/tclxml
%{_libdir}/TclxmlConfig.sh
%{tcl_sitearch}/%{realname}-%{version}/*.a
%files gui
%defattr(-,root,root)
%dir %{tcl_sitelib}/%{realname}-gui%{version}
%{tcl_sitelib}/%{realname}-gui%{version}/*.tcl
%changelog
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Dec 23 2008 Wart <wart at kobold.org> - 3.2-4
- Add additional Provides: and Obsoletes: to properly replace the old
tclxml/tcldom packages
* Sun Dec 21 2008 Wart <wart at kobold.org> - 3.2-3
- Don't use a macro for the version in Obsoletes:
* Thu Dec 18 2008 Wart <wart at kobold.org> - 3.2-2
- Remove execute permission from stub library
* Wed Dec 17 2008 Wart <wart at kobold.org> - 3.2-1
- Update to 3.2
- Rename package to conform with Fedora Tcl packaging guidelines
* Wed Dec 17 2008 Wart <wart at kobold.org> - 3.1-14
- Fix parsing of stylesheet entity (BZ #474766)
- Remove package name from Summary
* Sat Feb 8 2008 Wart <wart at kobold.org> - 3.1-13
- Better download URL
- rebuild for gcc 4.3
* Thu Jan 3 2008 Wart <wart at kobold.org> - 3.1-12
- Rebuild for Tcl 8.5
* Sun Feb 4 2007 Wart <wart at kobold.org> - 3.1-11
- Move package directory back to %%{_libdir} until %%{tcl_sitearch}
is part of the default package search path in Tcl.
* Fri Feb 2 2007 Wart <wart at kobold.org> - 3.1-10
- Fix sgmlparser version mismatch
- Move package directories to tcl-specific directories
* Mon Aug 28 2006 Wart <wart at kobold.org> - 3.1-9
- Rebuild for Fedora Extras
* Thu Jun 1 2006 Wart <wart at kobold.org> - 3.1-8
- Fixed Requires: for subpackages
* Tue Feb 21 2006 Wart <wart at kobold.org> - 3.1-7
- Rebuild for FC5
* Wed Jan 11 2006 Wart <wart at kobold.org> - 3.1-6
- Remove broken parts of patch
- Clean up build root before installing.
* Wed Jan 11 2006 Wart <wart at kobold.org> - 3.1-5
- Added missing ChangeLog entries.
* Wed Jan 11 2006 Wart <wart at kobold.org> - 3.1-4
- Retag to fix tag problem.
* Wed Jan 11 2006 Wart <wart at kobold.org> - 3.1-3
- Updated patch to fix quoting bug with bash >= 3.1
* Sun Jan 8 2006 Wart <wart at kobold.org> - 3.1-2
- Package now owns the directories that it creates.
* Sat Nov 26 2005 Wart <wart at kobold.org> - 3.1-1
- Update to new upstream sources.
* Sat Nov 26 2005 Wart <wart at kobold.org> - 3.0-3
- Remove dependency on dos2unix with clever sed command.
* Fri Nov 25 2005 Wart <wart at kobold.org> - 3.0-2
- Fix file permissions to clean up rpmlint warnings.
- Add BR: dos2unix to remove DOS line endings on a documentation file.
- Other minor fixes to clean up rpmlint warnings.
* Fri Jun 17 2005 Wart <wart at kobold.org> - 3.0-1
- Updated spec file to conform to Fedora Core 4 standards.
- Move autoreconf from the build to the prep stage.
* Tue Jan 18 2005 Wart <wart at kobold.org> - 3.0-0.fdr.5
- Fix typo in version string for subpackage dependencies.
- Don't include the .a library in the base package.
* Fri Nov 5 2004 Wart <wart at kobold.org> - 3.0-0.fdr.4
- Add epoch to version dependencies in spec file.
- Added additional doc files.
* Thu Nov 4 2004 Wart <wart at kobold.org> - 3.0-0.fdr.3
- enable building on x86_64
* Thu Nov 4 2004 Wart <wart at kobold.org> - 3.0-0.fdr.2
- Clean up rpmlint warnings.
* Thu Nov 4 2004 Wart <wart at kobold.org> - 3.0-0.fdr.1
- Added Fedora-style spec file.
- Allow building generic RPMs from the Makefile.
- Fix VPATH problems with newer versions of autoconf tools.