pythongssapi / requests-gssapi

An authentication handler for using GSSAPI with Python Requests. Drop-in replacement for old requests-kerberos.
Other
32 stars 21 forks source link

Makefile with srpm target for corp. #7

Closed adelton closed 6 years ago

adelton commented 6 years ago

https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm

I understand changing the name in setup.py is not the right way to do it but I did not find a mechanism to override the name in bdist_rpm invocation.

Providing here as an example of how the package can be easily buildable in copr: https://copr.fedorainfracloud.org/coprs/adelton/custodia/build/701836/

DirectXMan12 commented 6 years ago

Does setting the --name flag not work (https://stackoverflow.com/questions/7123928/setting-the-rpm-package-name-in-bdist-rpm)? Hmm... it appears not.

Perhaps the --spec-only trick from the link above with a light dose of sed?

adelton commented 6 years ago

For the record, the --name causes

$ python setup.py bdist_rpm --name python-requests-gssapi --source-only --dist-dir "." --build-requires=python-setuptools
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --name not recognized

on Fedora 27.

adelton commented 6 years ago

Approach with patching setup.py in the Makefile seems to work -> b738b4aa083e0dc3b85ef816cbe5cdf62a50b545.

DirectXMan12 commented 6 years ago

hmm... I could probably live with patching setup.py

@frozencemetery WDYT?

frozencemetery commented 6 years ago

I'm not entirely clear on what changing name will break, and it sounds like you have reservations with that approach as well. How bad is it actually?

I think I'd prefer using sed to patch, if we go that route.

DirectXMan12 commented 6 years ago

changing name permanently changes the package name when installed via pip, etc.

adelton commented 6 years ago

@DirectXMan12, is there a way to have the rpm package name prefixed with python- while retaining the name as viewed by the python stack without the prefix?

DirectXMan12 commented 6 years ago

not that I know of from the python end, unfortunately, without a sed-like trick.

frozencemetery commented 6 years ago

A further question: why did the file mode on setup.py change?

To be clear, with no change to file mode, and using the sed approach instead of patch, I'm happy to take this change.

adelton commented 6 years ago

The permission change was a bug.

I've now changed the Makefile to use sed. -> 7137aebdbc3118ed0c2f7ad64f67a75524e23260.