summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2020-09-11 15:15:17 -0400
committerCole Robinson <crobinso@redhat.com>2020-09-13 09:58:39 -0400
commit65a39a74950722eecaf165a42bd743ec86b4ef63 (patch)
tree35026c83e3e67d4b45d1a051780e218b4f962f74 /setup.py
parent8560138cf2269b8bc8f3cf657ed282a2ac9d499f (diff)
downloadvirt-manager-65a39a74950722eecaf165a42bd743ec86b4ef63.tar.gz
man: Convert .pod files to .rst
Used pod2rst for the initial conversion but a lot of manual fixup afterwards. Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/setup.py b/setup.py
index 2c17b67a..6574d95a 100755
--- a/setup.py
+++ b/setup.py
@@ -129,11 +129,6 @@ class my_build_i18n(distutils.command.build.build):
class my_build(distutils.command.build.build):
- """
- Create simple shell wrappers for /usr/bin/ tools to point to /usr/share
- Compile .pod file
- """
-
def _make_bin_wrappers(self):
template = """#!/usr/bin/env python3
@@ -166,25 +161,25 @@ from %(pkgname)s import %(filename)s
def _make_man_pages(self):
- for path in glob.glob("man/*.pod"):
+ from distutils.spawn import find_executable
+ rstbin = find_executable("rst2man")
+ if not rstbin:
+ rstbin = find_executable("rst2man.py")
+ if not rstbin:
+ sys.exit("Didn't find rst2man or rst2man.py")
+
+ for path in glob.glob("man/*.rst"):
base = os.path.basename(path)
appname = os.path.splitext(base)[0]
newpath = os.path.join(os.path.dirname(path),
appname + ".1")
print("Generating %s" % newpath)
- ret = os.system('pod2man '
- '--center "Virtual Machine Manager" '
- '--release %s --name %s '
- '< %s > %s' % (BuildConfig.version,
- appname.upper(),
- path, newpath))
- if ret != 0:
- raise RuntimeError("Generating '%s' failed." % newpath)
-
- if os.system("grep -IRq 'Hey!' man/") == 0:
- raise RuntimeError("man pages have errors in them! "
- "(grep for 'Hey!')")
+ out = subprocess.check_output([rstbin, "--strict", path])
+ open(newpath, "wb").write(out)
+
+ self.distribution.data_files.append(
+ ('share/man/man1', (newpath,)))
def _build_icons(self):
for size in glob.glob(os.path.join("data/icons", "*")):
@@ -375,7 +370,7 @@ class CheckPylint(distutils.core.Command):
spellfiles = lintfiles[:]
spellfiles += list(glob.glob("*.md"))
- spellfiles += list(glob.glob("man/*.pod"))
+ spellfiles += list(glob.glob("man/*.rst"))
spellfiles += ["data/virt-manager.appdata.xml.in",
"data/virt-manager.desktop.in",
"data/org.virt-manager.virt-manager.gschema.xml",