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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
%global _empty_manifest_terminate_build 0
Name: python-ebookmaker
Version: 0.12.30
Release: 1
Summary: The Project Gutenberg tool to generate EPUBs and other ebook formats.
License: GPL v3
URL: https://github.com/gutenbergtools/ebookmaker/
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/8f/ad/ff5a1b1d59767e2761c567c65a9b136d42f22358af82e5785f6394f3e8b6/ebookmaker-0.12.30.tar.gz
BuildArch: noarch
%description
# Ebookmaker
Ebookmaker is the tool used for format conversion at Project Gutenberg.
It builds HTML5, EPUB2, EPUB3 and Kindle files (including KF8) from HTML.
It builds builds thes formats and PDF files from reST sources.
If you are preparing HTML for use with Ebookmaker, the [Usage Notes](USAGE.md) may be of interest.
## Prerequisites
* Python3 >= 3.7
### Needed only for Kindle generation
* Calibre (https://calibre-ebook.com/) (needed to make Kindle files)
* may need to install Calibre's ebook-convert command line tool https://manual.calibre-ebook.com/generated/en/cli-index.html
### Needed only for validation
* EpubCheck (for EPUB vaidalition) To use EPUBCheck validation, first download and install EPUBCheck from https://www.w3.org/publishing/epubcheck/. If the command to invoke it is `java -jar /Applications/epubcheck-4.2.6/epubcheck.jar`, then add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `epub_validator: java -jar /Applications/epubcheck-4.2.6/epubcheck.jar` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* the W3C "Nu" validator (for HTML5 validation) https://validator.github.io/validator/ add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `html_validator: [something for your install]/vnu-runtime-image/bin/vnu` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* on MacOS, you may need to create security exceptions. On my system, I had to do `sudo xattr -r -d com.apple.quarantine /Users/eric/vnu-runtime-image/lib`
### Needed only for cover generation
* Cairo https://www.cairographics.org/download/
* Noto Sans and Noto Sans CJK:
* CentOS or RedHat: `yum install google-noto-sans-cjk-fonts; yum install google-noto-sans-fonts`
* Ubuntu: `apt-get install fonts-noto-cjk fonts-noto`
### Needed only for conversion from RST
* Libertinus Serif and Libertinus Sans https://github.com/alerque/libertinus
* For Linux,
* Download the latest release https://github.com/alerque/libertinus/releases/latest
* unzip, put .otf files into ~/.fonts
* update font catalog `fc-cache -f -v`
* DejaVu Sans Mono https://dejavu-fonts.github.io/
* TexLive (to build PDF from TeX and rst)
Tested with Python 3.8
## Install
(master branch, editable install)
`pipenv install ebookmaker`
Use the ebookmaker.conf file to pass a path to your kindlegen, tex, and groff programs
if they're not in your PATH. Edit the ebookmaker.conf and copy it to /etc/ebookmaker.conf to
reset the paths.
Copy ebookmaker.conf to ~/.ebookmaker to override settings in /etc/ebookmaker.conf or to set default
command line options.
## Sample invocation
(From the directory where you ran `pipenv install`)
`pipenv shell`
`ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
or
`pipenv run ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
## new to pipenv?
Install pipenv (might be `pip install --user pipenv`, depending on your default python)
`$ pip3 install --user pipenv`
The default install location is `${HOME}/.local/bin`, so add this to your login shell's ${PATH} if needed.
Change directories to where you want to have your ebookmaker environment. Then, to initialize a python 3 virtual environment, do
`$ pipenv --three`
Whenever you want to enter this environment, move to this directory and do:
`$ pipenv shell`
Install the gutenberg modules:
`$ pipenv install ebookmaker`
Check your install:
`$ ebookmaker --version`
`EbookMaker 0.12.0`
Since you're in the shell, you can navigate to a book's directory and convert it:
`$ ebookmaker -v -v --make=epub.images --ebook 10001 --title "The Luck of the Kid" --author "Ridgwell Cullum" luck-kid.html`
## Update
`$ cd ebookmaker` to wherever you ran `$ pipenv install ebookmaker`
then:
`$ pipenv update ebookmaker`
## Test
Install, as above.
`$ cd ebookmaker` to wherever you ran `$ pip install ebookmaker`
then:
`$ git checkout master`
`$ pipenv install -e .`
`$ python setup.py test`
Travis-CI will run tests on branches committed in the gutenbergtools org
## Notes running Ebookmaker on Windows Machine (adapted from @windymilla)
1. Install Python 3.7+ from python.org. Install Kindlegen. Add it to the path.
2. Add system environment variable: Right-click "My Computer", then Properties, then Advanced, then Environment variables, then New. Call the variable PYTHON_HOME, and set it to the Python folder.
3. Edit the Path variable and add to the end of it `;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\`
4. Check by starting a new command window and typing `python`. It should run your version of Python. Quit python with `^Z` & Enter.
5. In command window, type `pip3 install --user pipenv`. Script may warn it has put scripts into a folder such as `C:\Users\myname\AppData\Roaming\Python\Python37\Scripts`, and to add this to the Path environment variable. Do this – don't forget the semicolon before the new folder name! (Possibly might work instead to just copy the newly installed files from where they were installed into your main python scripts folder, i.e. `%PYTHON_HOME%\Scripts` ?)
6. Close old command window and start a new (to get the new path)
7. Create a folder for ebookmaker, e.g. `C:\DP\ebookmaker`
8. In command window, go to the new folder
9. Type `pipenv install ebookmaker` – takes a while to install. It will also create a "virtual environment", with a new folder, something like `C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi`
10. (Optional - only if you need ebookmaker to create a book cover for you because you are not providing one)
Download GTK+ to get Cairo. Precompiled Win32 binaries are here: http://ftp.gnome.org/pub/gnome/binaries ... _win32.zip
Unzip this to a folder, e.g. `C:\DP\gtk` and add `C:\DP\gtk\bin` to the Path environment variable.
Exit command window and start a new one to get new path
Go to the ebookmaker folder, `C:\DP\ebookmaker`
11. Type `pipenv run python ebookmaker --version` to check ebookmaker version. If this doesn't work (it should, but didn't work for us) try:
- Look in `C:\Users\myname\.virtualenvs\` and find the name of your virtualenv - it should be something like `ebookmaker-cgaQuYhi`
- Type `pipenv run python C:\Users\myname\.virtualenvs\<name of virtualenv>\Scripts\ebookmaker --version` to check ebookmaker version.
12. (Should not happen now Cairo is optional) If there's error like like no "cairo" or "cairo-2" found, check if your libcairo and libcairo-2 path exist. If they do, edit dlopen in _init_.py in cairocffi package. Return the path found by ctypes.util.find_library directly instead of calling ffi.dlopen(path).
13. If folder/file name contains space, pathnames muse be enclosed in `"`, like `--output-dir="C:\your foldername"`. If pathname is quoted, it MUST NOT end with trailing `\` or error will be raised. If running bat file from within Guiguts, this means you should use `$d.` rather than `$d` (i.e. a dot after $d so quoted pathname will end in `\."` rather than `\"`) when passing it as a value for the output-dir argument.
14. Example run_ebookmaker.bat file for use with Guiguts:
cd C:\DP\ebookmaker
pipenv run python C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi\Scripts\ebookmaker -v --make=epub.images --make=kindle.images --output-dir=%1 --title=%2 %3
15. Corresponding "external program" setup within Guiguts:
`c:\dp\ebookmaker\run_ebookmaker.bat $d. $f $d$f$e`
%package -n python3-ebookmaker
Summary: The Project Gutenberg tool to generate EPUBs and other ebook formats.
Provides: python-ebookmaker
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-ebookmaker
# Ebookmaker
Ebookmaker is the tool used for format conversion at Project Gutenberg.
It builds HTML5, EPUB2, EPUB3 and Kindle files (including KF8) from HTML.
It builds builds thes formats and PDF files from reST sources.
If you are preparing HTML for use with Ebookmaker, the [Usage Notes](USAGE.md) may be of interest.
## Prerequisites
* Python3 >= 3.7
### Needed only for Kindle generation
* Calibre (https://calibre-ebook.com/) (needed to make Kindle files)
* may need to install Calibre's ebook-convert command line tool https://manual.calibre-ebook.com/generated/en/cli-index.html
### Needed only for validation
* EpubCheck (for EPUB vaidalition) To use EPUBCheck validation, first download and install EPUBCheck from https://www.w3.org/publishing/epubcheck/. If the command to invoke it is `java -jar /Applications/epubcheck-4.2.6/epubcheck.jar`, then add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `epub_validator: java -jar /Applications/epubcheck-4.2.6/epubcheck.jar` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* the W3C "Nu" validator (for HTML5 validation) https://validator.github.io/validator/ add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `html_validator: [something for your install]/vnu-runtime-image/bin/vnu` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* on MacOS, you may need to create security exceptions. On my system, I had to do `sudo xattr -r -d com.apple.quarantine /Users/eric/vnu-runtime-image/lib`
### Needed only for cover generation
* Cairo https://www.cairographics.org/download/
* Noto Sans and Noto Sans CJK:
* CentOS or RedHat: `yum install google-noto-sans-cjk-fonts; yum install google-noto-sans-fonts`
* Ubuntu: `apt-get install fonts-noto-cjk fonts-noto`
### Needed only for conversion from RST
* Libertinus Serif and Libertinus Sans https://github.com/alerque/libertinus
* For Linux,
* Download the latest release https://github.com/alerque/libertinus/releases/latest
* unzip, put .otf files into ~/.fonts
* update font catalog `fc-cache -f -v`
* DejaVu Sans Mono https://dejavu-fonts.github.io/
* TexLive (to build PDF from TeX and rst)
Tested with Python 3.8
## Install
(master branch, editable install)
`pipenv install ebookmaker`
Use the ebookmaker.conf file to pass a path to your kindlegen, tex, and groff programs
if they're not in your PATH. Edit the ebookmaker.conf and copy it to /etc/ebookmaker.conf to
reset the paths.
Copy ebookmaker.conf to ~/.ebookmaker to override settings in /etc/ebookmaker.conf or to set default
command line options.
## Sample invocation
(From the directory where you ran `pipenv install`)
`pipenv shell`
`ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
or
`pipenv run ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
## new to pipenv?
Install pipenv (might be `pip install --user pipenv`, depending on your default python)
`$ pip3 install --user pipenv`
The default install location is `${HOME}/.local/bin`, so add this to your login shell's ${PATH} if needed.
Change directories to where you want to have your ebookmaker environment. Then, to initialize a python 3 virtual environment, do
`$ pipenv --three`
Whenever you want to enter this environment, move to this directory and do:
`$ pipenv shell`
Install the gutenberg modules:
`$ pipenv install ebookmaker`
Check your install:
`$ ebookmaker --version`
`EbookMaker 0.12.0`
Since you're in the shell, you can navigate to a book's directory and convert it:
`$ ebookmaker -v -v --make=epub.images --ebook 10001 --title "The Luck of the Kid" --author "Ridgwell Cullum" luck-kid.html`
## Update
`$ cd ebookmaker` to wherever you ran `$ pipenv install ebookmaker`
then:
`$ pipenv update ebookmaker`
## Test
Install, as above.
`$ cd ebookmaker` to wherever you ran `$ pip install ebookmaker`
then:
`$ git checkout master`
`$ pipenv install -e .`
`$ python setup.py test`
Travis-CI will run tests on branches committed in the gutenbergtools org
## Notes running Ebookmaker on Windows Machine (adapted from @windymilla)
1. Install Python 3.7+ from python.org. Install Kindlegen. Add it to the path.
2. Add system environment variable: Right-click "My Computer", then Properties, then Advanced, then Environment variables, then New. Call the variable PYTHON_HOME, and set it to the Python folder.
3. Edit the Path variable and add to the end of it `;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\`
4. Check by starting a new command window and typing `python`. It should run your version of Python. Quit python with `^Z` & Enter.
5. In command window, type `pip3 install --user pipenv`. Script may warn it has put scripts into a folder such as `C:\Users\myname\AppData\Roaming\Python\Python37\Scripts`, and to add this to the Path environment variable. Do this – don't forget the semicolon before the new folder name! (Possibly might work instead to just copy the newly installed files from where they were installed into your main python scripts folder, i.e. `%PYTHON_HOME%\Scripts` ?)
6. Close old command window and start a new (to get the new path)
7. Create a folder for ebookmaker, e.g. `C:\DP\ebookmaker`
8. In command window, go to the new folder
9. Type `pipenv install ebookmaker` – takes a while to install. It will also create a "virtual environment", with a new folder, something like `C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi`
10. (Optional - only if you need ebookmaker to create a book cover for you because you are not providing one)
Download GTK+ to get Cairo. Precompiled Win32 binaries are here: http://ftp.gnome.org/pub/gnome/binaries ... _win32.zip
Unzip this to a folder, e.g. `C:\DP\gtk` and add `C:\DP\gtk\bin` to the Path environment variable.
Exit command window and start a new one to get new path
Go to the ebookmaker folder, `C:\DP\ebookmaker`
11. Type `pipenv run python ebookmaker --version` to check ebookmaker version. If this doesn't work (it should, but didn't work for us) try:
- Look in `C:\Users\myname\.virtualenvs\` and find the name of your virtualenv - it should be something like `ebookmaker-cgaQuYhi`
- Type `pipenv run python C:\Users\myname\.virtualenvs\<name of virtualenv>\Scripts\ebookmaker --version` to check ebookmaker version.
12. (Should not happen now Cairo is optional) If there's error like like no "cairo" or "cairo-2" found, check if your libcairo and libcairo-2 path exist. If they do, edit dlopen in _init_.py in cairocffi package. Return the path found by ctypes.util.find_library directly instead of calling ffi.dlopen(path).
13. If folder/file name contains space, pathnames muse be enclosed in `"`, like `--output-dir="C:\your foldername"`. If pathname is quoted, it MUST NOT end with trailing `\` or error will be raised. If running bat file from within Guiguts, this means you should use `$d.` rather than `$d` (i.e. a dot after $d so quoted pathname will end in `\."` rather than `\"`) when passing it as a value for the output-dir argument.
14. Example run_ebookmaker.bat file for use with Guiguts:
cd C:\DP\ebookmaker
pipenv run python C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi\Scripts\ebookmaker -v --make=epub.images --make=kindle.images --output-dir=%1 --title=%2 %3
15. Corresponding "external program" setup within Guiguts:
`c:\dp\ebookmaker\run_ebookmaker.bat $d. $f $d$f$e`
%package help
Summary: Development documents and examples for ebookmaker
Provides: python3-ebookmaker-doc
%description help
# Ebookmaker
Ebookmaker is the tool used for format conversion at Project Gutenberg.
It builds HTML5, EPUB2, EPUB3 and Kindle files (including KF8) from HTML.
It builds builds thes formats and PDF files from reST sources.
If you are preparing HTML for use with Ebookmaker, the [Usage Notes](USAGE.md) may be of interest.
## Prerequisites
* Python3 >= 3.7
### Needed only for Kindle generation
* Calibre (https://calibre-ebook.com/) (needed to make Kindle files)
* may need to install Calibre's ebook-convert command line tool https://manual.calibre-ebook.com/generated/en/cli-index.html
### Needed only for validation
* EpubCheck (for EPUB vaidalition) To use EPUBCheck validation, first download and install EPUBCheck from https://www.w3.org/publishing/epubcheck/. If the command to invoke it is `java -jar /Applications/epubcheck-4.2.6/epubcheck.jar`, then add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `epub_validator: java -jar /Applications/epubcheck-4.2.6/epubcheck.jar` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* the W3C "Nu" validator (for HTML5 validation) https://validator.github.io/validator/ add this line to ~/.ebookmaker or /etc/ebookmaker.conf: `html_validator: [something for your install]/vnu-runtime-image/bin/vnu` then turn on validation by adding `--validate` to Ebookmaker's command line invocation or by setting validate to true in ~/.ebookmaker
* on MacOS, you may need to create security exceptions. On my system, I had to do `sudo xattr -r -d com.apple.quarantine /Users/eric/vnu-runtime-image/lib`
### Needed only for cover generation
* Cairo https://www.cairographics.org/download/
* Noto Sans and Noto Sans CJK:
* CentOS or RedHat: `yum install google-noto-sans-cjk-fonts; yum install google-noto-sans-fonts`
* Ubuntu: `apt-get install fonts-noto-cjk fonts-noto`
### Needed only for conversion from RST
* Libertinus Serif and Libertinus Sans https://github.com/alerque/libertinus
* For Linux,
* Download the latest release https://github.com/alerque/libertinus/releases/latest
* unzip, put .otf files into ~/.fonts
* update font catalog `fc-cache -f -v`
* DejaVu Sans Mono https://dejavu-fonts.github.io/
* TexLive (to build PDF from TeX and rst)
Tested with Python 3.8
## Install
(master branch, editable install)
`pipenv install ebookmaker`
Use the ebookmaker.conf file to pass a path to your kindlegen, tex, and groff programs
if they're not in your PATH. Edit the ebookmaker.conf and copy it to /etc/ebookmaker.conf to
reset the paths.
Copy ebookmaker.conf to ~/.ebookmaker to override settings in /etc/ebookmaker.conf or to set default
command line options.
## Sample invocation
(From the directory where you ran `pipenv install`)
`pipenv shell`
`ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
or
`pipenv run ebookmaker -v -v --make=epub.images --output-dir=/Documents/pg /Documents/library/58669/58669-h/58669-h.htm`
## new to pipenv?
Install pipenv (might be `pip install --user pipenv`, depending on your default python)
`$ pip3 install --user pipenv`
The default install location is `${HOME}/.local/bin`, so add this to your login shell's ${PATH} if needed.
Change directories to where you want to have your ebookmaker environment. Then, to initialize a python 3 virtual environment, do
`$ pipenv --three`
Whenever you want to enter this environment, move to this directory and do:
`$ pipenv shell`
Install the gutenberg modules:
`$ pipenv install ebookmaker`
Check your install:
`$ ebookmaker --version`
`EbookMaker 0.12.0`
Since you're in the shell, you can navigate to a book's directory and convert it:
`$ ebookmaker -v -v --make=epub.images --ebook 10001 --title "The Luck of the Kid" --author "Ridgwell Cullum" luck-kid.html`
## Update
`$ cd ebookmaker` to wherever you ran `$ pipenv install ebookmaker`
then:
`$ pipenv update ebookmaker`
## Test
Install, as above.
`$ cd ebookmaker` to wherever you ran `$ pip install ebookmaker`
then:
`$ git checkout master`
`$ pipenv install -e .`
`$ python setup.py test`
Travis-CI will run tests on branches committed in the gutenbergtools org
## Notes running Ebookmaker on Windows Machine (adapted from @windymilla)
1. Install Python 3.7+ from python.org. Install Kindlegen. Add it to the path.
2. Add system environment variable: Right-click "My Computer", then Properties, then Advanced, then Environment variables, then New. Call the variable PYTHON_HOME, and set it to the Python folder.
3. Edit the Path variable and add to the end of it `;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\`
4. Check by starting a new command window and typing `python`. It should run your version of Python. Quit python with `^Z` & Enter.
5. In command window, type `pip3 install --user pipenv`. Script may warn it has put scripts into a folder such as `C:\Users\myname\AppData\Roaming\Python\Python37\Scripts`, and to add this to the Path environment variable. Do this – don't forget the semicolon before the new folder name! (Possibly might work instead to just copy the newly installed files from where they were installed into your main python scripts folder, i.e. `%PYTHON_HOME%\Scripts` ?)
6. Close old command window and start a new (to get the new path)
7. Create a folder for ebookmaker, e.g. `C:\DP\ebookmaker`
8. In command window, go to the new folder
9. Type `pipenv install ebookmaker` – takes a while to install. It will also create a "virtual environment", with a new folder, something like `C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi`
10. (Optional - only if you need ebookmaker to create a book cover for you because you are not providing one)
Download GTK+ to get Cairo. Precompiled Win32 binaries are here: http://ftp.gnome.org/pub/gnome/binaries ... _win32.zip
Unzip this to a folder, e.g. `C:\DP\gtk` and add `C:\DP\gtk\bin` to the Path environment variable.
Exit command window and start a new one to get new path
Go to the ebookmaker folder, `C:\DP\ebookmaker`
11. Type `pipenv run python ebookmaker --version` to check ebookmaker version. If this doesn't work (it should, but didn't work for us) try:
- Look in `C:\Users\myname\.virtualenvs\` and find the name of your virtualenv - it should be something like `ebookmaker-cgaQuYhi`
- Type `pipenv run python C:\Users\myname\.virtualenvs\<name of virtualenv>\Scripts\ebookmaker --version` to check ebookmaker version.
12. (Should not happen now Cairo is optional) If there's error like like no "cairo" or "cairo-2" found, check if your libcairo and libcairo-2 path exist. If they do, edit dlopen in _init_.py in cairocffi package. Return the path found by ctypes.util.find_library directly instead of calling ffi.dlopen(path).
13. If folder/file name contains space, pathnames muse be enclosed in `"`, like `--output-dir="C:\your foldername"`. If pathname is quoted, it MUST NOT end with trailing `\` or error will be raised. If running bat file from within Guiguts, this means you should use `$d.` rather than `$d` (i.e. a dot after $d so quoted pathname will end in `\."` rather than `\"`) when passing it as a value for the output-dir argument.
14. Example run_ebookmaker.bat file for use with Guiguts:
cd C:\DP\ebookmaker
pipenv run python C:\Users\myname\.virtualenvs\ebookmaker-cgaQuYhi\Scripts\ebookmaker -v --make=epub.images --make=kindle.images --output-dir=%1 --title=%2 %3
15. Corresponding "external program" setup within Guiguts:
`c:\dp\ebookmaker\run_ebookmaker.bat $d. $f $d$f$e`
%prep
%autosetup -n ebookmaker-0.12.30
%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-ebookmaker -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 0.12.30-1
- Package Spec generated
|