Skip to content

Commit

Permalink
fix manpage bullshit (#1434)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 18, 2015
1 parent b7c6572 commit dca8f08
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 128 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
@@ -1,4 +1,4 @@
New in master
New in v7.3.0
=============

Features
Expand Down
97 changes: 0 additions & 97 deletions docs/man/nikola.1

This file was deleted.

Binary file added docs/man/nikola.1.gz
Binary file not shown.
4 changes: 3 additions & 1 deletion scripts/set_version.py
Expand Up @@ -9,6 +9,7 @@
import re
import sys
import glob
import subprocess


def sed_like_thing(pattern, repl, path):
Expand All @@ -34,4 +35,5 @@ def sed_like_thing(pattern, repl, path):
sed_like_thing("release = .*", "release = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py'))
sed_like_thing('__version__ = ".*"', '__version__ = "{0}"'.format(version), os.path.join('nikola', '__init__.py'))
sed_like_thing('New in master', 'New in v{0}'.format(version), 'CHANGES.txt')
os.system("help2man -h help -N --version-string='{0}' nikola > {1}".format(version, os.path.join('docs', 'man', 'nikola.1')))
subprocess.call(["help2man", "-N", "--version-string={0}".format(version), "-n", "static site and blog generator", "-o", os.path.join('docs', 'man', 'nikola.1'), "nikola"])
subprocess.call(["gzip", "-f", os.path.join('docs', 'man', 'nikola.1')])
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[wheel]
universal = 0
universal = 1

[flake8]
ignore=E501
29 changes: 1 addition & 28 deletions setup.py
Expand Up @@ -96,33 +96,6 @@ def expands_symlinks_for_windows():
"\n\tYour best bet is to start again from clean.")


def install_manpages(root, prefix):
try:
man_pages = [
('docs/man/nikola.1', 'share/man/man1/nikola.1'),
]
join = os.path.join
normpath = os.path.normpath
if root is not None:
prefix = os.path.realpath(root) + os.path.sep + prefix
for src, dst in man_pages:
path_dst = join(normpath(prefix), normpath(dst))
try:
os.makedirs(os.path.dirname(path_dst))
except OSError:
pass
rst2man_cmd = ['rst2man.py', 'rst2man']
for rst2man in rst2man_cmd:
try:
subprocess.call([rst2man, src, path_dst])
except OSError:
continue
else:
break
except Exception as e:
print("Not installing the man pages:", e)


def remove_old_files(self):
tree = os.path.join(self.install_lib, 'nikola')
try:
Expand All @@ -136,7 +109,6 @@ def run(self):
expands_symlinks_for_windows()
remove_old_files(self)
install.run(self)
install_manpages(self.root, self.prefix)


setup(name='Nikola',
Expand Down Expand Up @@ -187,6 +159,7 @@ def run(self):
'docs/manual.txt',
'docs/theming.txt',
'docs/extending.txt']),
('share/man/man1', ['docs/man/nikola.1.gz']),
],
entry_points = {
'console_scripts': [
Expand Down

0 comments on commit dca8f08

Please sign in to comment.