-
Notifications
You must be signed in to change notification settings - Fork 41
/
setup.py
34 lines (30 loc) · 1.01 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys
from setuptools import setup
def required_module(module):
""" Test for the presence of a given module.
This function attempts to load a module, and if it fails to load, a message
is displayed and installation is aborted. This is required because YUM and
createrepo are not compatible with setuptools, and pakrat cannot function
without either one of them.
"""
try:
__import__(module)
return True
except:
print '\n'.join([
'The "%s" module is required, but was not found.' % module,
'Please install the module and try again.'
])
sys.exit(1)
required_module('yum')
required_module('createrepo')
setup(name='pakrat',
version='0.3.2',
description='A tool for mirroring and versioning YUM repositories',
author='Ryan Uber',
author_email='ru@ryanuber.com',
url='https://github.com/ryanuber/pakrat',
packages=['pakrat'],
scripts=['bin/pakrat'],
package_data={'pakrat': ['LICENSE', 'README.md']}
)