Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43544
| Date | 2013-04-14 01:55 +0530 |
|---|---|
| Subject | How to install/uninstall manpages with distutils/setuptools? |
| From | Santosh Kumar <sntshkmr60@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.575.1365884730.3114.python-list@python.org> (permalink) |
Hey,
I have an app hosted on PyPi, it actually is a small script which is
in bin/ directory of the project. Here is the part of setup.py file of
my app:
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, os, shutil
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
__AUTHOR__ = 'Santosh Kumar'
__AUTHOR_EMAIL__ = 'user@domain.com'
setup(
name='sampleapp',
version='1.02.02',
author=__AUTHOR__,
author_email=__AUTHOR_EMAIL__,
packages=['sampler'],
scripts=['bin/sampler'],
url='https://github.com/sampleapp/sampleapp',
zip_safe=False,
include_package_data=True,
license=open('LICENSE').read(),
description='A sample application',
long_description=open('README.rst').read()
)
if 'install' in sys.argv:
man_path = '/usr/share/man/man1/'
if os.path.exists(man_path):
print("Installing man pages")
man_page = "doc/sampleapp.1.gz"
shutil.copy2(man_page, man_path)
os.chmod(man_path + 'sampleapp.1.gz', int('444', 8))
When uploaded on PyPi, this app can be installed either by downloading
the archive form https://pypi.python.org/pypi/ and doing python
setup.py install or by easy_install or pip. pip is my favorite because
it supports uninstall option.
I can install this app (script) with pip with no problem (to
/usr/bin/). But I can't install the manpage to /usr/share/man/man1/.
That is why I created installation of manpages in my setup.py.
So with the installation of manpages my installation is complete. But
the problem is I can't uninstall the manpages with `pip uninstall
sampleapp`, that will only uninstall the script. So my final question
is there any patch to make distutils install and uninstall man pages?
Please don't tell me about any other packages, I want to stick with
Python's own http://guide.python-distribute.org/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
How to install/uninstall manpages with distutils/setuptools? Santosh Kumar <sntshkmr60@gmail.com> - 2013-04-14 01:55 +0530
csiph-web