Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Added command 'rpm' to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateus Caruccio committed Mar 23, 2012
1 parent 5d59a15 commit 2612990
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion setup.py
Expand Up @@ -35,6 +35,34 @@
5. A method to map an existing class to a Cassandra column family
"""

class rpm(Command):

description = "builds a RPM package"

user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
if has_subprocess:
status = subprocess.call(["python", "setup.py", "bdist_rpm", "--install-script", "rpm-install-script.sh"])

if status:
raise RuntimeError("RPM build failed")

print ""
print "RPM built"
else:
print """
`setup.py rpm` is not supported for this version of Python.
Please ask in the user forums for help.
"""

class doc(Command):

description = "generate or test documentation"
Expand Down Expand Up @@ -101,7 +129,7 @@ def run(self):
install_requires = ['thrift'],
py_modules=['ez_setup'],
scripts=['pycassaShell'],
cmdclass={"doc": doc},
cmdclass={"doc": doc, "rpm": rpm},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 2612990

Please sign in to comment.