bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

Add support for pypi packages #73

Closed Mic92 closed 10 years ago

Mic92 commented 10 years ago

We added recipe.pypi_name in order to allow the package name differ from pypi name.

bernd commented 10 years ago

Thank you!

bernd commented 10 years ago

I added some changes from #78. See 180d5f6.

This removed the pypi_name attribute because I think it is not needed if :python_fix_name? and :python_fix_dependencies? are set on the fpm object.

Does that work for you?

cxhercules commented 7 years ago

@bernd I have been looking at this code and seems to me that the inclusion of recipe.pypi_name gave you the ability to call your package something like mypkg-ansible (recipe-name and deb name) and have pypi_name that would get passed to fpm to look for actual named package.

===> [FPM] Trying to download {"package":"ansible"}
===> [FPM] Searching for ansible==2.2.0.0 {}
===> [FPM] Reading https://pypi.python.org/simple/ansible/ {}
===> [FPM] Best match: ansible 2.2.0.0 {}

So right now I am forced to name my deb package same as python pypi name. Not sure yet how to use the python_fix_name alternative that you used instead.

cxhercules commented 7 years ago

@bernd did a little more code reading and saw that I was expecting all the code to be in cookery when in fact it was not, oops.

So found how do use this by looking at fpm python

class Ansible < FPM::Cookery::PythonRecipe
  name "ansible"
  version "2.2.0.0"
  revision "0"
  arch "all"
  depends 'python', 'python-jinja2', 'python-paramiko', 'python-markupsafe'
  replaces 'ansible'
  fpm_attributes :python_package_name_prefix => 'mypkg'
  fpm_attributes :python_fix_name? => true
  fpm_attributes :no_auto_depends? => true
end