Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; '-*-': 0.07; 'distutils': 0.07; 'importerror:': 0.07; 'utf-8': 0.07; 'coding:': 0.09; 'setup.py': 0.09; 'shutil': 0.09; 'sys,': 0.09; 'try:': 0.09; 'url:github': 0.09; 'subject:How': 0.10; 'python': 0.11; 'archive': 0.14; 'easy_install': 0.16; 'setuptools': 0.16; 'subject:distutils': 0.16; 'subject:install': 0.16; 'subject:uninstall': 0.16; 'uninstall': 0.16; 'url:guide': 0.16; 'app': 0.19; "python's": 0.19; 'import': 0.22; 'install': 0.23; 'installation': 0.23; 'script.': 0.24; 'skip:l 30': 0.24; 'stick': 0.24; 'question': 0.24; 'script': 0.25; 'subject:/': 0.26; 'skip:" 20': 0.27; 'installed': 0.27; 'patch': 0.29; 'message- id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'option.': 0.31; 'os,': 0.31; 'file': 0.32; 'url:python': 0.33; 'skip:# 10': 0.33; 'skip:_ 10': 0.34; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'received:209.85': 0.35; 'created': 0.35; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'complete.': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'skip:o 20': 0.38; 'to:addr:python- list': 0.38; 'hosted': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'skip:p 20': 0.39; 'tell': 0.60; 'skip:a 30': 0.61; 'skip:n 10': 0.64; 'here': 0.66; 'sample': 0.67; 'hey,': 0.75; '(script)': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=HZMxdm5oK/t7VBECUaUIRqCeM5yzo74hkhbjOcZVX4s=; b=lRrLP6Nid8vsr0RzEsEDSmucLSlePmG3ynX58lOE1CSETiTK9JVEqE0LRWMN6ZMhxj 8Lfa8W7DnCypZ2F1oODMKwg2PFK6JaxSiJlWfJJG7zUHLpDGOjlXT+Eh8ccnTn3tC8bA PHAMD5/yAa2Oi4ZZ5me8Puxt1xNrX60m74qYIdnOD5sIDMnGwkEJo48TaInl/UpiHY5v 2+ZCyHpfrkeXuqflV1NMeu9E7m/8QzIij8ZiEijNYvKOxhujpIRH2kYPSxZq119Fo+Q+ w13B3c4g3LhBI1PQh0CltDyvRGsbQk36vuOusMpf/Hv1zETqq3XU4l8Q8LAwu4SQBhvW T0Kw== MIME-Version: 1.0 X-Received: by 10.220.155.8 with SMTP id q8mr12104205vcw.42.1365884720797; Sat, 13 Apr 2013 13:25:20 -0700 (PDT) Date: Sun, 14 Apr 2013 01:55:20 +0530 Subject: How to install/uninstall manpages with distutils/setuptools? From: Santosh Kumar To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 57 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365884730 news.xs4all.nl 2597 [2001:888:2000:d::a6]:56312 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43544 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/