]> git.pld-linux.org Git - packages/python-acme.git/blob - python-acme.spec
new, version 0.1.0
[packages/python-acme.git] / python-acme.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # don't build doc
4 %bcond_without  tests   # do not perform "make test"
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  acme
9 Summary:        Python library for the ACME protocol
10 Name:           python-%{module}
11 Version:        0.1.0
12 Release:        1
13 License:        Apache v2.0
14 Group:          Libraries/Python
15 Source0:        https://pypi.python.org/packages/source/a/%{module}/%{module}-%{version}.tar.gz
16 # Source0-md5:  7115ba77709b281ffaa59d853cd5337a
17 URL:            https://pypi.python.org/pypi/acme
18 BuildRequires:  rpm-pythonprov
19 BuildRequires:  rpmbuild(macros) >= 1.713
20 %if %{with python2}
21 BuildRequires:  python-cryptography
22 BuildRequires:  python-devel
23 BuildRequires:  python-pyOpenSSL
24 BuildRequires:  python-pyrfc3339
25 BuildRequires:  python-requests
26 BuildRequires:  python-werkzeug
27 BuildRequires:  sphinx-pdg
28 %if %{with tests}
29 BuildRequires:  python-ndg_httpsclient
30 BuildRequires:  python-nose
31 BuildRequires:  python-tox
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-cryptography
36 BuildRequires:  python3-devel
37 BuildRequires:  python3-pyOpenSSL
38 BuildRequires:  python3-pyrfc3339
39 BuildRequires:  python3-requests
40 BuildRequires:  python3-werkzeug
41 %if %{with tests}
42 BuildRequires:  python3-ndg_httpsclient
43 BuildRequires:  python3-nose
44 BuildRequires:  python3-tox
45 %endif
46 %endif
47 %if %{with doc}
48 BuildRequires:  python-sphinxcontrib-programoutput
49 %endif
50 Requires:       python-cryptography
51 Requires:       python-ndg_httpsclient
52 Requires:       python-pyOpenSSL
53 Requires:       python-pyasn1
54 Requires:       python-pyrfc3339
55 Requires:       python-pytz
56 Requires:       python-requests
57 Requires:       python-six
58 Requires:       python-werkzeug
59 Suggests:       python-acme-doc
60 BuildArch:      noarch
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %description
64 Python 2 library for use of the Automatic Certificate Management
65 Environment protocol as defined by the IETF. It's used by the Let's
66 Encrypt project.
67
68 %package -n python3-acme
69 Summary:        Python library for the ACME protocol
70 Group:          Libraries/Python
71 Requires:       python3-cryptography
72 Requires:       python3-ndg_httpsclient
73 Requires:       python3-pyOpenSSL
74 Requires:       python3-pyasn1
75 Requires:       python3-pyrfc3339
76 Requires:       python3-pytz
77 Requires:       python3-requests
78 Requires:       python3-six
79 Requires:       python3-werkzeug
80 Suggests:       python-acme-doc
81
82 %description -n python3-acme
83 Python 3 library for use of the Automatic Certificate Management
84 Environment protocol as defined by the IETF. It's used by the Let's
85 Encrypt project.
86
87 %package doc
88 Summary:        Documentation for python-acme libraries
89 Requires:       fontawesome-fonts
90 Requires:       fontawesome-fonts-web
91 Provides:       bundled(inconsolata-fonts)
92 Provides:       bundled(jquery)
93 Provides:       bundled(lato-fonts)
94 Provides:       bundled(robotoslab-fonts)
95 Provides:       bundled(underscore)
96
97 %description doc
98 Documentation for the ACME python libraries
99
100 %prep
101 %setup -q -n %{module}-%{version}
102
103 %build
104 %if %{with python2}
105 %py_build %{?with_tests:test}
106 %endif
107
108 %if %{with python3}
109 %py3_build %{?with_tests:test}
110 %endif
111
112 %if %{with doc}
113 %{__make} -C docs html
114 # build documentation
115 %{__python} setup.py install --user
116
117 # Clean up stuff we don't need for docs
118 rm -rf docs/_build/html/{.buildinfo,_sources}
119
120 # Unbundle fonts already on system
121 # Lato ttf is in texlive but that adds a lot of dependencies (30+MB) for just a font in documentation
122 # and lato is not in it's own -fonts package, only texlive
123 rm -f docs/_build/html/_static/fonts/fontawesome*
124 ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot docs/_build/html/_static/fonts/fontawesome-webfont.eot
125 ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg docs/_build/html/_static/fonts/fontawesome-webfont.svg
126 ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf docs/_build/html/_static/fonts/fontawesome-webfont.ttf
127 ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff docs/_build/html/_static/fonts/fontawesome-webfont.woff
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132 # Do python3 first so bin ends up from py2
133 %if %{with python3}
134 %py3_install
135 %endif
136
137 %if %{with python2}
138 %py_install
139 %endif
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %files
146 %defattr(644,root,root,755)
147 %doc README.rst LICENSE.txt
148 %{py_sitescriptdir}/%{module}
149 %{py_sitescriptdir}/%{module}-%{version}*.egg-info
150 %attr(755,root,root) %{_bindir}/jws
151 %endif
152
153 %if %{with python3}
154 %files -n python3-acme
155 %defattr(644,root,root,755)
156 %doc README.rst LICENSE.txt
157 %{py3_sitescriptdir}/%{module}
158 %{py3_sitescriptdir}/%{module}-%{version}*.egg-info
159 %endif
160
161 %if %{with doc}
162 %files doc
163 %defattr(644,root,root,755)
164 %doc docs/_build/html/*
165 %endif
This page took 0.111027 seconds and 3 git commands to generate.