summaryrefslogtreecommitdiffstats
path: root/base/common/python/setup.py
blob: 16c1d176051c2f787968f38543133aca1dada1fe (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Authors:
#     Christian Heimes <cheimes@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Copyright (C) 2015 Red Hat, Inc.
# All rights reserved.
#
"""Dogtag client library

In order to build wheels the wheel and setuptools packages are required:

  $ sudo yum install python-wheel python-setuptools

The 'release' alias builds and uploads a source distribution and universal
wheel. The version and release number are taken from pki-core.spec file.

  $ python setup.py release

The 'packages' alias just creates the files locally:

  $ python setup.py packages

For a complete list of all available commands (except for aliases):

  $python setup.py --help-commands
"""

import re
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup


def get_version(specfile='../../../specs/pki-core.spec'):
    version_re = re.compile('^Version:\s*(\d+\.\d+\.\d+)')
    release_re = re.compile('^Release:.*?([\d\.]+)')
    version = release = None
    with open(specfile) as f:
        for line in f:
            if version is None:
                match = version_re.match(line)
                if match is not None:
                    version = match.group(1)
            if release is None:
                match = release_re.match(line)
                if match is not None:
                    release = match.group(1)
            if version is not None and release is not None:
                break
    if version is None or release is None:
        raise ValueError(version, release)
    return "%s.%s" % (version, release)

VERSION = get_version()

setup(
    author='Dogtag Certificate System Team',
    author_email='pki-devel@redhat.com',
    name='dogtag-pki',
    version=VERSION,
    description='Client library for Dogtag Certificate System',
    long_description="""\
This package contains the REST client for Dogtag PKI.

The Dogtag Certificate System is an enterprise-class open source
Certificate Authority (CA). It is a full-featured system, and has been
hardened by real-world deployments. It supports all aspects of certificate
lifecycle management, including key archival, OCSP and smartcard management,
and much more. The Dogtag Certificate System can be downloaded for free
and set up in less than an hour.""",
    license='GPL',
    keywords='pki x509 cert certificate',
    url='http://pki.fedoraproject.org/',
    packages=['pki'],
    requirements=['python-nss', 'requests', 'six'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
        'Topic :: Security :: Cryptography',
    ],
)