File po4a.spec of Package po4a

# spec file for package po4a
# Copyright (c) 2013 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:           po4a
Version:        0.44
Release:        0
Summary:        Framework to translate documentation and other materials
License:        GPL-2.0
Group:          Development/Tools/Other

# PATCH-FIX-UPSTREAM po4a-0.44-use-tempfile-correctly.patch Will be fixed in next version.
Patch0: po4a-0.44-use-tempfile-correctly.patch

BuildRequires:  docbook-xsl-stylesheets
%if 0%{?suse_version} > 1210
BuildRequires:  libxslt-tools
%if 0%{?suse_version} == 1210
BuildRequires:  libxslt1
%if 0%{?suse_version} < 1210
BuildRequires:  libxslt
BuildRequires:  perl-Module-Build >= 0.40
BuildRequires:  perl-SGMLS >= 1.03ii
BuildRequires:  perl-Term-ReadKey
BuildRequires:  perl-Text-WrapI18N
BuildRequires:  perl-Unicode-LineBreak
BuildRequires:  perl-base
BuildRequires:  perl-gettext >= 1.01

# for test suite
BuildRequires:  docbook_4
BuildRequires:  iso_ent
BuildRequires:  opensp
BuildRequires:  perl-HTML-Parser
Requires:       %{name}-lang = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Po4a extracts the translatable material from its input in a PO file.
When the PO file is translated, it re-injects the translation in the structure of the document, and generates the translated document.
If a string is not translated (i.e. it was not translated or it is "fuzzy"
because the original document was updated), the original string is used.
This permits to provide always up-to-date documentation.

po4a supports currently the following formats:
  * manpages
  * POD
  * XML (generic, DocBook, XHTML, Dia, Guide, or WML)
  * SGML
  * TeX (generic, LaTeX, or Texinfo)
  * text (simple text files with some formatting, markdown, or AsciiDoc)
  * INI

%setup -q
%patch0 -p1

perl Build.PL installdirs=vendor

./Build install destdir=%{buildroot}
%find_lang %{name} --with-man --all-name
rm -f %{buildroot}%{perl_vendorarch}/auto/po4a/.packlist

# requires texlive, which is too heavy for the package
rm t/24-tex.t
./Build test

rm -rf %{buildroot}

%attr(755,root,root) %{_bindir}/*
%dir %{perl_vendorlib}/Locale/

%files lang -f %{name}.lang
%dir %{_mandir}/ca
%dir %{_mandir}/pl
%dir %{_mandir}/pt