Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Thomas Goirand Newsgroups: linux.debian.maint.python Subject: Re: Python package providing both modules and an app Date: Tue, 05 Jul 2016 10:40:02 +0200 Message-ID: References: X-Original-To: debian-python@lists.debian.org X-Mailbox-Line: From debian-python-request@lists.debian.org Tue Jul 5 08:37:33 2016 Old-Return-Path: X-Amavis-Spam-Status: No, score=-5.95 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, RCVD_IN_DNSWL_NONE=-0.0001, SARE_TOWRITE=1.05] autolearn=no autolearn_force=no X-Policyd-Weight: using cached result; rate: -5 Organization: Debian User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Mailing-List: archive/latest/13975 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/8f680b97-5019-252e-a93c-4c99ef648409@debian.org Approved: robomod@news.nic.it Lines: 49 Sender: robomod@news.nic.it X-Original-Date: Tue, 5 Jul 2016 10:37:14 +0200 X-Original-Message-ID: <8f680b97-5019-252e-a93c-4c99ef648409@debian.org> X-Original-References: <20160621211338.GC2172@hle.local> Xref: csiph.com linux.debian.maint.python:8640 On 06/21/2016 11:13 PM, Hugo Lefeuvre wrote: > Hi all ! > > I'm currently packaging python-slugify[0], a Python application for > slugifying unicode strings. Like here[1] upstream decided to write > everything as a python module with an entry script placed in /usr/bin > that calls main(). So we can consider python-slugify as both an application > and a library. > > The package is originally requested as a Python module[2] and it seems > clear to me that the whole thing is only useful as a library, so I've > named the source package 'python-slugify'. It provides following packages: > * 'python-slugify' (Python 2 lib), > * 'python3-slugify' (Python 3 lib), > * 'slugify' (ships the entry script[3], depends on python3-slugify). > > Everything is working well. However, I'm not really satisfied by the way I > solved the problem in debian/rules[4]. Does anybody know a better way > of doing that ? > > Cheers, > Hugo Hugo, I did lots of that in OpenStack. You can have a look at one of our tool to handle the dh_auto_install for Python: http://anonscm.debian.org/cgit/openstack/openstack-pkg-tools.git/tree/build-tools/pkgos-dh_auto_install The way to use it in your debian/rules file is to do: pkgos-alternative slugify slugify [ this tool is available at: http://anonscm.debian.org/cgit/openstack/openstack-pkg-tools.git/tree/misc/pkgos-alternative-bin ] then simply do: override_dh_auto_install: pkgos-dh_auto_install and that's it, it will handle the /usr/bin/python{3,}-slugify alternative implementations for you. I hope that helps, Cheers, Thomas Goirand (zigo)