Created
January 4, 2012 17:28
-
-
Save primalmotion/1561092 to your computer and use it in GitHub Desktop.
Hack for adding dependencies with setuptools when generating RPMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## add this in the beginning of your setup.py script | |
## and change the RPM_REQUIRED_DEPS variable to reflect your dependencies | |
RPM_REQUIRED_DEPS = "archipel-core, python-imaging, libvirt-python" | |
## HACK FOR DEPS IN RPMS | |
from setuptools.command.bdist_rpm import bdist_rpm | |
def custom_make_spec_file(self): | |
spec = self._original_make_spec_file() | |
lineDescription = "%description" | |
spec.insert(spec.index(lineDescription) - 1, "requires: %s" % RPM_REQUIRED_DEPS) | |
return spec | |
bdist_rpm._original_make_spec_file = bdist_rpm._make_spec_file | |
bdist_rpm._make_spec_file = custom_make_spec_file | |
## END OF HACK | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, this hack can be simplified by creating setup.cfg alongside setup.py