summaryrefslogtreecommitdiff
path: root/python-xml2rfc.spec
blob: 331a8968bef63472dc7b30db66ba08ed9518eebd (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
%global _empty_manifest_terminate_build 0
Name:		python-xml2rfc
Version:	3.17.0
Release:	1
Summary:	Xml2rfc generates RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies.
License:	BSD-3-Clause
URL:		https://github.com/ietf-tools/xml2rfc
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/43/c8/60b3a2cca1ad5ca214e3f8a092ef4b30619d8dadca2e0a89a9785d6644f2/xml2rfc-3.17.0.tar.gz
BuildArch:	noarch


%description
### Introduction
The [IETF] uses a specific format for the standards and other documents it publishes as [RFCs], and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, **xml2rfc**, is one of them. It takes as input an xml file that contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the grammars in [RFC7749] *(for v2 documents)* or [RFC7991] *(for v3 documents)*. Note that the grammar for v3 is still being refined, and changes will eventually be captured in the [bis draft for 7991]. Changes not yet captured can be seen in the xml2rfc source [v3.rng], or in the [documentation xml2rfc produces] with its `--doc` flag.
**xml2rfc** provides a variety of output formats. See the command line help for a full list of formats. It also provides conversion from v2 to v3, and can run the [preptool] on its input.
### Installation
Installation of the python package is done as usual with `pip install xml2rfc`, using appropriate switches.
#### Installation of support libraries for the PDF-formatter
In order to generate PDFs, **xml2rfc** uses the [WeasyPrint] module, which depends on external libraries that must be installed as native packages on your platform, separately from the **xml2rfc** install.
1. First, install the **Pango**, and other required libraries on your system.  See installation instructions on the [WeasyPrint Docs].
2. Next, install WeasyPrint python modules using pip.
```sh
pip install 'weasyprint==55.0'
```
3. Finally, install the full **Noto Font** and **Roboto Mono** packages:
  * Download the full font file from:
    https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip
  * Follow the installation instructions at
    https://www.google.com/get/noto/help/install/
  * Go to https://fonts.google.com/specimen/Roboto+Mono, and download the
    font. Follow the installation instructions above, as applied to this download.
  * Go to https://fonts.google.com/noto/specimen/Noto+Sans+Math, and
    download the font. Follow the installation instructions above, as
    applied to this download.
With these installed and available to **xml2rfc**, the `--pdf` switch will be enabled.
### Usage
**xml2rfc** accepts a single XML document as input and outputs to one or more conversion formats.
#### Basic Usage
```sh
xml2rfc SOURCE [options] FORMATS...
```
Run `xml2rfc --help` for a full listing of command-line options.
### Getting Started
This project is following the standard **Git Feature Workflow** development model. Learn about all the various steps of the development workflow, from creating a fork to submitting a pull request, in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide.
> Make sure to read the [Styleguides](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md#styleguides) section to ensure a cohesive code format across the project.
You can submit bug reports, enhancements and new feature requests in the [discussions](https://github.com/ietf-tools/xml2rfc/discussions) area. Accepted tickets will be converted to issues.
#### Git Cloning Tips
As outlined in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide, you will first want to create a fork of the xml2rfc project in your personal GitHub account before cloning it.
For example *(replace `USERNAME` with your GitHub username)*:
```sh
git clone https://github.com/USERNAME/xml2rfc.git
```
#### Docker Dev Environment
Run `./run.sh` command to build and start a docker development environment.
The initial build may take time because it downloads all required fonts as well.
```sh
./run.sh
```
[IETF]: https://www.ietf.org/
[RFCs]: https://www.rfc-editor.org/
[RFC7749]: https://www.rfc-editor.org/info/rfc7749
[RFC7991]: https://www.rfc-editor.org/info/rfc7991
[bis draft for 7991]: https://datatracker.ietf.org/doc/draft-iab-rfc7991bis/
[v3.rng]: xml2rfc/data/v3.rng
[documentation xml2rfc produces]: https://ietf-tools.github.io/xml2rfc/
[preptool]: https://www.rfc-editor.org/info/rfc7998
[WeasyPrint]: https://weasyprint.org/
[WeasyPrint Docs]: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html

%package -n python3-xml2rfc
Summary:	Xml2rfc generates RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies.
Provides:	python-xml2rfc
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-xml2rfc
### Introduction
The [IETF] uses a specific format for the standards and other documents it publishes as [RFCs], and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, **xml2rfc**, is one of them. It takes as input an xml file that contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the grammars in [RFC7749] *(for v2 documents)* or [RFC7991] *(for v3 documents)*. Note that the grammar for v3 is still being refined, and changes will eventually be captured in the [bis draft for 7991]. Changes not yet captured can be seen in the xml2rfc source [v3.rng], or in the [documentation xml2rfc produces] with its `--doc` flag.
**xml2rfc** provides a variety of output formats. See the command line help for a full list of formats. It also provides conversion from v2 to v3, and can run the [preptool] on its input.
### Installation
Installation of the python package is done as usual with `pip install xml2rfc`, using appropriate switches.
#### Installation of support libraries for the PDF-formatter
In order to generate PDFs, **xml2rfc** uses the [WeasyPrint] module, which depends on external libraries that must be installed as native packages on your platform, separately from the **xml2rfc** install.
1. First, install the **Pango**, and other required libraries on your system.  See installation instructions on the [WeasyPrint Docs].
2. Next, install WeasyPrint python modules using pip.
```sh
pip install 'weasyprint==55.0'
```
3. Finally, install the full **Noto Font** and **Roboto Mono** packages:
  * Download the full font file from:
    https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip
  * Follow the installation instructions at
    https://www.google.com/get/noto/help/install/
  * Go to https://fonts.google.com/specimen/Roboto+Mono, and download the
    font. Follow the installation instructions above, as applied to this download.
  * Go to https://fonts.google.com/noto/specimen/Noto+Sans+Math, and
    download the font. Follow the installation instructions above, as
    applied to this download.
With these installed and available to **xml2rfc**, the `--pdf` switch will be enabled.
### Usage
**xml2rfc** accepts a single XML document as input and outputs to one or more conversion formats.
#### Basic Usage
```sh
xml2rfc SOURCE [options] FORMATS...
```
Run `xml2rfc --help` for a full listing of command-line options.
### Getting Started
This project is following the standard **Git Feature Workflow** development model. Learn about all the various steps of the development workflow, from creating a fork to submitting a pull request, in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide.
> Make sure to read the [Styleguides](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md#styleguides) section to ensure a cohesive code format across the project.
You can submit bug reports, enhancements and new feature requests in the [discussions](https://github.com/ietf-tools/xml2rfc/discussions) area. Accepted tickets will be converted to issues.
#### Git Cloning Tips
As outlined in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide, you will first want to create a fork of the xml2rfc project in your personal GitHub account before cloning it.
For example *(replace `USERNAME` with your GitHub username)*:
```sh
git clone https://github.com/USERNAME/xml2rfc.git
```
#### Docker Dev Environment
Run `./run.sh` command to build and start a docker development environment.
The initial build may take time because it downloads all required fonts as well.
```sh
./run.sh
```
[IETF]: https://www.ietf.org/
[RFCs]: https://www.rfc-editor.org/
[RFC7749]: https://www.rfc-editor.org/info/rfc7749
[RFC7991]: https://www.rfc-editor.org/info/rfc7991
[bis draft for 7991]: https://datatracker.ietf.org/doc/draft-iab-rfc7991bis/
[v3.rng]: xml2rfc/data/v3.rng
[documentation xml2rfc produces]: https://ietf-tools.github.io/xml2rfc/
[preptool]: https://www.rfc-editor.org/info/rfc7998
[WeasyPrint]: https://weasyprint.org/
[WeasyPrint Docs]: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html

%package help
Summary:	Development documents and examples for xml2rfc
Provides:	python3-xml2rfc-doc
%description help
### Introduction
The [IETF] uses a specific format for the standards and other documents it publishes as [RFCs], and for the draft documents which are produced when developing documents for publications. There exists a number of different tools to facilitate the formatting of drafts and RFCs according to the existing rules, and this tool, **xml2rfc**, is one of them. It takes as input an xml file that contains the text and meta-information about author names etc., and transforms it into suitably formatted output. The input xml file should follow the grammars in [RFC7749] *(for v2 documents)* or [RFC7991] *(for v3 documents)*. Note that the grammar for v3 is still being refined, and changes will eventually be captured in the [bis draft for 7991]. Changes not yet captured can be seen in the xml2rfc source [v3.rng], or in the [documentation xml2rfc produces] with its `--doc` flag.
**xml2rfc** provides a variety of output formats. See the command line help for a full list of formats. It also provides conversion from v2 to v3, and can run the [preptool] on its input.
### Installation
Installation of the python package is done as usual with `pip install xml2rfc`, using appropriate switches.
#### Installation of support libraries for the PDF-formatter
In order to generate PDFs, **xml2rfc** uses the [WeasyPrint] module, which depends on external libraries that must be installed as native packages on your platform, separately from the **xml2rfc** install.
1. First, install the **Pango**, and other required libraries on your system.  See installation instructions on the [WeasyPrint Docs].
2. Next, install WeasyPrint python modules using pip.
```sh
pip install 'weasyprint==55.0'
```
3. Finally, install the full **Noto Font** and **Roboto Mono** packages:
  * Download the full font file from:
    https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip
  * Follow the installation instructions at
    https://www.google.com/get/noto/help/install/
  * Go to https://fonts.google.com/specimen/Roboto+Mono, and download the
    font. Follow the installation instructions above, as applied to this download.
  * Go to https://fonts.google.com/noto/specimen/Noto+Sans+Math, and
    download the font. Follow the installation instructions above, as
    applied to this download.
With these installed and available to **xml2rfc**, the `--pdf` switch will be enabled.
### Usage
**xml2rfc** accepts a single XML document as input and outputs to one or more conversion formats.
#### Basic Usage
```sh
xml2rfc SOURCE [options] FORMATS...
```
Run `xml2rfc --help` for a full listing of command-line options.
### Getting Started
This project is following the standard **Git Feature Workflow** development model. Learn about all the various steps of the development workflow, from creating a fork to submitting a pull request, in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide.
> Make sure to read the [Styleguides](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md#styleguides) section to ensure a cohesive code format across the project.
You can submit bug reports, enhancements and new feature requests in the [discussions](https://github.com/ietf-tools/xml2rfc/discussions) area. Accepted tickets will be converted to issues.
#### Git Cloning Tips
As outlined in the [Contributing](https://github.com/ietf-tools/.github/blob/main/CONTRIBUTING.md) guide, you will first want to create a fork of the xml2rfc project in your personal GitHub account before cloning it.
For example *(replace `USERNAME` with your GitHub username)*:
```sh
git clone https://github.com/USERNAME/xml2rfc.git
```
#### Docker Dev Environment
Run `./run.sh` command to build and start a docker development environment.
The initial build may take time because it downloads all required fonts as well.
```sh
./run.sh
```
[IETF]: https://www.ietf.org/
[RFCs]: https://www.rfc-editor.org/
[RFC7749]: https://www.rfc-editor.org/info/rfc7749
[RFC7991]: https://www.rfc-editor.org/info/rfc7991
[bis draft for 7991]: https://datatracker.ietf.org/doc/draft-iab-rfc7991bis/
[v3.rng]: xml2rfc/data/v3.rng
[documentation xml2rfc produces]: https://ietf-tools.github.io/xml2rfc/
[preptool]: https://www.rfc-editor.org/info/rfc7998
[WeasyPrint]: https://weasyprint.org/
[WeasyPrint Docs]: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html

%prep
%autosetup -n xml2rfc-3.17.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-xml2rfc -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 3.17.0-1
- Package Spec generated