summaryrefslogtreecommitdiffstats
path: root/python/python-hyperkitty.spec
blob: 34de99dd52d6256ca99ad7150586647ab40bb7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Build doc by default
%bcond_without doc

# mailman3's TestableMaster can't be used outside of a
# source checkout?
%bcond_with tests

%global srcname hyperkitty
%global pypi_name HyperKitty

Name:           python-%{srcname}
Version:        1.3.5
Release:        %autorelease
Summary:        A web interface to access GNU Mailman v3 archives
License:        GPLv3+
URL:            https://gitlab.com/mailman/hyperkitty
Source0:        %{pypi_source %{pypi_name}}
# don't check out modules from git
Patch0:         %{pypi_name}-tox-localdeps.patch

BuildArch:      noarch

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools

%if %{with doc}
BuildRequires:  python%{python3_pkgversion}-sphinx
%endif

%global _description %{expand:
HyperKitty is an open source Django application under development. It aims to
provide a web interface to access GNU Mailman v3 archives.}

%description %{_description}


%package -n %{srcname}
Summary:        %{summary}

%description -n %{srcname} %{_description}


%package -n %{srcname}-doc
Summary:        Documentation for %{srcname}
Suggests:       %{srcname} = %{version}-%{release}

%description -n %{srcname}-doc %{_description}

This package contains the documentation for %{srcname}.


%prep
%autosetup -p1 -n %{pypi_name}-%{version}


%generate_buildrequires
%if %{with tests}
%pyproject_buildrequires -t
%else
%pyproject_buildrequires
%endif


%build
%pyproject_wheel

%if %{with doc}
(cd doc && PYTHONPATH=..:${PYTHONPATH} make html)
%endif


%install
%pyproject_install
%pyproject_save_files %{srcname}


%if %{with tests}
%check
PYTHONPATH=$(pwd)/src:${PYTHONPATH} \
%tox
%endif


%files -n %{srcname} -f %{pyproject_files}
%license COPYING.txt
%doc AUTHORS.txt README.rst

%if %{with doc}
%files -n %{srcname}-doc
%license COPYING.txt
%doc doc/_build/html/*
%endif


%changelog
%autochangelog