File tidy.spec of Package tidy

#
# spec file for package tidy (Version 1.0.20100204cvs)
#
# Copyright (c) 2010 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/
#

# norootforbuild

%define snapshot 20100204cvs

Name:           tidy
Version:        1.0.%{snapshot}
Release:        2
Summary:        Utility to Clean Up and Pretty-print HTML, XHTML or XML Markup
Group:          Productivity/Publishing/HTML/Tools
License:        W3C
Url:            http://tidy.sourceforge.net/
Source0:        tidy-%{snapshot}.tar.bz2
Source10:       tidy_generate_tarball.sh
AutoReqProv:    on
BuildRequires:  libtool
BuildRequires:  libxslt
BuildRequires:  doxygen
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Tidy is a commandline frontend to TidyLib which allows for cleaning up and
pretty printing HTML, XHTML and XML markup in a variety of file encodings. For
HTML variants, it can detect and report proprietary elements as well as many
common coding errors, correct them and produce visually equivalent markup
which is both compliant with W3C standards and works on most browsers.
Furthermore, it can convert plain HTML to XHTML. For generic XML files, Tidy is
limited to correcting basic well-formedness errors and pretty printing.


Authors:
--------
    Dave Raggett <dsr@w3.org>
    Jelks Cabaniss
    Arnaud Desitter
    Bjoern Hoehrmann <bjoern@hoehrmann.de>
    Pradeep Padala <ppadala@users.sourceforge.net>
    Dave Raggett <dsr@w3.org>
    Charles Reitzel
    Terry Teague <terry_teague@users.sourceforge.net>


%package doc
License:        W3C
Summary:        Documentation for tidy and libtidy-0_99-0
Group:          Productivity/Publishing/HTML/Tools
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description doc
This package contains the documentation for both tidy and libtidy.


%package -n libtidy-0_99-0
License:        W3C
Summary:        Library to Clean Up and Pretty-print HTML, XHTML or XML Markup
Group:          Productivity/Publishing/HTML/Tools
Provides:       libtidy = %{version}
Obsoletes:      libtidy <= 1.0
AutoReqProv:    on

%description -n libtidy-0_99-0
TidyLib is a library for cleaning up and pretty printing HTML, XHTML and XML
markup in a variety of file encodings. For HTML variants, it can detect and
report proprietary elements as well as many common coding errors, correct them
and produce visually equivalent markup which is both compliant with W3C
standards and works on most browsers. Furthermore, it can convert plain HTML
into XHTML. For generic XML files, Tidy is limited to correcting basic
well-formedness errors and pretty printing.

There is a commandline frontend for this library, contained in the package
"tidy".


Authors:
--------
    Dave Raggett <dsr@w3.org>
    Jelks Cabaniss
    Arnaud Desitter
    Bjoern Hoehrmann <bjoern@hoehrmann.de>
    Pradeep Padala <ppadala@users.sourceforge.net>
    Dave Raggett <dsr@w3.org>
    Charles Reitzel
    Terry Teague <terry_teague@users.sourceforge.net>


%package -n libtidy-0_99-0-devel
License:        W3C
Summary:        Include Files and Libraries for Development
Group:          Development/Libraries/C and C++
Requires:       libtidy-0_99-0 = %{version} glibc-devel
Provides:       libtidy-devel = %{version}
Obsoletes:      libtidy-devel <= 1.0
AutoReqProv:    on

%description -n libtidy-0_99-0-devel
This package contains all necessary include files and libraries needed
to develop applications using functions provided by the TidyLib library.


%prep
%setup -q -n %{name}-%{snapshot}

%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
/bin/sh build/gnuauto/setup.sh
%configure --disable-static --with-pic --disable-dependency-tracking \
           --includedir=%{_includedir}/%{name}
make %{?_smp_mflags} all
# generate quickref.html and tidy(1) manpage
make -C build/gmake/ doc
# generate API documentation
doxygen htmldoc/doxygen.cfg

%install
make install DESTDIR=$RPM_BUILD_ROOT
install -D -p -m 644 htmldoc/tidy.1 $RPM_BUILD_ROOT%{_mandir}/man1/tidy.1
rm -f $RPM_BUILD_ROOT%{_libdir}/libtidy.la

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libtidy-0_99-0 -p /sbin/ldconfig

%postun -n libtidy-0_99-0 -p /sbin/ldconfig

%files
%defattr(-, root, root)
%{_bindir}/tidy
%{_bindir}/tab2space
%{_mandir}/man1/tidy.1*

%files -n tidy-doc
%defattr(-, root, root)
%doc htmldoc/*.gif htmldoc/*.css htmldoc/*.html
%doc htmldoc/api/

%files -n libtidy-0_99-0
%defattr(-, root, root)
%{_libdir}/libtidy*.so.*

%files -n libtidy-0_99-0-devel
%defattr(-, root, root)
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_libdir}/libtidy.so

%changelog