1
%define python_tidy python-tidy
2
%define phpdoc phpdoc
3
%if 0%{?mandriva_version}
4
%define python_tidy python-uTidylib
5
%define phpdoc php-pear-PhpDocumentor
6
%endif
7
%if 0%{?suse_version}
8
%define python_tidy python-utidy
9
%define phpdoc php5-pear-phpdocumentor
10
%endif
11
12
Name:           xhtml2odt
13
Version:        1.3
14
Release:        1%{?dist}
15
Summary:        Convert XHTML to OpenDocument (ODT)
16
17
Group:          Applications/Publishing
18
License:        LGPLv2+
19
URL:            http://xhtml2odt.org
20
Source0:        http://xhtml2odt.org/dl/xhtml2odt-%{version}.tar.gz
21
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
22
BuildArch:      noarch
23
24
## Unit tests
25
BuildRequires:  python-nose
26
BuildRequires:  python-lxml
27
BuildRequires:  python-imaging
28
BuildRequires:  %{python_tidy}
29
## Documentation
30
BuildRequires:  python-sphinx
31
%if 0%{?mandriva_version}%{?suse_version}
32
# Can't make it work in OBS for now
33
%else
34
BuildRequires:  %{phpdoc}
35
%endif
36
BuildRequires:  dos2unix
37
BuildRequires:  help2man
38
39
## Python script
40
Requires:       %{python_tidy}
41
Requires:       python-lxml
42
Requires:       python-imaging
43
44
45
%description
46
XHTML2ODT is a converting library from XHTML to ODT. It is based on XSL
47
style sheets for portability, and is designed to help web applications export
48
to the ODT document format.
49
50
51
%prep
52
%setup -q
53
dos2unix README.txt NEWS.txt LICENSE.txt
54
chmod -x xhtml2odt.php xhtml2odt.sh
55
56
57
%build
58
make doc || :
59
rm -rf doc-python
60
mv doc-py/_build/html doc-python
61
rm -f doc-python/.buildinfo
62
63
64
%install
65
rm -rf $RPM_BUILD_ROOT
66
make install \
67
    PREFIX=%{_prefix} \
68
    DESTDIR=$RPM_BUILD_ROOT
69
70
rm -rf example-scripts
71
mkdir example-scripts
72
cp -a xhtml2odt.php xhtml2odt.sh example-scripts/
73
74
75
%check
76
make tests
77
78
79
%clean
80
rm -rf $RPM_BUILD_ROOT
81
82
83
%files
84
%defattr(-,root,root,-)
85
%doc *.txt doc-python example-scripts
86
%if 0%{?mandriva_version}%{?suse_version}
87
# Can't make it work in OBS for now
88
%else
89
%doc doc-php
90
%endif
91
%{_bindir}/*
92
%{_datadir}/%{name}
93
%{_mandir}/man1/*
94
95
96
%changelog
97
* Thu Jul 14 2011 Aurelien Bompard <aurelien@bompard.org> -  1.3-1
98
- version 1.3
99
100
* Tue Sep 28 2010 Aurelien Bompard <aurelien@bompard.org> -  1.2-1
101
- initial package