Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Buquet
poezio
Commits
601f38f5
Commit
601f38f5
authored
May 31, 2020
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup: add a build_man command and integrate sphinx manpages into install
parent
1ce874b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
12 deletions
+49
-12
setup.py
setup.py
+49
-12
No files found.
setup.py
View file @
601f38f5
#!/usr/bin/env python3
import
os
import
subprocess
import
sys
from
tempfile
import
TemporaryFile
try
:
from
setuptools
import
setup
,
Extension
except
ImportError
:
print
(
'
\n
Setuptools was not found. Install setuptools for python 3.
\n
'
)
import
sys
sys
.
exit
(
1
)
import
os
import
subprocess
from
tempfile
import
TemporaryFile
cmdclass
=
{}
try
:
from
sphinx.setup_command
import
BuildDoc
cmdclass
=
{
'build_man'
:
BuildDoc
}
except
ImportError
:
print
(
'
\n
Sphinx not found, the build_man command will be unavailable.
\n
'
)
current_dir
=
os
.
path
.
dirname
(
__file__
)
...
...
@@ -57,8 +63,30 @@ def check_include(library_name, header):
print
(
'%s headers not found.'
%
library_name
)
return
False
def
sphinx_man
():
expected_sphinx_files
=
[
'build/sphinx/man/poezio.cfg.7'
,
'build/sphinx/man/poezio.keys.7'
,
'build/sphinx/man/poezio.commands.7'
]
found
=
[]
for
item
in
expected_sphinx_files
:
if
os
.
path
.
exists
(
item
):
found
.
append
(
item
)
if
found
:
return
[(
'share/man/man7/'
,
found
)]
return
[]
sphinx_files_found
=
sphinx_man
()
if
not
sphinx_files_found
:
print
(
'
\n
Sphinx-built manpages not found. Only the '
'short handwritten manpages will be installed
\n
'
)
if
not
check_include
(
'python3'
,
'Python.h'
):
import
sys
sys
.
exit
(
2
)
module_poopt
=
Extension
(
'poezio.poopt'
,
...
...
@@ -124,17 +152,26 @@ setup(
package_data
=
{
'poezio'
:
[
'default_config.cfg'
]},
scripts
=
[
'scripts/poezio_logs'
],
entry_points
=
{
'console_scripts'
:
[
'poezio = poezio.__main__:run'
]},
data_files
=
([(
'share/man/man1/'
,
[
'data/poezio.1'
,
'data/poezio_logs.1'
]),
(
'share/poezio/'
,
[
'README.rst'
,
'COPYING'
,
'CHANGELOG'
]),
(
'share/applications/'
,
[
'data/io.poez.Poezio.desktop'
]),
(
'share/metainfo/'
,
[
'data/io.poez.Poezio.appdata.xml'
])]
data_files
=
([
(
'share/man/man1/'
,
[
'data/poezio.1'
,
'data/poezio_logs.1'
]),
(
'share/poezio/'
,
[
'README.rst'
,
'COPYING'
,
'CHANGELOG'
]),
(
'share/applications/'
,
[
'data/io.poez.Poezio.desktop'
]),
(
'share/metainfo/'
,
[
'data/io.poez.Poezio.appdata.xml'
])
]
+
find_doc
(
'share/doc/poezio/source'
,
'source'
)
+
find_doc
(
'share/doc/poezio/html'
,
'build/html'
)),
+
find_doc
(
'share/doc/poezio/html'
,
'build/html'
)
+
sphinx_files_found
),
install_requires
=
[
'slixmpp>=1.5.2'
,
'aiodns'
,
'pyasn1_modules'
,
'pyasn1'
],
extras_require
=
{
'OTR plugin'
:
'python-potr>=1.0'
,
'Screen autoaway plugin'
:
'pyinotify==0.9.4'
,
'Avoiding cython'
:
'cffi'
}
'Avoiding cython'
:
'cffi'
},
cmdclass
=
cmdclass
,
command_options
=
{
'build_man'
:
{
'builder'
:
(
'setup.py'
,
'man'
),
}
},
)
# Remove the link afterwards
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment